Skip to content

πŸ› fix: carry Signed-off-by through squash merges - #18204

Merged
kubestellar-prow[bot] merged 4 commits into
v5from
scanner/fix-18203
Nov 14, 2026
Merged

kubestellar-prow[bot] merged 4 commits into
v5from
scanner/fix-18203

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Why. When the hive squash-merged with an empty commit message, GitHub wrote its own default squash body. For #18079 that body held only Co-authored-by lines, so the branch commit's Signed-off-by never reached v5 (f33758f5a). Every branch that merges v5 forward now fails DCO on that commit (first hit: #18193). Nobody saw it because the post-merge monitor skipped bot-authored commits entirely.

Merge path (item 1). The hive no longer leaves the squash body to GitHub.

  • New MergeCreditor.SquashSignoff (src/pkg/github/merge_signoff.go) runs on every hive squash, whether or not issue-author credit is on: relay MergePRVia and all four auto-merge sweep lanes (through mergeOptions). It rebuilds the default body from the branch commits, appends any distinct branch Signed-off-by the body lacks, and refuses the squash with ErrSquashUnsigned (sweep skip reason squash-unsigned) when no non-merge branch commit carries one. It never adds a sign-off on anyone's behalf. Merge-commit and rebase merges are unchanged.
  • A message that already carries a sign-off (the credit path already rebuilds it from the commits) costs no extra request. If the commit list can't be read, the merge keeps the message it already built and logs a warning, the same fail-open stance the credit path takes, because the PR-time DCO gate has already run.
  • Tests: merge_signoff_test.go covers the exact πŸ› fix: de-flake TestMarketplaceRefreshRoutesAndStatus and TestBackfillCoveredByLedger_HealsRecordBelow040Β #18079 shape, deduping, merge-from-base exclusion, credit off, and MergePRVia refusing with zero PUTs. Two existing fixtures were updated to the new behavior: the credit-off case now expects the rebuilt sign-off body, and the pin-only commits now carry a sign-off.

Monitor (item 2). check-dco-trailers.sh still skips the sign-off identity match for bot authors (the bracketed-address edge cases from #6276), but a bot-authored commit with no Signed-off-by is now reported as FAIL <sha> missing-signoff bot-author=.... This applies to both dco-post-merge.yml and dco-push-delta.yml, so the next one shows up on push or within the hour. A self-test case is added. f33758f5a is about 89 non-merge commits back on v5, outside the default 50-commit window, so this does not turn the hourly monitor red on its own.

Not done (item 3). What to do about f33758f5a itself (for example, a DCO_WAIVED_COMMITS entry) is a maintainer call on #18193, which is already merged. It is deliberately left alone here.

Closes #18203

πŸ€– Generated with Claude Code

β€” hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325 requested_by=@clubanderson

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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 14, 2026
@hivecommons-hive

hivecommons-hive Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

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

hive/awaiting-ci: CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: fb0876c51

β€” hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325

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

Read the code at the head; the merge-path change looks correct to me. Routing to a maintainer only because it touches .github/ trust surfaces.

  • src/pkg/github/merge_signoff.go: SquashSignoff returns early for non-squash methods and for a message that already has a sign-off. branchSignoffs skips merge-from-base commits (len(rc.Parents) > 1), dedupes case-insensitively, and ErrSquashUnsigned fires only when no branch commit has one. Both callers (pullrequest.go MergePRVia, and mergeOptions in the sweep lanes) now honour the refusal.
  • .github/scripts/integration-governance.cjs:12 changes the trusted scripts tree hash. A maintainer should confirm it matches the intended .github closure.
  • Open question (low, unverified): src/scripts/check-dco-trailers.sh:339 now reports every non-merge bot-authored commit with no Signed-off-by as FAIL (merges are already skipped at line 330). I could not confirm whether other bot commits (dependabot, release automation) inside the monitor window lack a trailer; if they do, the hourly monitor goes red on them. The PR body only addresses f33758f5a.

This does not decide item 3 of #18203 (f33758f5a itself); the body already leaves that to a maintainer.

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR 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 stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 14, 2026
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Mutation testing

2 mutant(s) in changed files are not reached by any test (NOT COVERED). A maintainer may apply the mutation/acknowledged label to accept this.

File Line Mutation
src/pkg/github/automerge/automerge_merge_credit.go 42 ARITHMETIC_BASE
src/pkg/github/automerge/automerge_merge_credit.go 42 ARITHMETIC_BASE

Verdict: uncovered (#17349).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Nov 14, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Decision needed: @clubanderson should confirm the new TRUSTED_SCRIPTS_TREE pin (630082873462479b5777ebc7d5dc255bae6f8df2) in .github/scripts/integration-governance.cjs:12 matches the enrolled .github closure at this head.

The squash sign-off logic looks correct to me: I read src/pkg/github/merge_signoff.go in full. Non-squash methods pass through, a message already carrying a sign-off costs no request, no branch sign-off returns ErrSquashUnsigned, and a failed commit read fails open. It never adds a sign-off on anyone's behalf.

The only reason for a human is the trust surface: the diff changes the pinned TRUSTED_SCRIPTS_TREE hash (integration-governance.cjs:12) and touches dco-post-merge.yml (comment-only). I can't verify the new hash against the tree from here. I have not approved anything.

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
c73bc62

ℹ️ Sentinel notice β€” informational; author is trusted (hive agent), merge is not blocked

Hive flagged this PR (author @hivecommons-hive[bot], head c73bc62e827e) because it matches behaviors that can override security controls, escalate privileges or damage the codebase. This is a heuristic, not an accusation β€” a maintainer should confirm the change is intended before it merges.

  • sensitive_path β€” changes 1 sensitive path(s) (Touches a sensitive path (OWNERS, workflows, policies, hive config, security docs, …))
    • .github/workflows/dco-post-merge.yml

Hive did not add the sentinel-alert label because this author is trusted. The finding remains recorded for audit and the dashboard Security tab; set sentinel.trusted_authors_block: true to require the blocking label for trusted authors too.

The squash sign-off path now lists PR commits before merging; the test
server 404'd on /pulls/N/commits, failing the successor-bypass case.

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 14, 2026
@hivecommons-hive

hivecommons-hive Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Needs a decision, not a merge:

  • the reviewer swarm returned requires_human @fb0876c
  • the review found: sensitive-paths question from the correctness review
  • reviewer question: @clubanderson should confirm the edits to .github/workflows/dco-post-merge.yml and the TRUSTED_SCRIPTS_TREE literal in .github/scripts/integration-governance.cjs:12 are intended, and whether failing the hourly monitor on any unsigned bot-authored commit is acceptable.
  • the automerge lane will not merge this unattended

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

What to do: approve this head (fb0876c) to merge as-is, or leave a changes requested review (or reply /hive decision <what to change>) and the hive will push the fix.

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.

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-14 14:26 UTC.

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 14, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue labels Nov 14, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

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

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

  • P3 low correctness β€” Shared commits stub hides unexpected /pulls/N/commits calls in 'no API calls' tests (src/pkg/github/automerge/automerge_sweep_test.go:2228): servePRCommitsSigned runs before the t.Fatalf guard in TestSweepSelfAuthoredAutoMergesSkipsRepoWhenAutoMergeDisabled (and the SkipsHeldIssueWithoutPRFetch tests), so a regression that fetched PR comm…

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Decision needed: @clubanderson should decide whether the hive's squash merge may now refuse (squash-unsigned) and whether the .github/workflows/dco-post-merge.yml and integration-governance.cjs trust-pin edits are acceptable.

Code looks correct to me; routing only because it edits CI/governance files and merge gating.

What I read: src/pkg/github/merge_signoff.go (SquashSignoff, squashSignoffMessage, branchSignoffs), the mergeOptions rewrite in automerge_merge_credit.go, the MergePRVia call site in pullrequest.go, and all four sweep lanes. Every squash path now goes through SquashSignoff, and a refusal returns squash-unsigned before executeMergeEffect runs. Merge-commit and rebase methods return early. The squashCreditMessage change only stops appending an empty trailer paragraph. This matches items 1 and 2 of #18203, and item 3 is left alone as the body says.

Trust surfaces touched (a person should confirm): .github/workflows/dco-post-merge.yml (comment only), .github/scripts/integration-governance.cjs:12 (TRUSTED_SCRIPTS_TREE re-pinned, presumably because the enrolled closure changed), and a new refusal condition on the automerge path.

Open question (not a defect): src/scripts/check-dco-trailers.sh:338 now reports every bot-authored commit with no Signed-off-by. I could not verify whether other bot commits inside the default 50-commit window (release automation) lack one and would turn the hourly monitor red.

Also noted: mutation is still in progress and the Sign-off survives the squash / verify PR contents runs show CANCELLED duplicates alongside successes.

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

@hivecommons-hive hivecommons-hive Bot added stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 14, 2026

@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. Verified against the PR head fb0876c:

  • Right path: #18079 was merged by the hive App (f33758f). Every hive squash now goes through MergeCreditor.SquashSignoff: relay/forge MergePRVia and all four sweep lanes via mergeOptions. No other PullRequests.Merge call sites exist.
  • Composer: keeps every distinct branch Signed-off-by once (case-insensitive dedupe), excludes merge-from-base commits, appends missing ones as a trailing block after the Co-authored-by/credit trailers, returns ErrSquashUnsigned when the branch has none, leaves merge/rebase untouched, and never signs on anyone's behalf (so dco-squash-attribution semantics are unchanged).
  • Checker: a bot commit is now reported missing-signoff only when it has no trailer at all; the email regex still extracts bracketed [bot] addresses, so the #6276 identity-match skip is preserved. The workflow change is comment-only. The TRUSTED_SCRIPTS_TREE re-pin equals git rev-parse <head>:src/scripts (630082873462479b5777ebc7d5dc255bae6f8df2) and the governance script requires that re-pin for any src/scripts edit.
  • Monitor impact: no unsigned bot-authored commits exist in the last 50 non-merge commits of v4, v5 or v6, so this does not turn the hourly monitor red on landing. f33758f itself is outside the window; its disposition stays with #18193 as the PR states.
  • Tests: composer and creditor unit tests, MergePRVia refusing with zero merge PUTs, a checker self-test for the unsigned-bot shape, plus changelog.d fragment. Non-blocking follow-up: the sweep-lane squash-unsigned skip reason in mergeOptions has no direct test (mutation report flags that branch); the composer-level refusal it wraps is covered.
  • CI: all non-tide checks green, including DCO, the checker self-test and "Sign-off survives the squash".

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

Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: a040ab56b7c480f299d6c4dafee5220c5a66c5d1

@clubanderson

Copy link
Copy Markdown
Member

/hive decision approve Reviewed head fb0876c: the workflow edit is comment-only, the TRUSTED_SCRIPTS_TREE re-pin matches the new src/scripts tree, and no unsigned bot-authored commit sits in the monitored window of v4/v5/v6, so reporting unsigned bot commits is acceptable. Squash sign-off carry and fail-closed refusal verified with tests.

@clubanderson clubanderson added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 14, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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 merged commit 287138d into v5 Nov 14, 2026
102 of 110 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-18203 branch November 14, 2026 15:16
clubanderson added a commit that referenced this pull request Nov 15, 2026
…ing; repoint email-inbox citation to the v6 config split

Signed-off-by: Andy Anderson <andy@clubanderson.com>
hivecommons-hive Bot pushed a commit that referenced this pull request Nov 18, 2026
…CO (#18667)

* automerge: refuse an unsigned squash only where the repo requires DCO

Since #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 #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>

* docs: re-cite RankActionableIssues for this branch's client.go lines

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
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. author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue

Projects

None yet

1 participant