[PR #5325] [MERGED] feat: collection variables #5159

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5325
Author: @nivedin
Created: 8/12/2025
Status: Merged
Merged: 8/22/2025
Merged by: @jamesgeorge007

Base: nextHead: feat/collection-variables


📝 Commits (10+)

  • 7e68e4f feat: add collection variable in collection schema
  • 76e5bfa chore: add UI for collection variable
  • c7c94e5 chore: add platform level functions
  • 70fd872 chore: add schema in persistance state
  • a3ba029 chore: update runners
  • 6c851c5 chore: update helper functions
  • 438a672 chore: add request variable to aggregated vars
  • e8dee46 chore: update viewer access options
  • 9294f08 chore: cleanup
  • 9efe226 chore: update envInput and increase tippy z index

📊 Changes

77 files changed (+2688 additions, -765 deletions)

View changed files

packages/hoppscotch-cli/src/__tests__/e2e/fixtures/collections/collection-with-variables.json (+102 -0)
📝 packages/hoppscotch-cli/src/__tests__/e2e/fixtures/collections/multiple-child-collections-auth-headers-coll.json (+9 -1)
📝 packages/hoppscotch-cli/src/__tests__/e2e/fixtures/collections/valid-mixed-versions-coll.json (+1 -0)
📝 packages/hoppscotch-cli/src/__tests__/unit/fixtures/workspace-access.mock.ts (+183 -41)
📝 packages/hoppscotch-cli/src/__tests__/unit/workspace-access.spec.ts (+12 -10)
📝 packages/hoppscotch-cli/src/types/request.ts (+8 -2)
📝 packages/hoppscotch-cli/src/utils/collections.ts (+20 -0)
📝 packages/hoppscotch-cli/src/utils/getters.ts (+31 -4)
📝 packages/hoppscotch-cli/src/utils/pre-request.ts (+8 -4)
📝 packages/hoppscotch-cli/src/utils/request.ts (+4 -2)
📝 packages/hoppscotch-cli/src/utils/workspace-access.ts (+16 -5)
📝 packages/hoppscotch-common/assets/scss/styles.scss (+5 -0)
📝 packages/hoppscotch-common/assets/themes/tippy-themes.scss (+1 -0)
📝 packages/hoppscotch-common/locales/en.json (+1 -0)
📝 packages/hoppscotch-common/src/components.d.ts (+1 -0)
📝 packages/hoppscotch-common/src/components/collections/Collection.vue (+19 -11)
📝 packages/hoppscotch-common/src/components/collections/ImportExport.vue (+2 -1)
📝 packages/hoppscotch-common/src/components/collections/Properties.vue (+104 -78)
📝 packages/hoppscotch-common/src/components/collections/Request.vue (+10 -10)
📝 packages/hoppscotch-common/src/components/collections/SaveRequest.vue (+19 -55)

...and 57 more files

📄 Description

Closes FE-900 #3736

This pull request add collection-level variables in the workflow. User can add variable in collection or folders and the subsequent request can inherit the variables. Also each folder can also inherit their parent collection/ folder variables.

https://github.com/user-attachments/assets/d90a1915-fff8-4187-82d3-65063896f9c6

TODO

  • Import collection variable from other platforms
  • Graphql support(can be iterated once environment is implemented in graphql)
  • Add CLI support
  • Tab reactivity issue when saving collection property
  • Add docs
  • Fix failing tests

🔄 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/5325 **Author:** [@nivedin](https://github.com/nivedin) **Created:** 8/12/2025 **Status:** ✅ Merged **Merged:** 8/22/2025 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `next` ← **Head:** `feat/collection-variables` --- ### 📝 Commits (10+) - [`7e68e4f`](https://github.com/hoppscotch/hoppscotch/commit/7e68e4f940575bfe84d8b6f069cbcbdeb059d545) feat: add collection variable in collection schema - [`76e5bfa`](https://github.com/hoppscotch/hoppscotch/commit/76e5bfaa3f2c501e32c17d465f415dffa7456e35) chore: add UI for collection variable - [`c7c94e5`](https://github.com/hoppscotch/hoppscotch/commit/c7c94e55a2644237421e30926dae83a8beb64d08) chore: add platform level functions - [`70fd872`](https://github.com/hoppscotch/hoppscotch/commit/70fd87266925958ab62453a1f500ae5e04957f8c) chore: add schema in persistance state - [`a3ba029`](https://github.com/hoppscotch/hoppscotch/commit/a3ba0291ae355a31e60ba311a8a3e5f49aad437d) chore: update runners - [`6c851c5`](https://github.com/hoppscotch/hoppscotch/commit/6c851c5175be9165bbf790db6ac543f785e7ab00) chore: update helper functions - [`438a672`](https://github.com/hoppscotch/hoppscotch/commit/438a6726b35168a4593327e4fcfec9e895268862) chore: add request variable to aggregated vars - [`e8dee46`](https://github.com/hoppscotch/hoppscotch/commit/e8dee46aaa4ad7084bca1c090b7f5d0ff09e4d02) chore: update viewer access options - [`9294f08`](https://github.com/hoppscotch/hoppscotch/commit/9294f083357304516044093c1cdee3d9afb88dd9) chore: cleanup - [`9efe226`](https://github.com/hoppscotch/hoppscotch/commit/9efe226bbde89c0f559482ce69bbb8b14cbd7863) chore: update envInput and increase tippy z index ### 📊 Changes **77 files changed** (+2688 additions, -765 deletions) <details> <summary>View changed files</summary> ➕ `packages/hoppscotch-cli/src/__tests__/e2e/fixtures/collections/collection-with-variables.json` (+102 -0) 📝 `packages/hoppscotch-cli/src/__tests__/e2e/fixtures/collections/multiple-child-collections-auth-headers-coll.json` (+9 -1) 📝 `packages/hoppscotch-cli/src/__tests__/e2e/fixtures/collections/valid-mixed-versions-coll.json` (+1 -0) 📝 `packages/hoppscotch-cli/src/__tests__/unit/fixtures/workspace-access.mock.ts` (+183 -41) 📝 `packages/hoppscotch-cli/src/__tests__/unit/workspace-access.spec.ts` (+12 -10) 📝 `packages/hoppscotch-cli/src/types/request.ts` (+8 -2) 📝 `packages/hoppscotch-cli/src/utils/collections.ts` (+20 -0) 📝 `packages/hoppscotch-cli/src/utils/getters.ts` (+31 -4) 📝 `packages/hoppscotch-cli/src/utils/pre-request.ts` (+8 -4) 📝 `packages/hoppscotch-cli/src/utils/request.ts` (+4 -2) 📝 `packages/hoppscotch-cli/src/utils/workspace-access.ts` (+16 -5) 📝 `packages/hoppscotch-common/assets/scss/styles.scss` (+5 -0) 📝 `packages/hoppscotch-common/assets/themes/tippy-themes.scss` (+1 -0) 📝 `packages/hoppscotch-common/locales/en.json` (+1 -0) 📝 `packages/hoppscotch-common/src/components.d.ts` (+1 -0) 📝 `packages/hoppscotch-common/src/components/collections/Collection.vue` (+19 -11) 📝 `packages/hoppscotch-common/src/components/collections/ImportExport.vue` (+2 -1) 📝 `packages/hoppscotch-common/src/components/collections/Properties.vue` (+104 -78) 📝 `packages/hoppscotch-common/src/components/collections/Request.vue` (+10 -10) 📝 `packages/hoppscotch-common/src/components/collections/SaveRequest.vue` (+19 -55) _...and 57 more files_ </details> ### 📄 Description Closes FE-900 #3736 This pull request add collection-level variables in the workflow. User can add variable in collection or folders and the subsequent request can inherit the variables. Also each folder can also inherit their parent collection/ folder variables. https://github.com/user-attachments/assets/d90a1915-fff8-4187-82d3-65063896f9c6 ### TODO - [x] Import collection variable from other platforms - [ ] ~~Graphql support~~(can be iterated once environment is implemented in graphql) - [x] Add CLI support - [x] Tab reactivity issue when saving collection property - [ ] Add docs - [x] Fix failing tests --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:37:56 +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#5159
No description provided.