Skip to content

fix(converters): preserve enabled state for Env variables, collection variables for export, import - #8918

Merged
vijayh-bruno merged 2 commits into
mainfrom
fix/postman-env-import-missing-enabled-internal
Aug 14, 2026
Merged

vijayh-bruno merged 2 commits into
mainfrom
fix/postman-env-import-missing-enabled-internal

Conversation

@sanish-bruno

@sanish-bruno sanish-bruno commented Aug 10, 2026 •

Copy link
Copy Markdown
Collaborator

Followup #8681

Description

  • Postman ENV import to Bruno Global, Collection Env, now defaults to true when enabled key is undefined
  • 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 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

Before After
Screen.Recording.2026-08-10.at.3.36.16.PM.mov
Screen.Recording.2026-08-10.at.3.39.08.PM.mov

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.
  • I've run the claude code review skill locally.

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.

sanish-bruno and others added 2 commits August 3, 2026 17:42
…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]>
@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The 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.

Changes

Postman enabled-state handling

Layer / File(s) Summary
Converter state mapping
packages/bruno-converters/src/postman/*
packages/bruno-converters/tests/postman/*
Collection variable conversion preserves disabled states. Environment imports default missing or nullish enabled values to true. Unit tests cover both directions.
Environment testability wiring
packages/bruno-app/src/components/...
tests/utils/page/*
Environment controls expose test identifiers. Playwright helpers expose import, scope, row, and enabled-checkbox locators.
Import state regression coverage
tests/environments/import-environment/*
tests/import/postman/*
Fixtures and Playwright tests verify enabled-state handling for environment and collection variable imports.

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
Loading

Possibly related issues

Possibly related PRs

  • usebruno/bruno#8681 — Covers the same Postman environment conversion fix and regression testing.
  • usebruno/bruno#8775 — Covers the same environment enabled defaulting fix and related tests.
  • usebruno/bruno#8702 — Shares the Playwright environment import utilities and locator changes.

Suggested reviewers: bijin-bruno, sid-bruno, sachin-thakur-bruno

Poem

Postman states cross the stream,
Enabled flags now match the dream.
Checkboxes tell the truth in view,
Tests guard each value through and through.
Imports land with states renewed.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes preserving enabled states for environment and collection variables during import and export.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/postman-env-import-missing-enabled-internal

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sanish-bruno sanish-bruno changed the title Fix/postman env import missing enabled internal fix(converters): preserve enabled state for Env variables, collection variables for export, import Aug 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1d0fbb3 and ba4affe.

📒 Files selected for processing (17)
  • packages/bruno-app/src/components/EnvironmentVariablesTable/index.js
  • packages/bruno-app/src/components/Environments/EnvironmentSelector/EnvironmentListContent/index.js
  • packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/index.js
  • packages/bruno-app/src/components/WorkspaceHome/WorkspaceEnvironments/EnvironmentList/index.js
  • packages/bruno-converters/src/postman/bruno-to-postman.js
  • packages/bruno-converters/src/postman/postman-env-to-bruno-env.js
  • packages/bruno-converters/src/postman/postman-to-bruno.js
  • packages/bruno-converters/tests/postman/bruno-to-postman.spec.js
  • packages/bruno-converters/tests/postman/postman-env-to-bruno-env.spec.js
  • packages/bruno-converters/tests/postman/postman-to-bruno/postman-to-bruno.spec.js
  • tests/environments/import-environment/fixtures/postman-env-mixed-enabled.json
  • tests/environments/import-environment/postman-enabled-state.spec.ts
  • tests/import/postman/fixtures/postman-collection-vars-mixed-disabled.json
  • tests/import/postman/import-collection-vars-disabled-state.spec.ts
  • tests/utils/page/actions.ts
  • tests/utils/page/environments/index.ts
  • tests/utils/page/locators.ts

@github-actions

Copy link
Copy Markdown

CLI Test Results (Linux)

  1 files  223 suites   48s ⏱️
749 tests 749 ✅ 0 💤 0 ❌
751 runs  750 ✅ 1 💤 0 ❌

Results for commit ba4affe.

@vijayh-bruno
vijayh-bruno merged commit 4c41e70 into main Aug 14, 2026
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants