Repository navigation
fix(converters): preserve enabled state for Env variables, collection variables for export, import - #8918
Conversation
…ssing the field (#8853) Postman omits `enabled` on some environment variables (or sets it null). The converter passed it through as-is, producing `enabled: undefined`, which fails the environment schema's `enabled: Yup.boolean().defined()` check on the global-environment import path. Default to `true` (Postman's own semantics: a variable without the flag is enabled). Signed-off-by: Richard Ricciardelli <[email protected]> Co-authored-by: Richard Ricciardelli <[email protected]> Co-authored-by: Richard Ricciardelli <[email protected]>
…export, import (#8854) * fix(converters): preserve enabled state for collection variables in Postman conversion Updated the brunoToPostman and postmanToBruno functions to correctly handle the enabled state of collection variables. Disabled variables are now emitted with `disabled: true`, while enabled ones omit the field. Added tests to ensure the correct behavior for both conversion directions. Signed-off-by: Richard Ricciardelli <[email protected]> * feat(tests): add tests for preserving enabled/disabled state in Postman environment and collection imports Introduced new tests to ensure that the enabled state of environment variables and collection variables is correctly preserved during import from Postman JSON files. Added fixtures for mixed enabled/disabled states to validate the functionality. Also updated relevant components with data-testid attributes for improved testability. * refactor(tests): update data-testid attributes for environment components Renamed data-testid attributes in the EnvironmentList component and related tests to improve clarity and consistency. Updated references in the test suite to reflect these changes, ensuring that the correct elements are targeted during testing. This enhances the maintainability and readability of the test code. * test(tests): enhance Postman environment import tests for null-enabled state Updated the Postman environment import tests to include checks for a new variable with a null-enabled state. Modified the test description for clarity and added the corresponding fixture to ensure accurate validation of the enabled/disabled state during imports. --------- Signed-off-by: Richard Ricciardelli <[email protected]>
WalkthroughThe change preserves Postman variable enabled states during import and export. It adds environment UI test identifiers, Playwright helpers, fixtures, and unit and end-to-end tests for enabled, disabled, omitted, and null values. ChangesPostman enabled-state handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PlaywrightTest
participant importEnvironment
participant PostmanConverter
participant EnvironmentVariablesTable
PlaywrightTest->>importEnvironment: Select scope and fixture
importEnvironment->>PostmanConverter: Import Postman data
PostmanConverter->>EnvironmentVariablesTable: Render converted variables
EnvironmentVariablesTable-->>PlaywrightTest: Return enabled checkbox states
Possibly related issues
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/environments/import-environment/postman-enabled-state.spec.ts`:
- Around line 13-15: Update the afterEach teardown in the test to also remove
the imported global environment, using the existing environment cleanup helper
or isolating user data per test so it cannot persist across retries or later
tests; retain the current closeAllCollections cleanup.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 82fd05e3-7cd3-4654-ab82-f18f8290966e
📒 Files selected for processing (17)
packages/bruno-app/src/components/EnvironmentVariablesTable/index.jspackages/bruno-app/src/components/Environments/EnvironmentSelector/EnvironmentListContent/index.jspackages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/index.jspackages/bruno-app/src/components/WorkspaceHome/WorkspaceEnvironments/EnvironmentList/index.jspackages/bruno-converters/src/postman/bruno-to-postman.jspackages/bruno-converters/src/postman/postman-env-to-bruno-env.jspackages/bruno-converters/src/postman/postman-to-bruno.jspackages/bruno-converters/tests/postman/bruno-to-postman.spec.jspackages/bruno-converters/tests/postman/postman-env-to-bruno-env.spec.jspackages/bruno-converters/tests/postman/postman-to-bruno/postman-to-bruno.spec.jstests/environments/import-environment/fixtures/postman-env-mixed-enabled.jsontests/environments/import-environment/postman-enabled-state.spec.tstests/import/postman/fixtures/postman-collection-vars-mixed-disabled.jsontests/import/postman/import-collection-vars-disabled-state.spec.tstests/utils/page/actions.tstests/utils/page/environments/index.tstests/utils/page/locators.ts
CLI Test Results (Linux) 1 files 223 suites 48s ⏱️ Results for commit ba4affe. |
Followup #8681
Description
truewhen enabled key is undefineddisabled: true, while enabled ones omit the field. Added tests to ensure the correct behaviour for both conversion directions.Problem
Enabled state is dropped when exporting, importing collection variables, postman treats absence of enabled key as true, but absence of enabled key cause failures while importing to bruno
Fix
Honor enabled state which exporting and importing collection variables, Env variables enabled key default to true when it is missing in json exported from postman
Screen.Recording.2026-08-10.at.3.36.16.PM.mov
Screen.Recording.2026-08-10.at.3.39.08.PM.mov
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.