[PR #3687] [MERGED] fix(cli): environment resolution in the single-entry export format #4495

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3687
Author: @jamesgeorge007
Created: 12/21/2023
Status: Merged
Merged: 12/22/2023
Merged by: @AndrewBastin

Base: 2023.12.1Head: hotfix/cli-env-resolution


📝 Commits (4)

  • a9d4227 fix: CLI environment resolution
  • 1647764 test: increase coverage
  • ecae906 chore: bump CLI version
  • 2b68e57 chore: more comprehensive sample collection and environment exports

📊 Changes

6 files changed (+79 additions, -6 deletions)

View changed files

📝 packages/hoppscotch-cli/package.json (+1 -1)
📝 packages/hoppscotch-cli/src/__tests__/commands/test.spec.ts (+9 -0)
packages/hoppscotch-cli/src/__tests__/samples/req-body-env-vars-coll.json (+30 -0)
packages/hoppscotch-cli/src/__tests__/samples/req-body-env-vars-envs.json (+37 -0)
📝 packages/hoppscotch-cli/src/__tests__/utils.ts (+1 -3)
📝 packages/hoppscotch-cli/src/options/test/env.ts (+1 -2)

📄 Description

Description

This PR fixes an issue with the CLI where the single environment entry export format omits the variables except the first. This led to the ENV_EXPAND_LOOP state when multiple environment variable entries were referred from a collection. For instance, in the request body, as mentioned in the below issue. A corresponding test case is added to verify the behavior.

github.com/hoppscotch/hoppscotch@7db7b9b068/packages/hoppscotch-data/src/environment/index.ts (L34-L55)

Fixes #3675.

Closes HFE-370.

Checks

  • My pull request adheres to the code style of this project
  • All the tests have passed

🔄 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/3687 **Author:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Created:** 12/21/2023 **Status:** ✅ Merged **Merged:** 12/22/2023 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `2023.12.1` ← **Head:** `hotfix/cli-env-resolution` --- ### 📝 Commits (4) - [`a9d4227`](https://github.com/hoppscotch/hoppscotch/commit/a9d42279497143f88a8f877a7c3596338c003ba2) fix: CLI environment resolution - [`1647764`](https://github.com/hoppscotch/hoppscotch/commit/16477641bd0bda4d336523c4471ab8c6c1338e20) test: increase coverage - [`ecae906`](https://github.com/hoppscotch/hoppscotch/commit/ecae906e7a45ae25a615b10654c7b0a7b6f66639) chore: bump CLI version - [`2b68e57`](https://github.com/hoppscotch/hoppscotch/commit/2b68e5734d29686c0c4221628a3fb8794133fd34) chore: more comprehensive sample collection and environment exports ### 📊 Changes **6 files changed** (+79 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-cli/package.json` (+1 -1) 📝 `packages/hoppscotch-cli/src/__tests__/commands/test.spec.ts` (+9 -0) ➕ `packages/hoppscotch-cli/src/__tests__/samples/req-body-env-vars-coll.json` (+30 -0) ➕ `packages/hoppscotch-cli/src/__tests__/samples/req-body-env-vars-envs.json` (+37 -0) 📝 `packages/hoppscotch-cli/src/__tests__/utils.ts` (+1 -3) 📝 `packages/hoppscotch-cli/src/options/test/env.ts` (+1 -2) </details> ### 📄 Description ### Description This PR fixes an issue with the CLI where the [single environment entry export format](https://docs.hoppscotch.io/documentation/clients/cli#_1-single-environment-entry-export-format) omits the variables except the first. This led to the `ENV_EXPAND_LOOP` state when multiple environment variable entries were referred from a collection. For instance, in the request body, as mentioned in the below issue. A corresponding test case is added to verify the behavior. https://github.com/hoppscotch/hoppscotch/blob/7db7b9b0683424a594b85ac5265c4a5ff749586b/packages/hoppscotch-data/src/environment/index.ts#L34-L55 Fixes #3675. Closes HFE-370. ### Checks - [x] My pull request adheres to the code style of this project - [x] All the tests have passed --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:01:29 +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#4495
No description provided.