Repository navigation
fix: preserve stream-backed file bodies during request interpolation … - #7939
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughThis PR prevents variable interpolation on binary or stream-like request bodies by adding an isBinaryRequestBody detector and using it in CLI and Electron interpolate-vars flows; it includes unit, collection, and Playwright E2E tests plus an Express test endpoint to validate byte-exact uploads. ChangesBinary/Stream Body Interpolation Fix
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 preserves stream-backed file request bodies during interpolation and adds regression coverage across Electron, CLI, e2e, and the Bruno test server/collection.
Changes:
- Adds binary request body detection for Buffers and stream-like payloads in Electron and CLI interpolation.
- Adds unit/e2e tests for stream-backed JSON file bodies.
- Adds Bruno test-server endpoints and collection requests for raw file/binary upload verification.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
packages/bruno-electron/src/ipc/network/interpolate-vars.js |
Skips JSON interpolation for binary/stream request bodies. |
packages/bruno-cli/src/runner/interpolate-vars.js |
Mirrors binary/stream interpolation guard in CLI runner. |
packages/bruno-electron/tests/network/interpolate-vars.spec.js |
Adds Electron interpolation regression test. |
packages/bruno-cli/tests/runner/interpolate-vars.spec.js |
Adds CLI interpolation regression test. |
tests/request/binary-file/binary-file-upload.spec.ts |
Adds Electron e2e file/binary upload coverage. |
packages/bruno-tests/src/index.js |
Mounts the file-binary test router before global body parsers. |
packages/bruno-tests/src/file-binary/index.js |
Adds raw upload verification endpoints. |
packages/bruno-tests/collection/file-binary/*.bru |
Adds Bruno collection requests/assertions for binary upload tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CLI Test Results (Linux) 1 files 213 suites 44s ⏱️ Results for commit bd2b1ec. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/bruno-cli/tests/runner/interpolate-vars.spec.js`:
- Line 20: The closing brace line "});" in tests/runner/interpolate-vars.spec.js
is indented with 3 spaces and fails ESLint; fix it by reducing the indentation
to 2 spaces so the closing "});" aligns with the opening block (the test
suite/describe block in interpolate-vars.spec.js).
In `@tests/request/binary-file/binary-file-upload.spec.ts`:
- Line 51: The inline comment next to the LARGE_JSON_BYTES constant is
inconsistent (it says "25 MiB" while the value is 80 * 1024 * 1024); update the
comment to correctly describe the allocated size (e.g., "80 MiB > 20 MiB
threshold") so the comment matches the LARGE_JSON_BYTES value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 9abfd6ea-b749-4768-afee-74a5c2c71611
📒 Files selected for processing (9)
packages/bruno-cli/src/runner/interpolate-vars.jspackages/bruno-cli/tests/runner/interpolate-vars.spec.jspackages/bruno-electron/src/ipc/network/interpolate-vars.jspackages/bruno-electron/tests/network/interpolate-vars.spec.jspackages/bruno-tests/collection/file-binary/binary-upload-json.brupackages/bruno-tests/collection/file-binary/binary-upload-octet-stream.brupackages/bruno-tests/src/file-binary/index.jspackages/bruno-tests/src/index.jstests/request/binary-file/binary-file-upload.spec.ts
Description
Extends #7690
JIRA
Contribution Checklist:
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
New Features
Tests