Skip to content

fix(runner) - bru runner stopecution should halt the entire run (refactoring) - #9285

Draft
sharan-bruno wants to merge 1 commit into
usebruno:mainfrom
sharan-bruno:fix/bru-runner-stopecution-should-halt-the-entire-run
Draft

sharan-bruno wants to merge 1 commit into
usebruno:mainfrom
sharan-bruno:fix/bru-runner-stopecution-should-halt-the-entire-run

Conversation

@sharan-bruno

@sharan-bruno sharan-bruno commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

BRU-4204
Actual Fix PR is in EE - 1793

Description

Small cleanup in the CLI collection runner (packages/bruno-cli/src/commands/run.js) around the --bail handling. No behaviour change: terminal output, summary table, and reporter output for bail-skipped requests are identical before and after.

Problem

Two leftovers from the original --bail implementation:

bailInfo was assigned when bail triggered but never read anywhere, so it was dead state.
The placeholder result pushed for each request skipped by bail was a 30-line inline object literal inside the bail branch. That made the branch hard to scan and left no reusable way to synthesise a skipped result for other skip reasons.

Fix

Removed the unused bailInfo local and its assignment.
Extracted the placeholder literal into a createSkippedResult(requestItem, skipReason) helper, declared next to runSingleRequestByPathname so it closes over collectionPath. The bail branch now just pushes createSkippedResult(ri, 'bail') for each remaining request.

Screenshots

Before After

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.
  • I've run the claude code review skill locally.

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

  • Refactor
    • Streamlined handling of requests skipped after a run stops early.
    • Standardized the results recorded for requests skipped due to bail conditions.
    • No changes to the overall user-facing behavior are expected.

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 9359056c-57bf-4c71-b99b-98c4a65cd7e1

📥 Commits

Reviewing files that changed from the base of the PR and between a125670 and d438bc0.

📒 Files selected for processing (1)
  • packages/bruno-cli/src/commands/run.js

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

The run command now uses createSkippedResult for bail-skipped requests. The change removes the unused bailInfo variable and its metadata assignment.

Changes

Run bail result handling

Layer / File(s) Summary
Centralize bail skipped results
packages/bruno-cli/src/commands/run.js
Adds createSkippedResult to build skipped-request placeholders. The bail path uses the helper with 'bail'. The unused bailInfo declaration and assignment are removed.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to d438b

The refactor preserves bail skipped-result output, with no identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title identifies the runner and its stop-execution behavior. It also indicates that the change is a refactoring, which matches the pull request objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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

Skipped requests gather in line
A helper shapes each result fine
Bail marks the waiting state
Old metadata leaves the gate
The run stays clear and light

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

@sharan-bruno
sharan-bruno marked this pull request as draft September 17, 2026 12:49
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.

1 participant