Skip to content

fix: variables set via setVar should be interpolated only during runtime#6823

Merged
bijin-bruno merged 1 commit intomainfrom
fix/remove-setVar-interpolation
Jan 19, 2026
Merged

fix: variables set via setVar should be interpolated only during runtime#6823
bijin-bruno merged 1 commit intomainfrom
fix/remove-setVar-interpolation

Conversation

@bijin-bruno
Copy link
Collaborator

@bijin-bruno bijin-bruno commented Jan 15, 2026

Description

Variables set via setVar should be interpolated only during runtime using the latest value of highest precedence

Fixes: #6419 (on top of PR #6393)

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.

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 how variables are stored in runtime to prevent premature interpolation. Variables now retain their raw values at assignment time, ensuring proper behavior in subsequent operations and retrievals throughout execution.
  • Tests

    • Updated runtime tests to validate the corrected variable storage behavior.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 15, 2026

Walkthrough

The setVar method in bru.js now stores variable values directly without immediate interpolation. The corresponding test is updated to verify that variables retain their raw template syntax until retrieval.

Changes

Cohort / File(s) Summary
Variable Assignment Behavior
packages/bruno-js/src/bru.js
Removed interpolation from setVar assignment; raw values now stored directly for deferred interpolation on retrieval
Test Alignment
packages/bruno-js/tests/runtime.spec.js
Updated assertion to verify variable stores raw template syntax {{$randomFirstName}} instead of interpolated value

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • naman-bruno

Poem

Variables now hold their breath,
Raw and true, not interpolated yet,
When called, they spring to life anew,
Delayed gratification for values true ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: variables set via setVar now store raw values for interpolation at runtime rather than during assignment.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@github-actions
Copy link

CLI Test Results

  1 files  ±0  140 suites  ±0   48s ⏱️ -10s
235 tests ±0  235 ✅ ±0  0 💤 ±0  0 ❌ ±0 
301 runs  ±0  300 ✅ ±0  1 💤 ±0  0 ❌ ±0 

Results for commit ed51f30. ± Comparison against base commit b1e6a70.

@bijin-bruno bijin-bruno merged commit e5b7aa5 into main Jan 19, 2026
9 checks passed
FraCata00 pushed a commit to FraCata00/bruno that referenced this pull request Feb 9, 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.

Bug: bru.setVar() now interpolates variable references, breaking workflows that need literal template strings

1 participant