Repository navigation
π Withhold the contributor nudge for a head the hive adopts anyway - #18874
Conversation
Fixes #18872 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Open PR overlap checkβ
Resolved: no conflicting open PRs or same-file overlaps remain against |
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. @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. Review follow-ups: 1 open of 1 (below
|
β¦uction Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Mutation testinggremlins found 2 surviving mutant(s) in changed files: the code ran under tests, but changing it did not fail any test.
Verdict: |
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
There was a problem hiding this comment.
Read the nudge path on the PR head (automerge_contributor_nudge.go, nudgeContributor β adoptionBound) and the ladder. The withhold/release logic reads correctly to me: the withheld head is recorded, cleared when a comment is posted or edited, and released with ordinal 0 when adoptionBound turns false. One coupling gap is worth a look before merge.
The "agreement" between the ladder and the nudge is asserted, not enforced. delegatedecision.AdoptsImmediately has no production caller (only ladder_nudge_agreement_test.go), and adoptionBound (automerge_contributor_nudge.go:392) re-derives reachability from presence alone. The comment above it says an author "who has picked the rework up" is treated as reachable, but the function never reads a rework-pickup signal, while the ladder's ContributorReachable() does (ladder.go:255). An offline-but-registered author whose relay already claimed the fix-pr task is therefore treated as unreachable by the nudge (comment withheld) and as reachable by the ladder. Whether AutoAdoption would still adopt such a head is something I did not verify, so this is an open question rather than a defect.
Suggestion: either feed the rework-pickup signal into adoptionBound, or drop the "or who has picked the rework up" wording and the claim that the two functions agree.
β hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.326
| // happening (no presence source, a hold label, a fork guard, a workflow | ||
| // path, a person's PR, a maintainer policy other than adopt, a recorded | ||
| // block) keeps the nudge, so no author is left with no word at all. | ||
| func adoptionBound(rec stagelabels.Record, obs stageObservation, policy StageLabelPolicy, presence ContributorPresence, hasPresence bool) bool { |
There was a problem hiding this comment.
Open question: the doc comment says reachability includes an author who picked the rework up (as delegatedecision.ContributorReachable does, ladder.go:255), but this function only checks presence.Registered && presence.Online. AdoptsImmediately is called only from its own test, so nothing keeps the two in step. If a claimed fix-pr task keeps AutoAdoption from adopting, that author's nudge is withheld wrongly; if not, drop the wording.
|
[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 DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Fixes #18872
Verification of the analysis (file:line, v5 at 6b79bed)
src/pkg/delegatedecision/ladder.gorung 5 does decide "supersede now ... do not wait for the grace deadline" onAdoptionStalled || Conflicting || CIRed() || DCOMissingwhen the author is not reachable. Correct.api_repo_item_decide_delegated.go). The automatic nudge-then-adopt pairs in the issue (contributor-offline, 16-39 min) come from the engine path:nudgeContributor(automerge_contributor_nudge.go) records the nudge, thenAutoAdoption(automerge_adoption_clock.go) adopts an offline or unregistered author afteradoption.after_offline/after_unregistered(15m). So the nudge asks for work the author is already scheduled to lose, by the engine as much as by rung 5. Both paths key on the same fact: the author is not reachable.Behavior chosen: the first one (no nudge when the hive adopts anyway)
Docs show the first is the intended direction: "a contributor who has gone quiet is superseded now, not after a deadline" (#13975), and the 15m offline wait is a presence clock, not a chance to respond. The second behavior (delay adoption) would contradict that. Note that adoption requires a recorded nudge as its clock start, so the nudge is still recorded; only the GitHub comment is withheld.
adoptionBound(nudge side): policy flag on, adoption enabled, live presence known and the relay not online, no hold label / fork guard / workflow path / recorded block,maintainer_policy: adopt, not a person's PR. Then the comment is withheld, the relay still receives its task, and the adoption note is the one notification.NudgeWithheldHeadin the stage store.Input.ContributorReachable()(shared by rung 4) andAdoptsImmediately(in); rung 5 never fires for a reachable author, which is exactly when the nudge is kept. Online authors keep the full grace.NudgeWithholdWhenAdoptingis set on instageLabelPolicyFunc; no new YAML leaf (it would need settings-dialog and golden changes). It is off in the zero policy so existing nudge tests are unchanged.Tests
automerge_nudge_withhold_test.go: the four patterns (contributor-lane, fork-not-editable, check-failing, conflicting) for offline and unregistered authors (no nudge, then one adoption note, no nudge beside it), online authors (nudged, not adopted before the grace), release on reappearance, and the not-certain cases.ladder_nudge_agreement_test.go: rung 5 fires iff the author is unreachable.Docs (stage-labels.md, operator-reference) and changelog fragment included. No overlap with open PRs (#18870 touches SHA holds, not delegatedecision or the nudge).
π€ Generated with Claude Code