Skip to content

fix:match to full string - #6272

Merged
sid-bruno merged 1 commit into
usebruno:mainfrom
sid-bruno:fix/converter-issue
Dec 2, 2025
Merged

sid-bruno merged 1 commit into
usebruno:mainfrom
sid-bruno:fix/converter-issue

Conversation

@sid-bruno

@sid-bruno sid-bruno commented Dec 2, 2025 •

Copy link
Copy Markdown
Collaborator

Description

Fix missed in push from existing PR for https://usebruno.atlassian.net/browse/BRU-1823

Fixes #2162 and #4828

Contribution Checklist:

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

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.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed collection variable extraction to correctly identify variable names during format conversion.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 2, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Fixes a bug in Postman collection variable extraction where the key derivation from template string matches incorrectly used the first character ('{') instead of the full matched text with braces removed, resulting in proper variable name extraction.

Changes

Cohort / File(s) Summary
Collection variable extraction bug fix
packages/bruno-converters/src/postman/bruno-to-postman.js
Corrects key derivation from template string matches to use the full match with braces removed, enabling accurate variable name extraction instead of just the opening brace character.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Single file, targeted logic fix with minimal scope
  • Key change: correcting template match key extraction logic
  • Verify the regex match group indexing and brace removal logic are correct

Possibly related PRs

  • usebruno/bruno#6117: Overhauls collection variable gathering and representation in the same file; both PRs improve collection variable extraction handling.

Suggested labels

size/M

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • naman-bruno
  • bijin-bruno

Poem

A curly brace slipped through the gate, 🔑
Single char when full was fate,
Now variables extract with grace,
Templates find their rightful place! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the core fix: correcting the string matching logic to use the full matched string instead of just the first character.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ee4c923 and 1224e95.

📒 Files selected for processing (1)
  • packages/bruno-converters/src/postman/bruno-to-postman.js (1 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() not func ()
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
⏰ 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: Playwright E2E Tests
  • GitHub Check: SSL Tests - Windows
  • GitHub Check: Unit Tests
  • GitHub Check: CLI Tests
  • GitHub Check: SSL Tests - Linux
  • GitHub Check: SSL Tests - macOS
🔇 Additional comments (1)
packages/bruno-converters/src/postman/bruno-to-postman.js (1)

133-140: Correct fix for extracting collection variable keys from template strings

Using match.replace(/{{|}}/g, '') to derive varKey from the full {{var}} match correctly fixes the previous behavior where only part of the match was used, and works cleanly with the existing regex and deduplication logic. Looks good as-is.


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

@sid-bruno
sid-bruno merged commit 9bbcf7e into usebruno:main Dec 2, 2025
naman-bruno pushed a commit to naman-bruno/bruno that referenced this pull request Dec 3, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Jun 18, 2026
2 of 5 tasks
maxenceleblanc pushed a commit to maxenceleblanc/curly_cats2 that referenced this pull request Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export as a Postman Collection removes Variable Value

1 participant