Skip to content

πŸ› automerge: refuse an unsigned squash only where the repo requires DCO - #18667

Merged
hivecommons-hive[bot] merged 4 commits into
hivecommons:v6from
Danathar:fix/squash-unsigned-dco-gate
Nov 18, 2026
Merged

hivecommons-hive[bot] merged 4 commits into
hivecommons:v6from
Danathar:fix/squash-unsigned-dco-gate

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

Since #18204, the hive refuses to squash-merge any PR whose branch has no Signed-off-by line, and it never checks whether the repo requires DCO at all. In repos without a DCO gate, every Renovate and Dependabot PR, and every human commit made without -s, now sits at 080-awaiting-merge-admission. It then goes stage/stalled with reason squash-unsigned, and there is nothing a person can do about it.

This PR keeps the refusal only where the repo requires DCO. It uses the same rule the stage router already applies to no-dco:

  • If governor.labels.stage.dco.required sets a value for the repo, that value decides.
  • Otherwise the hive looks for a dco/DCO check, either required on the base branch or reported on the head.

Repos with a DCO gate keep the refusal from #18203, and that includes hivecommons/hive, whose PR heads report both dco and DCO. Everywhere else the squash goes out with the message as built, as it did before #18204. Any sign-offs that do exist on the branch are still carried into the merge commit.

There is no new setting. The existing dco.required override now also applies at merge time.

Evidence (knuckle, build 3b50113, times Eastern)

Nothing already covers this:

What changed

  • MergeCreditor.SquashSignoff (src/pkg/github/merge_signoff.go)
    • It now takes the base branch and the head SHA.
    • When the branch has no sign-off, it calls requiresDCO, which checks, in order:
      1. the dco.required override for the repo;
      2. the base branch's required checks (RequiredStatusCheckContexts);
      3. the head's statuses and check runs.
    • Each candidate name is checked with IsDCOContext.
    • If the head's checks can't be read, the refusal stays. A repo that does need DCO never loses it because of a failed read.
  • The dco.required override reaches the merge path
    • Client.SetDCORequired is wired in main_sweeps.go to cfg.Governor.Labels.Stage.DCO.RequiredFor, the same function the stage router reads.
  • Both callers pass base and head through
    • The sweep lanes (mergeOptions) and the merge relay (MergePR), so both follow the same rule.
  • Docs and changelog
    • stage-labels.md (DCO routing section) describes the merge-time rule.
    • Adds changelog.d/fixed-squash-unsigned-dco-gate.md.

DCO repos already ask for the sign-off

In a repo that requires DCO, the stage router already sends an unsigned PR to 071/072 (070 when self-authored) with reason dco-missing. The 072 nudge includes the exact git rebase --signoff command (automerge_stage_dco.go, dcoAsk). That is the actionable note a person sees, so I didn't add a second one.

With this change, squash-unsigned only fires in a DCO repo when the merge-time check finds a gate that the stage pass had not yet seen, for example a dco status that arrived after the lane's CI walk.

Tests

CI on a draft test PR in my fork (base: a copy of v6 at 3b221dde0): v2 Tests (the full Go suite) and v2 CI passed, along with 60 other checks: Danathar#1. The only failure there, verify PR contents, is the fork being unable to pull the private verifier image (403). It is not a code result.

New and updated unit tests:

  • TestSquashSignoffDCOGate (merge_signoff_test.go) covers:
    • no gate and an unsigned branch: merges with the message unchanged;
    • no gate and a partly signed branch: the sign-off is carried and no gate reads are made;
    • dco.required: true: refused without reading the repo;
    • dco.required: false with a detected gate: the override wins and it merges;
    • DCO required on the base: refused;
    • Prow's dco status on the head: refused;
    • the DCO App's DCO check run on the head: refused;
    • a head whose checks can't be read: refused.
  • TestMergePRViaMergesUnsignedSquashWithoutDCOGate: the relay squashes a Renovate-shaped unsigned PR in a repo without a gate and sends GitHub's default message.
  • TestMergePRViaRefusesUnsignedSquash now models a head with Prow's dco status. Without it the PR would now merge.
  • TestUnsignedSquashMergesWithoutDCOGate (automerge) runs the lane-level mergeOptions with no gate, with a dco status, and with the dco.required: false override.
  • TestUnsignedSquashRefusalIsNotSelfReported now sets dco.required: true explicitly.

Locally I ran gofmt -l only, as AGENTS.md requires.

Out of scope

  • The DCO post-merge workflow's bot-author skip.
  • How bot PRs could get signed in DCO repos.
  • The merge-lane path (mergelane/gate.go), which merges with an empty message and never called SquashSignoff.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

Since hivecommons#18204 the hive refused to squash any PR whose branch carries no
Signed-off-by, without asking whether the repo requires DCO at all. In
repos with no DCO gate every Renovate and Dependabot PR, and every
unsigned human commit, stalled at 080-awaiting-merge-admission with
reason squash-unsigned and nothing a person could do.

The refusal now applies only where the repo requires DCO, by the rule the
stage router already uses for no-dco: the governor.labels.stage.dco.required
override when set for the repo, else a dco/DCO context required on the
base branch or reported on the head, read at merge time. A head whose
checks cannot be read keeps the refusal. Elsewhere the squash goes out
with the message as built, as before hivecommons#18204, and any branch sign-offs
that exist are still carried. The sweep lanes (mergeOptions) and the
merge relay (MergePR) share the one decision in SquashSignoff.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 17, 2026

@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. I read requiresDCO in src/pkg/github/merge_signoff.go against the stage router's dcoRequired (automerge_stage_labels.go:908): both consult dco.required first and fall back to a detected gate, so the "same rule" claim in the body holds. Failing closed on an unreadable head, and on more than 3 pages of statuses or check runs, keeps the refusal wherever evidence is incomplete.

One limit worth knowing, not a defect: detection is by context name (IsDCOContext), so a repo that enforces DCO through a differently named workflow, with no dco/DCO context, will now merge unsigned squashes unless it sets governor.labels.stage.dco.required: true. That matches how the router already treats no-dco, and the override covers it.

Tests cover the gate/no-gate/override/unreadable-head matrix and both callers (sweep mergeOptions, relay MergePR). A few checks (mutation, build-go, golangci-lint) were still running at review time.

β€” hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.326

@hivecommons-hive

hivecommons-hive Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

Review findings from reviewer-2 (folded here because this head already carries its hive review):

I read the changed paths in merge_signoff.go (SquashSignoff/requiresDCO/headContextNames), automerge_merge_credit.go and the new tests. I found no code defect. The logic matches the PR body: the override wins, then required checks on base, then dco/DCO on head, and a failed head read keeps the refusal. The main_sweeps.go wiring uses the same RequiredFor the stage router reads.

The open point is policy, not code. This turns a hard refusal into "merge unsigned" for any repo where detection finds no dco/DCO context. Detection is by context name only. A repo that enforces sign-off under a differently named check, or with no check at all, now merges unsigned squashes without the hive noticing; that is a licensing/provenance call. If that is intended, this looks correct to me. Open question I could not verify from the diff: whether IsDCOContext also matches names like DCO / dco.

Suggestion (not a defect): the CI result cited is from a fork PR, so the base-repo v2 Tests run is the one that counts.

Review findings from adjudicator-2 (folded here because this head already carries its hive review):

HUMAN DECISION NEEDED β€” Danathar: confirm the hive may squash an unsigned branch where DCO is only detected from a dco/DCO check, not required by config (DCO/legal policy relaxation).

Delta re-review (f53bf6b…a37ead98). The delta is a merge of main: 6 commits touching base-red memory, GFI, claims and changelog fragments. None of it touches the PR's own files (merge_signoff.go, main_sweeps.go, merge_credit.go, automerge_merge_credit.go). The client.go +3 lines add the unrelated baseRed field. The delta introduces no new security finding.

Previous finding "Relaxes DCO merge refusal" (src/pkg/github/merge_signoff.go): still present, and the code is unchanged. SquashSignoff (merge_signoff.go:67-72) now returns the unsigned message when requiresDCO is false. The design is fail-closed:

  • an unreadable head returns true (merge_signoff.go:~103-108);
  • an empty head returns true;
  • the dco.required override wins.

One residual gap: in a repo with no override, where the base's required checks could not be read and the head has no dco check yet (for example a DCO App status that arrives late), the squash lands unsigned. The PR body acknowledges this case. Whether to accept that DCO-evasion window is a policy decision for a maintainer. I am not asking for a code change.

Review follow-ups: 1 open of 1 (below review.backlog.min_severity: P2)

Non-blocking findings below the backlog filing line, listed here instead of as issues. Tick them off as they are fixed; set review.backlog.min_severity: P3 to file every finding.

  • P3 low security β€” dco.yml enables individual remediation commits (.github/dco.yml:9): The DCO app's allowRemediationCommits.individual is turned on, which relaxes DCO enforcement and is unrelated to this PR's title.

Review findings from adjudicator (folded here because this head already carries its hive review):

HUMAN DECISION NEEDED β€” Danathar correctness re-review of f53bf6b could not run (GitHub API quota 429); a human or a re-dispatch after quota reset must review the delta ac459c3..f53bf6b.

I could not read the delta diff or the PR body, so I make no claims about the code. The previous security finding (src/pkg/github/merge_signoff.go:100, name-based DCO detection) is unverified at this head.

Review findings from reviewer (folded here because this head already carries its hive review):

Code looks correct; the open question is policy, not defects.

I read src/pkg/github/merge_signoff.go (SquashSignoff, requiresDCO, headContextNames) and the mergeOptions caller in automerge_merge_credit.go. The decision order is override, then base-required contexts, then head-reported contexts, and an unreadable head keeps the refusal. The tests cover each branch. I found no defect.

The decision a maintainer owns: with this change an unsigned squash lands whenever no dco/DCO context is required on the base or reported on the head at merge time. That relaxes the DCO/licensing guard that #18204 added for every repo. The PR body says #18203 has no owner decision for repos without a DCO gate, and no issue is linked, so nobody has signed off on this reversal. The residual risk is a DCO check that has not posted to the head yet at merge time, which the stage-router rule treats the same way but which here lets an unsigned commit land irreversibly.

If you accept the reversal, the PR is ready from my read. I have not approved or closed anything.

Evidence bundle `#18667a37ead9` sha256:7e27fc6a889bdb60a0b355ad685585e3f97564c9c7b7d763a693609c8c019530 β€” download from the dashboard or `hivectl review evidence #18667`.

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

@hivecommons-hive

hivecommons-hive Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Needs a decision, not a merge:

Head: verdict requires_human @f53bf6b, 64/64 checks green, DCO yes, soak 0s of 10m0s.

How to release it:

  • After reading the verdict, a trusted merger can submit a GitHub Approve review for the current head and the lane clears the hold on its next pass; /hive approve replies on a PR are acknowledged but not consumed. An ordinary contributor cannot release their own PR.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

Updated 2026-11-18 00:39 UTC.

@clubanderson clubanderson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving head ac459c3c3.

Decision: yes. The hive may squash-merge a branch with no sign-off in a repository that has no DCO gate. The refusal stays wherever DCO is required.

Why:

  • The blanket refusal from #18204 left approved, green pull requests in repositories without a DCO gate stalled with nothing a person could do (the Renovate and contributor pull requests cited in the description). That is a customer-facing failure, and stage-labels.md already promises that an unsigned head on an ungated repository is information only.
  • Nothing is weakened where a gate exists. A repository with a dco / DCO check required on the base or reported on the head still gets the refusal, and that includes this repository. A head whose checks cannot be read is treated as requiring DCO, so the rule fails closed.
  • A repository that enforces sign-off without a check named dco / DCO sets the existing governor.labels.stage.dco.required override. No new setting is added.
  • I read the diff: the override is consulted first, then the base branch's required checks, then the head's statuses and check runs, with bounded paging. The tests cover each branch of that rule.

What happens next: the hold is released and the merge lane takes it from here under the usual gates. This remains the author's pull request.

@kubestellar-prow kubestellar-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Nov 17, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 878e797f7f9b4c0458a402237e57e942bb7a88dd

@clubanderson

Copy link
Copy Markdown
Member

/approve

@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: clubanderson

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 17, 2026
@clubanderson

Copy link
Copy Markdown
Member

Status after approval: this pull request is approved and carries lgtm and approved, but it cannot merge yet. The two required checks PR Type and PR Issue have been stuck in progress since the pull request was opened. The verifier job gets a 404 when it tries to write their results, so they never finish. I re-ran the verifier once and it failed the same way. This is a fault in the verifier, not in this change, and it is tracked in #18764. Nothing was bypassed. The pull request merges by itself once those two checks report; a fresh run of the verifier on this head is what is needed, and the approval stays valid as long as the head does not change.

kubestellar-prow Bot pushed a commit that referenced this pull request Nov 17, 2026
…ame the real blocker (#18772)

* πŸ› Activity monitor: one rule for the human-gate pill and its verbs; name the real blocker

The gate pill lit 'Needs human Β· review' from the cached reviewer verdict
for the head while its verbs acted only on a PR the hive had parked on a
person, so a PR whose sign-off a person had already approved kept offering
Approve / Request changes / Let hive decide and every click answered
'nothing to act on' (#18667).

- stage_tracker_gate.go: one predicate for the reasons a person is owed,
  the verbs that act, and what the item waits on when nothing is owed;
  carried in the payload as human_gate (rows and linked PRs).
- tracker-gate-truth.js: the pill and runRowAction share one mapping; a
  verb is drawn only where the action has something to act on. The review
  reason and a bare needs_human stand only while the row is parked.
- Required checks queued or in progress past
  HIVE_TRACKER_CHECK_STUCK_AFTER (2h) are named as stuck, not running.
- A stale click says what the item is waiting on and re-reads the tracker.

Fixes #18769

Signed-off-by: Andy Anderson <andy@clubanderson.com>

* πŸ› Gate: judge stuck on check runs only; keep the pinned verbs line; no waiting pill on inert rows

Signed-off-by: Andy Anderson <andy@clubanderson.com>

---------

Signed-off-by: Andy Anderson <andy@clubanderson.com>
hivecommons-hive Bot pushed a commit that referenced this pull request Nov 17, 2026
… and fail visibly when it can't (#18796)

* πŸ› PR Verifier: record PR Type / PR Issue with one completed create

The pinned kubebuilder-release-tools v0.4.3 image created each required
check run in_progress and then PATCHed it with the verdict. When GitHub
answered the PATCH with 404 (#18667, run 44069761061) the runs stayed
in_progress for ever, Tide blocked the PR, and the continue-on-error
wrapper job still went green.

The workflow now computes both verdicts in-repo, reusing the existing
port of the upstream rules in integration-governance.cjs (same check
names, output titles and summaries), and records each check with ONE
create that is already completed: no create-then-update, no lookup by
name. A title verdict stays advisory for the wrapper job; a result that
cannot be recorded posts a completed failure run with the reason (best
effort) and fails the job. No image is pulled, so the job leaves the
ARM64 runner and drops packages: read.

Refs #18764

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WcWm7qFmFJp26r9LPdmi3t
Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>

* πŸ“– PR Verifier: say which copy pull_request_target runs

GitHub runs the default branch's copy of a pull_request_target workflow
(verified on the fork: a PR based on a branch carrying this change ran
the default branch's old workflow). Correct the checkout comment.

Refs #18764

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WcWm7qFmFJp26r9LPdmi3t
Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 17, 2026 •

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
#18843 πŸ› 090 and workflow-fence comments: name auto-merge off, and no /lgtm without Prow same files src/docs/labels-and-control-signals/stage-labels.md

hivecommons-hive Bot pushed a commit that referenced this pull request Nov 17, 2026
…eate, and fail visibly when it can't (#18795)

* πŸ› PR Verifier: record PR Type / PR Issue with one completed create

The pinned kubebuilder-release-tools v0.4.3 image created each required
check run in_progress and then PATCHed it with the verdict. When GitHub
answered the PATCH with 404 (#18667, run 44069761061) the runs stayed
in_progress for ever, Tide blocked the PR, and the continue-on-error
wrapper job still went green.

The workflow now computes both verdicts in-repo, reusing the existing
port of the upstream rules in integration-governance.cjs (same check
names, output titles and summaries), and records each check with ONE
create that is already completed: no create-then-update, no lookup by
name. A title verdict stays advisory for the wrapper job; a result that
cannot be recorded posts a completed failure run with the reason (best
effort) and fails the job. No image is pulled, so the job leaves the
ARM64 runner and drops packages: read.

Refs #18764

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WcWm7qFmFJp26r9LPdmi3t
Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
(cherry picked from commit 5750c0f)

* πŸ“– PR Verifier: say which copy pull_request_target runs

GitHub runs the default branch's copy of a pull_request_target workflow
(verified on the fork: a PR based on a branch carrying this change ran
the default branch's old workflow). Correct the checkout comment.

Refs #18764

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WcWm7qFmFJp26r9LPdmi3t
Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
(cherry picked from commit d12c9ec)
No conflicts. A new head so the PR Verifier from hivecommons#18796 records PR Type
and PR Issue: the runs on ac459c3 came from the earlier verifier and
have sat in_progress since 11:23 AM.

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
@kubestellar-prow kubestellar-prow Bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 18, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

New changes are detected. LGTM label has been removed.

This branch adds three lines to client.go above RankActionableIssues, so
after the v6 merge it starts at 5600; scale-envelope.md now cites
5600-5610 and the docs citation check finds AgeMinutes again.

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

@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.

HUMAN DECISION NEEDED β€” @Danathar the earlier security finding (name-based DCO detection; an undetected gate now merges unsigned) is still present and needs a maintainer call.

Docs-currency review of the delta ac459c3..f53bf6b (read at f53bf6b):

  • The delta is a 34-commit merge of the base branch. It does not touch merge_signoff.go, the DCO section of stage-labels.md, or the changelog fragment.
  • Docs: no new finding. stage-labels.md still describes the merge-time rule that the PR body states, including the dco.required override, the dco/DCO context on base or head, and that an unreadable head keeps the refusal. This also discloses that detection is name-based.
  • scale-envelope.md cites RankActionableIssues at client.go:5600-5610. That is correct at this head (client.go:5600).
  • Previous [security] finding (merge_signoff.go:100): still present, unchanged by the delta. I did not re-review it in depth from this perspective.

β€” hive: agent=adjudicator-5 backend=claude model=claude-sonnet-5-5 claude=2.1.326

@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.

HUMAN DECISION NEEDED β€” @Danathar: confirm the maintainers accept relaxing #18203's unconditional unsigned-squash refusal to "only where DCO is detected or dco.required is set" (a DCO/governance policy call).

Delta re-review, a37ead9 vs f53bf6b (correctness).

The delta is a merge of v6 into the branch (v6.44.7 release, #18839, #18834, #18842). Nothing the PR itself owns changed: merge_signoff.go, main_sweeps.go, client.go (PR hunks), the tests and changelog.d/fixed-squash-unsigned-dco-gate.md are not in the delta. I did not review the merged-in v6 code, which landed through its own PRs.

Previous finding [security] merge_signoff.go Relaxes DCO merge refusal: still present. It is the PR's stated intent, not a defect. I re-read merge_signoff.go at head:

  • SquashSignoff (lines 55-82) returns ErrSquashUnsigned only when requiresDCO is true.
  • requiresDCO (92-123) checks the dco.required override first, then the base's required checks, then the head's contexts.
  • It fails closed when head is empty or the head's checks can't be read (108-116).

Correctness read of that code found no in-scope defect. A pre-existing gap, not caused by this PR: a DCO check that is not yet reported on the head when the merge runs would let an unsigned squash through. The PR body acknowledges this case.

Verdict stays requires_human only because of the policy change.

β€” hive: agent=adjudicator backend=claude model=claude-sonnet-5-5 claude=2.1.326

@hivecommons-hive
hivecommons-hive Bot merged commit 8cb94b8 into hivecommons:v6 Nov 18, 2026
71 of 72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants