fix: Import collection variables as the base environment collection environment.#9530
fix: Import collection variables as the base environment collection environment.#9530
Conversation
✅ Circular References ReportGenerated at: 2025-12-30T07:14:15.950Z Summary
Click to view all circular references in PR (167)Click to view all circular references in base branch (167)Analysis✅ No Change: This PR does not introduce or remove any circular references. This report was generated automatically by comparing against the |
|
Notes: |
There was a problem hiding this comment.
Pull request overview
This PR changes how Postman collection variables are imported into Insomnia by mapping them to the workspace's base environment instead of the request group's environment. It also adds a UI option to control whether imported variables should override existing base environment variables on name conflicts.
- Postman collection variables are now imported as base environment resources with
__BASE_ENVIRONMENT_ID__instead of being mapped to request group environment properties - New UI checkbox in the import modal allows users to choose whether to override existing base environment variables when name conflicts occur
- The import logic now merges base environment data based on the user's selection, supporting both 'kv' and regular environment types
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
packages/insomnia/src/ui/components/modals/import-modal/import-modal.tsx |
Adds UI checkbox and tooltip for controlling base environment override behavior during import |
packages/insomnia/src/routes/import.resources.tsx |
Adds overrideBaseEnvironmentData option parameter to import action and passes it to the import function |
packages/insomnia/src/main/importers/importers/postman.ts |
Changes collection variable mapping to create a separate base environment resource instead of setting it on the collection folder |
packages/insomnia/src/main/importers/importers/postman.test.ts |
Adds test for collection variable import as base environment |
packages/insomnia/src/main/importers/importers/__snapshots__/index.test.ts.snap |
Updates snapshot to reflect base environment as separate resource with collection variables moved from request group to environment |
packages/insomnia/src/main/importers/convert.ts |
Removes obsolete code that mapped collection variables to request group environment |
packages/insomnia/src/common/import.ts |
Implements merge logic for base environment data with support for override option and both environment types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/insomnia/src/ui/components/modals/import-modal/import-modal.tsx
Outdated
Show resolved
Hide resolved
packages/insomnia/src/ui/components/modals/import-modal/import-modal.tsx
Outdated
Show resolved
Hide resolved
packages/insomnia/src/ui/components/modals/import-modal/import-modal.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9ab8be1 to
f16fb26
Compare
Changes:
INS-873