Repository navigation
fix(converters): default enabled to true when importing Postman environment variables - #8681
Conversation
…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]>
WalkthroughPostman environment conversion now defaults omitted or null ChangesPostman environment conversion
Estimated code review effort: 2 (Simple) | ~5 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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.
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
enabledtotruein the Postman environment → Bruno environment converter whenenabledisnull/missing. - Add a regression test covering both omitted and
nullenabledcases.
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.
|
Thanks for the PR @ricciardelli We'll review and get back. |
|
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 |
Description
Closes #8680
Internal - [BRU-3960]
Cause: When importing a Postman environment,
postmanToBrunoEnvironmentmappedenabled: i.enabledverbatim. Postman omits theenabledfield on some variables (or sets it tonull), so the resulting Bruno variable hadenabled: 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 withvariables[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
enabledtotruewhen 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 andnullcases and fixes both import paths at the source (the converter). Added a regression test covering the omitted/nullenabledcases.Contribution Checklist:
Evidence
Before
After
Summary by CodeRabbit
enabledvalue, or with a null value, are now enabled by default during conversion.