Repository navigation
π fix: park fork-guard-only heads instead of nudging and adopting them - #16845
Conversation
The fork-guard park (#14273) only knew the head the last CI-enriched enumeration classified. Every new head of a fork PR red only on its fork guard (a required Canary that cannot run on forks) therefore read as plain red CI first: stage 072, a "Failing checks: Canary" nudge to the author, and after the grace an adoption, until the next enumeration parked it at 085 again. - Remember the guard's checks on the PR's stage record; a fork head the enumeration has not classified yet whose every red check (from the head's check digest) is one the guard refused before is read as the same guard and goes straight to the 085 park. - The contributor nudge drops fork-guard checks and is skipped when nothing else is red. - Automatic adoption refuses a head whose only blocker is the guard; an explicit maintainer adopt-supersede request still goes through. Evidence: projectbluefin/utah-packages#869 (nudge then 085 on every head, adopted in place at a head already parked on the guard) and #862 (adopted despite the fork guard, ~10 heads, 14 needs-decision posts). Signed-off-by: James Reilly <jreilly1821@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
There was a problem hiding this comment.
Read the three gates at the head. Auto-adoption refuses a guard-only head at src/pkg/github/automerge/automerge_contributor_adopt.go:666 only when neither requested nor forced, so the maintainer adopt-supersede path is intact as the body says. foldForkGuard (automerge_stage_sharedci.go:82) carries the guard forward only when every red check in the head's own digest is one the recorded guard refused β a head with any other red check keeps the author-facing route. The nudge drops guard checks and returns before posting when nothing else is red (automerge_contributor_nudge.go:291). Builds. Looks correct to me.
One note, not a defect: Store.NoteForkGuard (src/pkg/stagelabels/store.go:2234) returns early when the key has no record, and foldForkGuard runs before the record is created for a PR the store has never seen. So the very first sweep that classifies a brand-new fork PR as guard-only does not persist the checks; the next sweep with fresh evidence does. The current head is parked by the enumeration regardless, so the only window is a head pushed between those two sweeps. Same pattern as NoteAdoptDiffFence, so probably fine to leave.
Also: I see no changelog.d/ fragment in this diff, unlike the sibling PRs (#16846β#16849) β worth adding one if the fragment guard runs on v5.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Style/maintainability pass at head 91d5ace. The new fold follows the existing idioms ( Remembered guard has no clearing path β summary, known := c.headChecks(ctx, tracker, key, *o, now)
- if !known || len(summary.Red) == 0 {
+ if !known {
+ return
+ }
+ if len(summary.Red) == 0 {
+ store.NoteForkGuard(key, nil) // guard gone: the head is green
return
}with Review findings from Intent alignment (read at head 91d5ace): the diff does what the body says. One low, non-blocking note: Review findings from Correctness review of 91d5ace (read the diff plus Carried guard evidence cannot be contradicted by fresh evidence for the same check name ( --- a/src/pkg/github/automerge/automerge_stage_sharedci.go
+++ b/src/pkg/github/automerge/automerge_stage_sharedci.go
@@ func (c *Engine) foldForkGuard(
if o == nil || o.Merged || o.HeadRepo == "" || headInBaseRepo(*o) {
return
}
+ // The enumeration classified this head and found no guard: fresh
+ // evidence outranks the memory.
+ if c.stagePolicy.ForkGuardKnown != nil && c.stagePolicy.ForkGuardKnown(o.Owner+"/"+o.Repo, o.Number, o.HeadSHA) {
+ return
+ }with Minor: |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
The fork-guard park (#14273) only knew the head the last CI-enriched
enumeration classified. Every new head of a fork PR red only on its fork
guard (a required Canary that cannot run on forks) therefore read as plain
red CI first: stage 072, a "Failing checks: Canary" nudge to the author,
and after the grace an adoption, until the next enumeration parked it at
085 again.
enumeration has not classified yet whose every red check (from the
head's check digest) is one the guard refused before is read as the
same guard and goes straight to the 085 park.
nothing else is red.
explicit maintainer adopt-supersede request still goes through.
Evidence: projectbluefin/utah-packages#869 (nudge then 085 on every
head, adopted in place at a head already parked on the guard) and #862
(adopted despite the fork guard, ~10 heads, 14 needs-decision posts).
Found by auditing why hive stalls on projectbluefin/utah and projectbluefin/utah-packages. One concern per PR; sibling PRs from the same audit cover the other root causes.
Verification:
gofmt -lclean. Tests were not run locally, per AGENTS.md; CI is the verdict.