[PR #5055] [MERGED] feat: initial and current value for environment variables #5033

Closed
opened 2026-03-17 02:31:06 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5055
Author: @nivedin
Created: 5/6/2025
Status: Merged
Merged: 5/23/2025
Merged by: @jamesgeorge007

Base: nextHead: feat/initial-current-environment


📝 Commits (10+)

  • 334fcf5 feat: add v2 environment version
  • 9b4be2f chore: add fields for current and initial values
  • a87e230 chore: update request runner
  • e7ab2a7 chore: add current environment service
  • b1d11ba chore: update environment store
  • a57ef99 chore: update importers
  • 6649afb chore: update environment adapter
  • 78224c5 chore: update env tooltip and inspecter
  • d6ba5ca chore: update persistance
  • cf4379f chore: remove console

📊 Changes

60 files changed (+1684 additions, -431 deletions)

View changed files

📝 packages/hoppscotch-cli/src/__tests__/e2e/commands/test.spec.ts (+1 -0)
📝 packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/aws-signature-auth-envs.json (+13 -5)
📝 packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/digest-auth-envs.json (+7 -4)
📝 packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/env-v1.json (+9 -9)
packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/env-v2.json (+13 -0)
📝 packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/request-vars-envs.json (+13 -4)
📝 packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/secret-envs-persistence-scripting-envs.json (+11 -1)
📝 packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/secret-envs.json (+19 -3)
📝 packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/secret-supplied-values-envs.json (+19 -9)
📝 packages/hoppscotch-cli/src/__tests__/unit/getters.spec.ts (+28 -12)
📝 packages/hoppscotch-cli/src/commands/test.ts (+2 -1)
📝 packages/hoppscotch-cli/src/options/test/env.ts (+9 -4)
📝 packages/hoppscotch-cli/src/utils/getters.ts (+20 -2)
📝 packages/hoppscotch-cli/src/utils/request.ts (+4 -2)
📝 packages/hoppscotch-common/locales/en.json (+4 -2)
📝 packages/hoppscotch-common/src/components/environments/Add.vue (+69 -27)
📝 packages/hoppscotch-common/src/components/environments/ImportExport.vue (+3 -3)
📝 packages/hoppscotch-common/src/components/environments/Selector.vue (+37 -11)
📝 packages/hoppscotch-common/src/components/environments/index.vue (+2 -1)
📝 packages/hoppscotch-common/src/components/environments/my/Details.vue (+107 -37)

...and 40 more files

📄 Description

Closes HFE-841 HFE-846 HFE-875 #4531

This PR add's Initial and current value for environment variables

Initial value is the value defined directly in the environment. This value gets synced to the cloud and is shared with your team.

Current value is what gets used when you actually send a request in Hoppscotch. It’s stored locally in your browser and isn’t synced to the cloud.

image

Notes to reviewers

  • Check old enviornment is migrated to new version.
  • Perform usual request run with global, environment and request variables
  • Use the variables in Tests
  • Export and import variables
  • Tooltip and quickpeek is showing the current value of variables

Todo

  • Team Environment selector reset bug
  • Add support for CLI
  • Fix tests
  • Update documentation for CLI and app

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/5055 **Author:** [@nivedin](https://github.com/nivedin) **Created:** 5/6/2025 **Status:** ✅ Merged **Merged:** 5/23/2025 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `next` ← **Head:** `feat/initial-current-environment` --- ### 📝 Commits (10+) - [`334fcf5`](https://github.com/hoppscotch/hoppscotch/commit/334fcf55a0666dfee1467c7fc1534a874db9ef5c) feat: add v2 environment version - [`9b4be2f`](https://github.com/hoppscotch/hoppscotch/commit/9b4be2f393713bbedc127f75f544ed8279ccb1b1) chore: add fields for current and initial values - [`a87e230`](https://github.com/hoppscotch/hoppscotch/commit/a87e2300ba95d9b4d8dbd837780912389cb92cda) chore: update request runner - [`e7ab2a7`](https://github.com/hoppscotch/hoppscotch/commit/e7ab2a7c6e7a0e32beaeeda6be1915a0c5502ab9) chore: add current environment service - [`b1d11ba`](https://github.com/hoppscotch/hoppscotch/commit/b1d11bac360fe6b38925b1f52ba79f8e719cfcee) chore: update environment store - [`a57ef99`](https://github.com/hoppscotch/hoppscotch/commit/a57ef991a2fa8e9c890768b8b60ff8be59ee35c7) chore: update importers - [`6649afb`](https://github.com/hoppscotch/hoppscotch/commit/6649afbafb3b94f3ee68f4b805ff125d2172db13) chore: update environment adapter - [`78224c5`](https://github.com/hoppscotch/hoppscotch/commit/78224c5f16f0222e45253a08f24c63f73c4fb2c2) chore: update env tooltip and inspecter - [`d6ba5ca`](https://github.com/hoppscotch/hoppscotch/commit/d6ba5cac334ebd402eef35ad1be223dad9b80492) chore: update persistance - [`cf4379f`](https://github.com/hoppscotch/hoppscotch/commit/cf4379fbb7e3f14186493df4facde7f10954e332) chore: remove console ### 📊 Changes **60 files changed** (+1684 additions, -431 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-cli/src/__tests__/e2e/commands/test.spec.ts` (+1 -0) 📝 `packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/aws-signature-auth-envs.json` (+13 -5) 📝 `packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/digest-auth-envs.json` (+7 -4) 📝 `packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/env-v1.json` (+9 -9) ➕ `packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/env-v2.json` (+13 -0) 📝 `packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/request-vars-envs.json` (+13 -4) 📝 `packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/secret-envs-persistence-scripting-envs.json` (+11 -1) 📝 `packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/secret-envs.json` (+19 -3) 📝 `packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/secret-supplied-values-envs.json` (+19 -9) 📝 `packages/hoppscotch-cli/src/__tests__/unit/getters.spec.ts` (+28 -12) 📝 `packages/hoppscotch-cli/src/commands/test.ts` (+2 -1) 📝 `packages/hoppscotch-cli/src/options/test/env.ts` (+9 -4) 📝 `packages/hoppscotch-cli/src/utils/getters.ts` (+20 -2) 📝 `packages/hoppscotch-cli/src/utils/request.ts` (+4 -2) 📝 `packages/hoppscotch-common/locales/en.json` (+4 -2) 📝 `packages/hoppscotch-common/src/components/environments/Add.vue` (+69 -27) 📝 `packages/hoppscotch-common/src/components/environments/ImportExport.vue` (+3 -3) 📝 `packages/hoppscotch-common/src/components/environments/Selector.vue` (+37 -11) 📝 `packages/hoppscotch-common/src/components/environments/index.vue` (+2 -1) 📝 `packages/hoppscotch-common/src/components/environments/my/Details.vue` (+107 -37) _...and 40 more files_ </details> ### 📄 Description Closes HFE-841 HFE-846 HFE-875 #4531 This PR add's Initial and current value for environment variables Initial value is the value defined directly in the environment. This value gets synced to the cloud and is shared with your team. Current value is what gets used when you actually send a request in Hoppscotch. It’s stored locally in your browser and isn’t synced to the cloud. ![image](https://github.com/user-attachments/assets/2bcae8cb-8649-4497-8454-c49fe5e770f6) ### Notes to reviewers - Check old enviornment is migrated to new version. - Perform usual request run with global, environment and request variables - Use the variables in Tests - Export and import variables - Tooltip and quickpeek is showing the current value of variables ### Todo - [x] Team Environment selector reset bug - [x] Add support for CLI - [x] Fix tests - [ ] Update documentation for CLI and app --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:31:06 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5033
No description provided.