Repository navigation
Retry a refused merge and ask a person only the contested hunk - #989
Conversation
A conflict round whose merge was refused no longer asks a person to resolve the conflict. It runs again in a fresh step against the base's newest head while the base moves between tries and under the round's step ceiling. Out of tries, a person is asked only when both sides changed the same lines with incompatible intent and the model's merge was refused on both tries: a typed product decision showing the two versions (keep A, keep B, or combine). Anything else stops as CoderHelm's own problem.
|
💚 Post-merge health check passed: the deploy of
|
The tests asserted on the typed question and the PR comment with the values in their failure messages, and AfterRefused derived Debug over a PersonOnly. The messages no longer carry those values, and AfterRefused prints only its variant and the reason code.
| .await | ||
| .unwrap_or_else(|e| { | ||
| warn!(run_id = msg.run_id, error = %e, "Could not park the conflict round"); | ||
| false |
There was a problem hiding this comment.
💬 Suggestion: If parking the retry fails, nothing wakes the round (hardening)
round::record has already saved the pending round when set_run_awaiting_ci(...).unwrap_or_else(|e| { warn!(...); false }) runs. If that call errors, it yields false, so no delayed resume is sent, yet the round returns RoundEnd::Parked. The run stays with a pending round and nothing to pick it up, until the stall sweep or another event happens to. Other round paths propagate the error with ?. This function returns RoundEnd rather than Result, so propagating isn't available here. On error, the safer fallback is to send the delayed resume anyway, or to stop as an own problem.
This blocks: On the retry's main path a failed set_run_awaiting_ci still returns Parked, so the pending round is never woken—a stall the PR doesn't exercise
Summary
Follow-up to #987, which merged while this change was in review. When a conflict round's merge was refused, it ended with a comment asking a person to "resolve the conflict on this branch". The rule is that CoderHelm never hands a person work it can do itself.
A refused merge is now CoderHelm's own problem first: the round tries again against the base's newest head. A person is asked only when both sides changed the same lines with incompatible intent. That ask is one typed question that shows the two versions.
Changes
merge3::Refusednow carriescontested, the hunk's two versions. It is set only when the model replied on both tries and its reply was refused for the same hunk. Every other failure, such as a model that never answered, a mechanical merge that failed its checks, or a whole-file check failing, is CoderHelm's own problem and has no contested hunk.pr::refuse_mergepasses it on.resume::run_conflict_round:after_refusedparks the round for a fresh step against the base's newest head. The tries are bounded and tied to progress (Round::steppedon the base head,Round::may_continue). A base that stays put stops after two tries with no progress, and the step ceiling caps a base that keeps moving.PersonOnly::ProductDecision(throughperson_only::admit) with one question: keep this branch's version (A), keep the base's (B), or combine them. The comment shows both versions. Anything else stops as CoderHelm's own problem (own_problems::record), and the round ends unfinished with the reason.xy_merge_keeps_both_sides_and_parses(.rs and .md) now also pins the round's retry and its typed question.Verification
cargo fmt --all --check,rustfmt --check --edition 2021 worker/src/passes/incidents/*.rscargo clippy -p common -p worker -p gateway --all-targets -- -D warningscargo test -p common -p worker -p gateway: all pass. The new tests cover:a_refused_merge_is_retried_against_a_fresh_base_while_that_makes_progress: the first refusal retries; a base that doesn't move stops after three tries as CoderHelm's own problem; a base that keeps moving stops at the step ceiling; a contested hunk is retried first too.a_contested_hunk_out_of_tries_is_one_question_with_both_versions: a typed product decision with the keep A, keep B or combine question; both versions are in the comment; no generic ask and no hand-off phrase.merge3:contestedis set only when the model's replies were refused on the same hunk.brand_spelling.py,domain_examples.py