Repository navigation
fix: Exporting Bruno collection as Postman collection omits collection variables - #6117
Conversation
…es from collection root and removed the pattern matching implementation
- Replace recursive traversal with iterative stack-based approach - Use Set/Map for O(1) deduplication instead of array operations - Use matchAll() for more efficient regex matching - Improves performance for large collections and avoids stack overflow
… be more close to an AST traversal logic
WalkthroughgenerateCollectionVars in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (CODING_STANDARDS.md)
Files:
🧬 Code graph analysis (1)packages/bruno-converters/src/postman/bruno-to-postman.js (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
🔇 Additional comments (2)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/bruno-converters/src/postman/bruno-to-postman.js(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single parameters
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses. Keep 'em tight
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Avoid single line abstractions where all that's being done is increasing the call stack with one additional function
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-converters/src/postman/bruno-to-postman.js
🧬 Code graph analysis (1)
packages/bruno-converters/src/postman/bruno-to-postman.js (1)
packages/bruno-app/src/utils/collections/index.js (1)
collectionVars(1583-1583)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: SSL Tests - Windows
- GitHub Check: SSL Tests - Linux
- GitHub Check: SSL Tests - macOS
- GitHub Check: Playwright E2E Tests
- GitHub Check: Unit Tests
- GitHub Check: CLI Tests
🔇 Additional comments (2)
packages/bruno-converters/src/postman/bruno-to-postman.js (2)
119-121: LGTM! Variable naming is clearer.The rename from
listOfVarstocollectionVarsbetter reflects the purpose of this array.
147-168: Nice! Variable merging logic preserves values correctly.The merge order
[...reqVars, ...resVars, ...collectionVars]with first-key-wins deduplication ensures that explicitly defined variables fromcollection.root.request.varsretain their values and take precedence over template-discovered variables. This directly addresses the issue where variable values were being lost during export.
150debc to
dace0e3
Compare
…ort-omit-collection-vars fix: Exporting Bruno collection as Postman collection omits collection variables
…ort-omit-collection-vars fix: Exporting Bruno collection as Postman collection omits collection variables
Description
This PR addresses the issue described in JIRA. The earlier implementation relied on pattern matching to export variables, which caused it to miss variables defined in the collection’s pre-request and post-request variable lists. This update resolves the problem by retrieving variables directly from the collection object and removing the pattern-matching approach.
Closes: #2162
Contribution Checklist:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.