Repository navigation
π dco: re-home unsigned commits on adopted PRs so the gate can clear - #14787
Conversation
The in-place DCO repair mode was decided by adoptionDCORepairMode but never executed, so an adopted PR whose unsigned commits were the hive's own sat at stage 074 with reason=dco-missing forever. The supersede replay also refused any head containing a merge commit, which the update-branch recovery adds. - In-place repair is now implemented for base-repo heads: replay the PR commits through the git-data API with Signed-off-by appended, preserving author/message/tree/parents, and force-update the ref only if it still points at the observed head (once per head). - Fork heads always convert to supersede (dco-rehome): the installation token cannot rewrite a fork branch. - resignAdoptionCommits maps parents inside the PR to their rewritten SHAs so merge commits are replayed instead of aborting the re-sign. Fixes #14666 Signed-off-by: Andy Anderson <andy@clubanderson.com>
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply. |
|
Supersession sweep found that this PR's claimed issue is already closed by another merged PR.
Decision needed (@hivecommons): #14688 already merged and closed the claimed issue, but this PR touches files the merged PR did not. Recommended: keep open until the extra changes are reviewed, or close as superseded if they are not wanted. Another option: merge anyway. Files the merged PR did not touch: This comment is edited in place by the supersession sweep; it is not duplicated. |
|
@clubanderson this PR is held at Failing checks:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. |
β¦test covers fork vs base head Signed-off-by: Andy Anderson <andy@clubanderson.com>
There was a problem hiding this comment.
The direction is right β the base genuinely decides AdoptModeInPlace and then never executes it β but the PR's own regression tests fail on this head, and the new repair path has a one-shot latch that recreates the "holds at 074 forever" symptom on a transient error.
Verified on head ff3166c, CI run 40614835301 (test (rest 1/4), job 122577845351):
--- FAIL: TestAlreadyAdoptedInPlaceAppAuthoredDCOFailureInBaseRepoResignsInPlaceβautomerge_contributor_adopt_test.go:1255: in-place repair must not supersede or comment: res={Items:1 Writes:0 Comments:1 β¦}.Writes:0withComments:1meanssettleAdoptionnever enteredrepairAdoptedDCOInPlace; it took the nudge/comment branch instead. The guard it must pass isadoptedHeadNeedsDCORepairβadoptionDCORepairMode, which now additionally requiresheadInBaseRepo(obs)(automerge_contributor_adopt.go:~297,obs.HeadRepo != ""and equal toowner/repo). I could not confirm from the diff alone whether the harness observation setsHeadRepo; that is the first thing I would check. Open question, not a verdict.--- FAIL: TestAdoptionDCORehomeDecisionAndRenderingβ same job, same newHeadReporequirement is the likely cause for thecanPush=truefixtures aroundautomerge_contributor_adopt_test.go:520, since every pre-existing fixture that reachedAdoptModeInPlacedid so withoutHeadRepo.
One defect in the new code, independent of the tests (repairAdoptedDCOInPlace, automerge_contributor_adopt.go new block):
store.MarkDCORepair(key, obs.HeadSHA)runs beforeeffects.Execute, and the function starts withif rec.DCORepairAttempted(obs.HeadSHA) { return 0, nil }. So aGetReffailure, aCreateCommitfailure or anUpdateReffailure (all returned asNotApplied) leaves the head permanently marked attempted; the next sweep returns 0 for the same head and the PR sits atstage/074withdcored β exactly the live symptom on #14710 the body describes, now with a different cause. The "head moved" case is fine (new SHA, new attempt); the transient-API case is not. Move the mark after a successfulUpdateRef, or mark only onNotAppliederrors that are not retryable. Severity: medium β operator-visible stall, no data loss.
What I checked and found correct: resignAdoptionCommits now maps in-PR parents to rewritten SHAs and adds the trailer only to single-parent commits, which matches the DCO checks' merge-commit exemption; the GetRef == obs.HeadSHA pre-check before rewrite closes the race the old supersede path had; forcing fork heads to supersede is right because the App token cannot write a fork ref (canPushToPRBranch at :1071-1079 already encodes this, so headInBaseRepo duplicates rather than contradicts it).
Docs row in src/docs/labels-and-control-signals.md reads consistent with the new dco-rehomed reason. I have not approved or closed anything.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Two tests in this PR's own package fail at ff3166c (test (rest 1/4), run 40614835301; the coverage red is downstream of it). Both are the diff's, not infra.
1. TestAdoptionDCORehomeDecisionAndRendering β automerge_contributor_adopt_test.go:525. The fixture obs (lines 507-514) sets Number/Author/Title/BaseRef/Body/Detail but no Owner, Repo or HeadRepo. The new guard at automerge_contributor_adopt.go:295 is canPushInPlace && headInBaseRepo(obs) && β¦, and headInBaseRepo (:303-305) returns false for an empty HeadRepo, so adoptionNeedsDCORehome(obs, true) now re-homes and the assertion "branch push permission with only hive-authored unsigned commits allows in-place repair" trips. The guard itself looks right β resignAdoptionCommits + Git.UpdateRef write to obs.Owner/obs.Repo, which only reaches the branch when the head lives in the base repo β so the fixture needs Owner: "acme", Repo: "widget", HeadRepo: "acme/widget" (and the "without push permission" sibling assertion still holds with it).
2. TestAlreadyAdoptedInPlaceAppAuthoredDCOFailureInBaseRepoResignsInPlace β :1255. Failure text: res={Items:1 Writes:0 Comments:1 β¦} pulls=[] edits=[] comments=[]. The rewrite itself succeeded (the newCommits == 2 and refs == "signed2" assertions above it passed), so the repair path works; something after repairAdoptedDCOInPlace returned (1, nil) still counted one comment on the same observation. I could not run the suite from this pod to pin which writer β open question for you: is it the normal 074/nudge comment continuing after settleAdoption returns, in which case the in-place branch should short-circuit the rest of the sweep for that PR?
No findings on the rewrite logic: the multi-parent replay (resignAdoptionCommits, inPR/rewritten maps) correctly leaves merge commits unsigned and only maps parents that are inside the PR; the GetRef == HeadSHA check before UpdateRef(force) closes the race with a contributor push. go build ./pkg/github/automerge/... ./pkg/stagelabels/... passes.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
β¦before the fork case Signed-off-by: Andy Anderson <andy@clubanderson.com>
There was a problem hiding this comment.
Style (delta re-review at 43ef1f5) β both previous findings are fixed (fixture now sets HeadRepo at automerge_contributor_adopt_test.go:527; in-place repair asserts res.Comments != 0 at :1265). One leftover from the delta:
src/pkg/github/automerge/automerge_contributor_adopt.go:859 β the doc comment still says "Returns 1 when the branch moved", but the body now returns 0 on success (:906). The comment contradicts the code.
// and the DCO gate clears. Returns 0: a branch push is not a comment, so
// nothing is added to the caller's count.
β hive: agent=adjudicator-4 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Reviewed (docs-currency, delta ff3166c β 43ef1f5) β operator doc (src/docs/labels-and-control-signals.md) still matches the behavior; both prior correctness findings (test fixture HeadRepo at automerge_contributor_adopt_test.go:525-527, comment count at :1265) are fixed at this head.
One advisory nit introduced by the delta: src/pkg/github/automerge/automerge_contributor_adopt.go:859 still says the function returns 1, but :906 now returns 0 unconditionally.
// and the DCO gate clears. Returns 0: a branch push is not a comment, so
// it adds nothing to the caller's count.
β hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the diff against v5 plus settleAdoption, supersedeAdoptedPR (automerge_contributor_adopt.go:704), and the effects.Execute/KindBranchPush call sites in automerge_bot_takeover.go. The two root causes the body names are both closed by the diff, and the new path follows the existing adoption idioms (mark-before-call, NotApplied on refusal, MarkHivePushedHead after the ref moves). Looks correct to me.
What I verified:
headInBaseRepo(automerge_contributor_adopt.go:302-304) is the right gate: the git-data API can only rewrite a ref in the base repo, so a fork head with only hive-unsigned commits now goes toAdoptModeSupersedeinstead of silently matchingInPlaceand doing nothing.resignAdoptionCommitsmerge handling: parents inside the PR map throughrewritten, parents outside are kept, and a non-topological listing returns""rather than detaching (:818-830). Merge commits keep their message untouched, which matches what the DCO checks exempt.repairAdoptedDCOInPlaceis tried beforeadoptedHeadNeedsDCORehome(:931-934), so the in-place case no longer falls through to "nothing", and the once-per-head mark is set only afterHeadRefis known (:862-868), so a store record without a ref is retried once the sweep has one.
One low-severity dead end, not a blocker:
automerge_contributor_adopt.go:862β onceMarkDCORepairhas run, every later sweep returns at this line before:934is reached. If the first attempt is refused for a reason that will not change on the same head (cannot be replayed with sign-offat:889, or anUpdateReferror), the PR sits DCO-red with a warn log and nothing visible on the PR β unlike the re-home path, which escalates to 085 with a comment (:946-958). Suggest letting an already-attempted head fall through to the re-home/escalation path, or noting the refusal the way the workflow-path fence does.
Info only: GetRef β UpdateRef(force) is not atomic (the git-data API has no expected-SHA), so the "head moved" guard narrows the race rather than closing it. Acceptable given the adoption context, just worth knowing when reading the log line.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Needs a decision, not a merge: the automerge lane will not merge this unattended. Head: verdict approved @6e385de, 61/62 checks green, 1 pending, DCO yes, soak 0s of 30m0s. How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
/hive decision supersede now: adopt #14787 in supersede mode, preserving the author's commits and sign-off; do not wait for the grace deadline Rationale: the contributor is offline; adoption in supersede mode keeps the work moving (#13975). Decided by the hive at @clubanderson's request as the owner's delegate under the owner-delegate policy (rule |
|
/lgtm Posted by @clubanderson from the Hive dashboard; the merge gate decides from here. |
|
@hivecommons-hive[bot]: changing LGTM is restricted to collaborators DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/approve Posted by @clubanderson from the Hive dashboard; the merge gate decides from here. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hivecommons-hive[bot] 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 |
#14930) The hover's Trail clause read h.stage from the stage-tracker history entries, but StageTrackerHop emits number/slug β so every hop stringified to "undefined" (#14787 hovered as "Trail: undefined β undefined β undefined β undefined"). The renderer now names hops by the stage table's short word (slug before the table loads), skips hops it cannot name, and omits the clause when fewer than two remain. Go and node tests pin the wire shape on both sides; the UI fixtures use the live shape. Fixes #14928 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 6e385de. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Problem
#14666 was closed by #14688, which re-signs commits on the supersede re-home path. A gap remained, seen live on #14710 (fork head,
stage/074-adopted-by-hive,no-dco, probotdcored): the hive loggedreason=dco-missingon every pass and never re-signed anything.Root cause:
adoptionDCORepairModereturnsAdoptModeInPlacewhen every unsigned commit is the hive's own and the branch is pushable β but nothing ever executed that repair. The in-place "rewrite" was a decision without an implementation, so the PR held at 074 indefinitely. (The old testTestAlreadyAdoptedInPlaceAppAuthoredDCOFailureStaysInPlacecodified the no-op.)resignAdoptionCommitsbailed on any head containing a merge commit. The update-branch recovery (Adopted PRs red only from a since-fixed shared-CI flake are escalated instead of updated/re-runΒ #14500) adds aMerge branch 'v5' into β¦commit, so even the supersede path would have pushedhive/adopt-<n>with the unsigned commit intact.Fix
repairAdoptedDCOInPlacereplays the PR commits via git-data (author/message/tree/parents preserved,Signed-off-byof the App appended), thenUpdateRef(force)only if the ref still points at the observed head (lease check). Once per head (dco_repair_headin the stage record), under theeffectsmutation wrapper, logged asreason=dco-rehomed.mode=supersede/reason=dco-rehome, even when all unsigned commits are hive-authored.resignAdoptionCommitsmaps parents inside the PR to their rewritten SHAs, so merge commits are replayed instead of aborting.Observation.HeadRefadded so the engine knows which ref to update.Tests
TestAlreadyAdoptedInPlaceAppAuthoredDCOFailureOnForkRehomesResignedTestAlreadyAdoptedInPlaceAppAuthoredDCOFailureInBaseRepoResignsInPlaceTestInPlaceDCORepairRefusesWhenHeadMovedTestDCORehomeReplaysMergeCommitWithMappedParentsNo new
time.Sleep. Docs (labels-and-control-signals.md) and changelog fragment updated.Of the PRs cited in the row audit, this unblocks #14710 (fork head β re-homed with re-signed commits incl. the merge replay). #14715/#14716/#14761 are already DCO-green.
Fixes #14927
Refs #14666 (closed by #14688)