Skip to content

fix(converters): default enabled to true when importing Postman environment variables - #8681

Merged
sanish-bruno merged 2 commits into
usebruno:fix/postman-env-import-missing-enabledfrom
ricciardelli:fix/postman-env-import-missing-enabled
Aug 3, 2026
Merged

sanish-bruno merged 2 commits into
usebruno:fix/postman-env-import-missing-enabledfrom
ricciardelli:fix/postman-env-import-missing-enabled

Conversation

@ricciardelli

@ricciardelli ricciardelli commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

Closes #8680
Internal - [BRU-3960]

Cause: When importing a Postman environment, postmanToBrunoEnvironment mapped enabled: i.enabled verbatim. Postman omits the enabled field on some variables (or sets it to null), so the resulting Bruno variable had enabled: undefined.

The environment schema declares enabled: Yup.boolean().defined(), which is validated on the global environment save path (store/global-environments.js), so the whole import aborted with variables[N].enabled must be defined. Collection-level import appeared to work only because it doesn't run that same validation — an inconsistency between the two import paths.

Resolution: Default enabled to true when Postman doesn't provide it (enabled: i.enabled ?? true), matching Postman's own semantics that a variable without the flag is enabled. This handles both the missing and null cases and fixes both import paths at the source (the converter). Added a regression test covering the omitted/null enabled cases.

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.

Evidence

Before

Screenshot 2026-07-20 at 15 52 51

After

Screenshot 2026-07-20 at 16 21 30

Summary by CodeRabbit

  • Bug Fixes
    • Postman environment variables without an enabled value, or with a null value, are now enabled by default during conversion.
    • Other converted variable properties remain unchanged.

…ssing the field

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]>
@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Postman environment conversion now defaults omitted or null enabled values to true. A Jest test covers both input cases and verifies the resulting variable properties.

Changes

Postman environment conversion

Layer / File(s) Summary
Default missing enabled values
packages/bruno-converters/src/postman/postman-env-to-bruno-env.js, packages/bruno-converters/tests/postman/postman-env-to-bruno-env.spec.js
Converted variables default enabled to true when Postman omits the field or sets it to null; tests verify the resulting enabled, secret, type, and uid values.

Estimated code review effort: 2 (Simple) | ~5 minutes

Suggested reviewers: bijin-bruno

Poem

Missing fields drift through the night,
Now enabled blooms into light.
Null or absent, both paths agree,
Tests guard the conversion tree.
Postman flows smoothly.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The change addresses #8680 by handling missing or null enabled values so Postman environment imports should no longer fail validation.
Out of Scope Changes check ✅ Passed The edits are narrowly scoped to the converter fix and a regression test, with no unrelated changes apparent.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary converter change: defaulting Postman variable enabled values to true.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copilot AI 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.

Pull request overview

This PR fixes Postman environment imports failing when Postman omits (or sets to null) the enabled field on environment variables, by defaulting Bruno’s enabled to true at conversion time to satisfy Bruno’s schema validation and align with Postman semantics.

Changes:

  • Default enabled to true in the Postman environment → Bruno environment converter when enabled is null/missing.
  • Add a regression test covering both omitted and null enabled cases.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/bruno-converters/src/postman/postman-env-to-bruno-env.js Defaults enabled to true via nullish coalescing during Postman env variable import.
packages/bruno-converters/tests/postman/postman-env-to-bruno-env.spec.js Adds a regression test to ensure omitted/null enabled values convert to true.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@helloanoop

Copy link
Copy Markdown
Contributor

Thanks for the PR @ricciardelli

We'll review and get back.

@sanish-bruno
sanish-bruno changed the base branch from main to fix/postman-env-import-missing-enabled August 3, 2026 11:22
@sanish-bruno
sanish-bruno merged commit daea107 into usebruno:fix/postman-env-import-missing-enabled Aug 3, 2026
@sanish-bruno sanish-bruno added the adopted-by-maintainers PR needs additional work and is now being worked on by the maintainers label Aug 3, 2026
@helloanoop

Copy link
Copy Markdown
Contributor

Thanks @ricciardelli

We've merged this to an internal branch to do some polish before merge. This is being actively worked on and is expected to go out in the v4.2.0 release scheduled for Sep 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adopted-by-maintainers PR needs additional work and is now being worked on by the maintainers size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Importing a Postman environment fails when a variable has no "enabled" field

6 participants