Repository navigation
🐛 fix(reaper): ask for a DCO re-sign in the red-PR kick only when DCO gates - #15033
Conversation
… gates `no-dco` is written on every managed repo but gates only where DCO is enforced (hivecommons#12544): on projectbluefin/utah and bluefin-bling, unsigned mergeraptor and github-actions commits carry it while no DCO check exists. redPRFixKick nonetheless made "re-sign … git push --force-with-lease" the required first step whenever the label was present, so a re-dispatched fixer on a red bot PR in an ungated repo was told to rewrite a branch nothing asked to change. The re-sign stays the required first step when a DCO check (github.IsDCOContext) is among the failing checks; otherwise the kick carries one note to re-sign only if the repository asks for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar <Danathar@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Reviewed (correctness) — approve; one advisory, non-blocking.
The gate predicate reads o.FailingChecks (src/cmd/hive/main.go:9315), which is populated solely from check-runs in EnrichCIStatus (src/pkg/github/client.go:2567-2583); commit statuses never enter it. On this repo the lowercase dco gate is a commit status (/commits/<head>/status → context: "dco"), while DCO is a check-run from the dco app — so the hive is covered by the DCO check-run, but a repo gated only by a Prow-style dco status would now get the soft note instead of the required re-sign. The "dco" case in TestRedPRFixKickDemandsResignOnlyWhenDCOGates (redpr_fix_kick_no_ci_wait_test.go:55) exercises the predicate but can't occur via the real producer. Worth a one-line comment so a future reader doesn't assume status-based gates are detected:
// Only check-runs reach FailingChecks (github.EnrichCIStatus); a
// status-only `dco` context (Prow) is not detected here and falls
// through to the soft note.
if slices.ContainsFunc(o.FailingChecks, github.IsDCOContext) {
— hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Reviewed (intent-alignment) — change matches the title; one advisory gap between the body's claim and the code.
Gate predicate is narrower than the stage writer's (advisory, in-scope). The body says the kick now uses "the same predicate noteStageDCOGate uses to detect a DCO gate". It uses the same name test (github.IsDCOContext), but a different input: src/cmd/hive/main.go:9315 scans o.FailingChecks, which enrichPRCI builds only from completed check-runs with conclusion failure/action_required (src/pkg/github/client.go:2571-2583) and never from commit statuses. noteStageDCOGate instead scans the required-check set plus every observed context (src/pkg/github/automerge/automerge_stage_labels.go:613-617), and dcoRequired additionally honours the per-repo governor.labels.stage.dco.required override (automerge_stage_labels.go:630-636). So on a repo that gates DCO via Prow's dco status only, or via the config override, or where the DCO App check-run is still queued while build already failed, the kick emits the soft note instead of the required re-sign. The note's wording ("re-sign only if this repository asks for it") hedges this, and once the DCO check-run concludes failure the next kick demands the re-sign, so this is a softer-than-before edge, not a wrong demand. Also note the new test's lowercase "dco" case (redpr_fix_kick_no_ci_wait_test.go:56) cannot arise from enrichPRCI today — it only guards the name test.
Suggested: tighten the body/changelog claim so the next reader doesn't assume status-context parity, e.g. in changelog.d/fixed-red-pr-kick-resign-only-when-gated.md:
- **The red-PR fix kick asks for a DCO re-sign only where a DCO check is failing.** `no-dco` is written on every managed repo but gates only where the repository enforces DCO ([#12544](https://github.com/hivecommons/hive/issues/12544)); the FIX-BEFORE-NEW kick nonetheless told the fixer, whenever the label was present, to re-sign the PR's commits and `git push --force-with-lease` first — on a Renovate-style bot branch in a repo with no DCO gate, a rewrite nothing asked for. The re-sign is now the required first step only when a `DCO` check-run is among the PR's failing check-runs (Prow's `dco` status context and the per-repo `dco.required` override are not consulted here); otherwise the kick carries one note to re-sign only if the repository asks for it.
— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Looks correct to me. Read redPRFixKick against the v6 tree, not just the diff:
escalation.Observation.FailingChecksexists and is what the kick already prints asfailing: …(src/pkg/escalation/escalation.go:292,src/cmd/hive/main.go:9321), so gating the re-sign on it adds no new data dependency.github.IsDCOContextis case-insensitivedco(src/pkg/github/commit_ci.go:694-700), covering both the Prowdcoand probotDCOnames the new test exercises;pkg/githubandslicesare already imported inmain.go.FailingChecksis built from check runs with conclusionfailureoraction_required(src/pkg/github/client.go:2578-2592), so the probot DCO app's usualaction_requiredon bot PRs does still trigger the "FIRST (required)" path. A DCO check run is only skipped there when a sibling DCO context already succeeded (dcoSatisfied), which is the right exclusion.- The pre-existing
TestRedPRFixKickNamesDCORehomeFirstForNoDCOalready passesFailingChecks: []string{"DCO"}, so it keeps asserting the required-first ordering under the new condition.
One low note, not a blocker: client.go:2565 calls dcoContextSucceeded(nil, latestCheckRuns) and the failingNames loop walks check runs only — commit statuses never enter FailingChecks. Prow's dco is a commit status. On a repo that enforces DCO solely through Prow's status (no probot app), a red dco would therefore not be in o.FailingChecks and the kick would fall to the soft "no DCO check is failing here" note while DCO does gate. hivecommons/hive itself has both contexts so it is unaffected; whether any managed repo is status-only is a fleet question, so I'm leaving this as an open question rather than a defect.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. |
Summary
no-dcois written on every managed repo, but it gates only where the repository enforces DCO. That was the owner's choice in #12544, andlabels-and-control-signals.mddocuments it: "On an ungated repo an unsigned head keeps the lane's stage, carriesno-dcoas information only, and the nudge does not ask for a rebase." The stage writer and the 085 text follow that rule.The FIX-BEFORE-NEW re-engagement kick (
redPRFixKick,cmd/hive/main.go) did not. Whenever the label was present, it made this the required first step:On projectbluefin/utah and projectbluefin/bluefin-bling, unsigned commits from
mergeraptor[bot]andgithub-actions[bot]carryno-dco, and neither repo has a DCO check: utah#987, utah#975 and bling#124. A red bot PR re-dispatched there would have its fixer told to rewrite a Renovate-style branch that nothing asked to change. I have not seen it happen; the path is reachable.Change
github.IsDCOContext, the same predicatenoteStageDCOGateuses to detect a DCO gate.no-dco, no DCO check is failing here, so re-sign only if the repository asks for it, and fix the failing CI first.I deliberately did not change these:
dco/no-dcofrom the commit check; missing DCO → stage/072 at once #12544.no-dcolabel description, which still says "rungit rebase --signoff" on every repo. Wording it as "gates only where the repository enforces DCO" would repatch the label on every repo, so that is left for a maintainer to decide.Testing
From
src/,TZ=UTC,-count=1:go test ./cmd/hive/passes.gofmtis clean.check-changelog-fragment.sh v6andcheck-docs-citations.pypass.TestRedPRFixKickDemandsResignOnlyWhenDCOGates(new):no-dcoPR whose failing check isbuild_maingets no "FIRST (required)", norebase --signoffand no--force-with-lease, but does get the note.DCOordcofailing, the kick keeps the re-sign.The existing
TestRedPRFixKickNamesDCORehomeFirstForNoDCO(gated,FailingChecks: ["DCO"]) passes unchanged.Mutation check: with the gate forced true, the new test fails. Restored from a backup copy.
Contributor checklist
changelog.d/fixed-red-pr-kick-resign-only-when-gated.md.v6.🤖 Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1