Repository navigation
Unify base fork-point resolution in auto-fix and review watch - #9682
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task
ORB-25021 — Unify base fork-point resolution in auto-fix and review watch
Description
Outcome. One helper resolves a pull request's base: input
base→base_sync_mode_from_input→resolve_worktree_start_point→commit_sha(tip) → optionalgit merge-base <head> <tip>→ branch name withorigin/stripped. All four copies call it; each keeps its own error policy.Evidence (pinned agent-main
046958492249).crates/orbit-engine/src/executor/automation/vcs/landing/review_watch.rs:276-300fork_point→(fork, branch, tip); errors "base '…' could not be resolved: …" and "the fork point of … could not be read: …".crates/orbit-engine/src/executor/automation/vcs/pr/auto_fix/checks.rs:91-110evaluate_red_base: the same steps with byte-identical error strings; stripsorigin/at :109.crates/orbit-engine/src/executor/automation/vcs/pr/auto_fix/checks.rs:137-170recover_ci_rerun: the same steps with?; stripsorigin/at :170 and :198.crates/orbit-engine/src/executor/automation/vcs/pr/auto_fix/checks.rs:392-408base_tip_checks: the steps withoutmerge-base; strips at :408.Behavioural differences and resolution.
fork_pointevaluate_red_baserecover_ci_rerunbase_tip_checksstatus.base_branchfirst, then inputbaseOk(NotEligible)Ok(None)Err(String)with the two messagesOrbitErrorvia?Ok(None); no merge-baseResult<_, String>(the shared messages) with a flag or a separate tip-only function forbase_tip_checks;recover_ci_rerunmaps toOrbitError::Execution— stop and report if any existing test pins its current error textScope and non-goals. Only the base/tip/fork resolution.
required_failures, the CI rerun planner andunmoved_red_basestay as they are. TheCiRerunStep → CiRerunRecoverydouble mapping inrecover_ci_rerun(checks.rs:173-186 and :204-219) may be folded in the same edit since it is in the same function, as a mechanical change.Estimated net: about −25 lines.
Conventions
Acceptance Criteria
landing/review_watch.rsfork_point,pr/auto_fix/checks.rsevaluate_red_base,recover_ci_rerun,base_tip_checks) resolve the base through one shared helper; the two shared error strings exist once.make goldenspasses with goldens unchanged (the required PR checks gate the full suite; AGENTS.md Gates).crates/,plugin/orscripts/.Execution Summary
Click to expand
Outcome: success
Changes: Consolidated the four base-resolution paths in git::resolve_pr_base, keeping the existing caller-specific base selection, missing-base handling, read order, tip-only behavior and error handling. Each shared error string now occurs once. Fork SHAs are trimmed by the helper. Non-mechanical edit: recover_ci_rerun now maps resolution errors to OrbitError::Execution with the shared message, as specified; InvalidInput and ExecutionTimeout variants can consequently collapse to Execution. Its two downstream consumers do not match those variants. No tests pin the former error text. No identifiers were deleted, so the deleted-identifier word-boundary grep is vacuous; the shared error strings were checked repository-wide and each occurs once. Net diff: 41 insertions, 44 deletions, -3 lines.
Validation passed: scripts/build-budget.py -- cargo test -p orbit-engine -p orbit-cli --test engine pr_landing::review_watch (1); same command with pr_landing::auto_fix (34), and pr_landing::ci_rerun (39); make goldens (goldens unchanged); make ci-guards; cargo fmt --all -- --check; scripts/build-budget.py -- cargo clippy -p orbit-engine --lib --bins -- -D warnings -A clippy::disallowed_methods; scripts/build-budget.py -- cargo clippy -p orbit-engine --all-targets -- -D warnings -A clippy::disallowed_methods; RUSTDOCFLAGS="-D warnings" scripts/with-test-build-lint.sh scripts/build-budget.py -- cargo doc --no-deps -p orbit-engine; git diff --check. Manual QA not run: the refactor is covered by existing integration scenarios and does not change a user interface. No additional runtime target was identified in the pilot's focused validation approach.
Reconciliation: baseline HEAD 8c83993 and clean status; only git/mod.rs, landing/review_watch.rs and pr/auto_fix/checks.rs are changed, all inside existing selectors. Scratch logs remain under .orbit/tmp; no other run-owned leftovers. No generated golden changes. Assessment: no known outstanding risks beyond the explicitly specified error-variant change.
Validation
Branch Freshness
refs/remotes/origin/agent-mainorbit/ORB-25021-60afd1d3