Skip to content

🐛 fix(reaper): ask for a DCO re-sign in the red-PR kick only when DCO gates - #15033

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/red-pr-kick-resign-only-when-gated
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/red-pr-kick-resign-only-when-gated

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

no-dco is written on every managed repo, but it gates only where the repository enforces DCO. That was the owner's choice in #12544, and labels-and-control-signals.md documents it: "On an ungated repo an unsigned head keeps the lane's stage, carries no-dco as 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:

FIRST (required): the PR is no-dco — it inherited unsigned commits. Re-sign them: … git rebase --signoff … git push --force-with-lease

On projectbluefin/utah and projectbluefin/bluefin-bling, unsigned commits from mergeraptor[bot] and github-actions[bot] carry no-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

  • Gated: the re-sign stays the required first step when a DCO check is among the PR's failing checks, using github.IsDCOContext, the same predicate noteStageDCOGate uses to detect a DCO gate.
  • Ungated: the kick carries one note instead: the PR carries 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:

Testing

From src/, TZ=UTC, -count=1:

  • go test ./cmd/hive/ passes.
  • gofmt is clean.
  • check-changelog-fragment.sh v6 and check-docs-citations.py pass.

TestRedPRFixKickDemandsResignOnlyWhenDCOGates (new):

  • Ungated: a no-dco PR whose failing check is build_main gets no "FIRST (required)", no rebase --signoff and no --force-with-lease, but does get the note.
  • Gated: with DCO or dco failing, 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: changelog.d/fixed-red-pr-kick-resign-only-when-gated.md.
  • Targets v6.
  • The title uses the emoji convention.
  • Commits include DCO sign-off.
  • Docs: none needed (no doc describes the kick's DCO line).
  • No secrets, credentials or local runtime state are committed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

… 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>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 28, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign danathar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added author/clanker A contributor's own hive authored this PR under their login dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v6

Conflicts are checked with every PR merged onto the current tip of v6, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#15035 🐛 fix(automerge): hold merges whose closing keywords would close the wrong thing same files src/cmd/hive/main.go

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

— hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me. Read redPRFixKick against the v6 tree, not just the diff:

  • escalation.Observation.FailingChecks exists and is what the kick already prints as failing: … (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.IsDCOContext is case-insensitive dco (src/pkg/github/commit_ci.go:694-700), covering both the Prow dco and probot DCO names the new test exercises; pkg/github and slices are already imported in main.go.
  • FailingChecks is built from check runs with conclusion failure or action_required (src/pkg/github/client.go:2578-2592), so the probot DCO app's usual action_required on 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 TestRedPRFixKickNamesDCORehomeFirstForNoDCO already passes FailingChecks: []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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

— hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Hive filed review findings that do not block this PR as backlog items:

Cap: 10 backlog item(s) per PR per day.

@hivecommons-hive
hivecommons-hive Bot merged commit 94ee112 into hivecommons:v6 Oct 28, 2026
65 of 69 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#15033c855720` sha256:09acf3dc40aa4d2af0b8d8a7d9d30d32ba646be4091f5cf28284f5ec924c1e5c — download from the dashboard or `hivectl review evidence #15033`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @Danathar holds role owner and GitHub permission maintain on repo; CI green at c855720.

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/clanker A contributor's own hive authored this PR under their login dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant