Unify the batch and incremental request pipelines - #282
Conversation
|
Warning Review limit reached
Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughIntroduces a ChangesRequestReporter abstraction and batch execution rewiring
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #282 +/- ##
==========================================
- Coverage 92.81% 92.32% -0.50%
==========================================
Files 68 68
Lines 8602 8544 -58
==========================================
- Hits 7984 7888 -96
- Misses 618 656 +38 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@src/core/src/processor/executor.rs`:
- Around line 155-164: The substitution failure log in `substitution_error`
ignores the `_request` argument, so failed batch entries only show a generic
internal error. Update this method to include request context from `HttpRequest`
in the log message, such as the request name, method, and URL, so users can
identify which request failed when `record_failure()` is called.
- Around line 117-151: Skipped-request logging in executor should avoid emitting
raw URLs when secrets are not included. Update `dependency_skipped`,
`conditions_skipped`, and `condition_error` in `executor.rs` to sanitize the
request before passing it to logging, using the same secret-redaction behavior
used elsewhere in the request output path. Keep the existing skip/error counters
and messages, but ensure `output::log_conditions_not_met` and
`output::log_condition_error` receive a sanitized `HttpRequest` or equivalent
redacted URL representation when `include_secrets` is false.
- Around line 143-152: Treat condition evaluation errors as failures when
running in batch mode. Update CallbackReporter::condition_error in executor.rs
so it no longer unconditionally records a skip and returns true; instead, detect
batch mode and mark the request as failed (and honor fail_fast by stopping
further processing as needed) while keeping the existing logging via
output::log_condition_error. Make sure the callback’s failure path aligns with
the Failed status emitted by CallbackReporter and does not inflate success
totals for condition errors.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 22ff87fe-7a38-4897-a409-4c2b005141b4
📒 Files selected for processing (3)
src/core/src/processor/executor.rssrc/core/src/processor/incremental_loop.rssrc/core/src/processor/output.rs
Summary
Collapses the two duplicate per-request orchestrations into one loop behind a reporter seam. The batch engine (CLI) and the incremental engine (GUI/TUI) previously reimplemented the same sequence — dependency checks, condition evaluation, variable/function substitution, pre/post delays, execution and assertions. Now there is a single orchestration with two adapters.
Design — reporter seam (two adapters)
run_requests(processor/incremental_loop.rs) is the single orchestration. It calls aRequestReporterat each decision point and controls fail-fast via the method return value. It owns context tracking and delays, and returns the accumulated request contexts.CallbackReporterwraps the existingFnMut(idx, total, RequestProcessingResult) -> boolcallback and reproduces today's events verbatim — GUI/TUI, the async path, and incremental tests are untouched.BatchReporter(processor/executor.rs) logs each outcome (reusing theoutputhelpers) and aggregates pass/fail/skip counts for the CLI.Each adapter preserves its own outcome semantics (e.g. the batch path counts a condition-evaluation error as a skip; the UI path emits
Failed). The oldprocess_single_request/process_single_fileinline loop (~168 lines of duplicated orchestration) is deleted.Behaviour preserved
result_contexts,.success, assertion results.verbose || fail_fastis threaded so the failing request always has body/headers on fail-fast.Verification
cargo test --workspace✅ (incl. 136 processor tests)cargo clippy --workspace --all-targets -- -D warnings✅Net -63 lines; GUI/TUI/CLI source untouched.
Known minor reduction
CLI verbose mode no longer prints the per-condition evaluation detail (previously
output::log_condition_evaluation_verbose). The capability remains available as public API inconditions::evaluate_conditions_verbose; it is simply no longer called by the batch path, because the unified loop keeps presentation out of the orchestration. Easy to restore later by threading contexts into the reporter if desired.Summary by CodeRabbit
New Features
Bug Fixes