Repository navigation
π decide plan: pending CI is not red, WHY from recorded park reasons, adopted PRs go to the fixer - #15816
Conversation
|
[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
|
There was a problem hiding this comment.
Read the diff at 0628f5b against v5 (delegatedecision/policy.go, ladder.go, dashboard/api_repo_item_decide_delegated{,_plan}.go) and the callers. The policy change is sound; CI is red because of the PR's own test fixture, one line to fix.
1. TestDelegatedDecisionPlanAdoptedRequiresHumanIsFixersNotCI panics on a nil store (high β this is why test (dashboard 2/4), test (dashboard shuffle 1/3) and coverage are red).
src/pkg/dashboard/api_repo_item_decide_delegated_plan_test.go:352 calls srv.stageStore.Observe(...) right after newDelegatedServer(t, mock), which never sets stageStore. (*Store).ObserveProgress dereferences the receiver at stagelabels/store.go:645 β SIGSEGV (job 124172225235). The other delegated tests that touch the store set it first β e.g. api_repo_item_decide_delegated_test.go:827: srv.stageStore = stagelabels.NewStore("", func() time.Time { return now }). Add that line before :352 (production code is fine: gatherDelegatedRecordedPark goes through stageStoreOrShared(), stage_tracker_caption.go:1008, which falls back to the shared store).
2. Pending CI with no other blocker is now released with "green head" wording (low, wording only).
With fixList (ladder.go:303-316) no longer listing a pending head, a PR with CIPending && !Conflicting && !DCOMissing falls through fix-then-merge (policy.go:713) to small-low-risk / default-release (policy.go:720-724), whose texts say "on a green head" / "green head". The action itself is fine β ActionApproveReview queues via QueuePRAutoMergeWithNoteResult (api_repo_item_decide_delegated.go:889) and the engine still waits for checks β but the recorded rationale is false for that head. Consider "checks still running; merges when green" when in.CIPending. Not blocking.
Verified as described: delegatedHeadCI dropping the conflicting short-circuit makes ladder rung 3 (ladder.go:195, conflicts-only) reachable for the first time β previously Conflicting forced CIGreen=false so that branch was dead; that is an improvement, not a regression. decideAdoptedByHive is gated on !HiveAuthored && !PersonAuthored() so #15757's superseding-copy path and this one do not overlap. go build ./pkg/delegatedecision/ ./pkg/dashboard/ is clean on the head (go test is disabled for agents here, so I read the CI log instead).
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
β¦pted PRs go to the fixer The "Let hive decide" preview for #15722 said "make CI green" / "CI is red" of a PR with every check green: GitHub reports mergeable_state "unstable" when any context β the non-required tide included β is pending, and the plan treated anything but clean as red without reading the checks. It also ignored the stage record's reasons (reviewer requires_human, high-risk) and had no notion of a PR the hive adopted in place, so it offered to send the hive's own branch back to the contributor. - delegatedHeadCI inspects the head's checks: red only when one failed, pending while running; Input.CIPending / CIRed() carry that through the policy, ladder, blockers and glossary effect. - gather reads the stage record (reasons, adoption) and the review verdict artifact; the WHY names the recorded park reason. - New rules adopted-fixer / adopted-security-finding: an adopted PR's finding goes to the hive's fixer (no action needed); a security finding stays a person's call, named in full. - Regression test: red CI on a clanker PR routes 072, never 085. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
0628f5b to
b3770d3
Compare
|
stage 080-awaiting-merge-admission β 050-review-pending: required-check-pending:Sign-off survives the squash |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Closes #15815
What
The "Let hive decide" preview for #15722 (a clanker's PR the hive adopted in place, parked at 085 on the reviewer's
requires_human/ high-risk marker, every check green) said:Root cause
GitHub reports
mergeable_state: unstablewhen any context is pending or failing β the non-requiredtideincluded.delegatedHeadCIGreentreated anything butclean/has_hooksas not green without reading the head's checks, and!CIGreenread as "red" everywhere downstream. The plan also never read the stage record's reasons / the review verdict (the facts the 085 comment was built from), and had no notion of an adopted PR, so it offered to return the hive's own branch to the contributor.Fix
delegatedHeadCIsummarizes the head's checks (tide/meta excluded): red when one failed, pending while running.Input.CIPending+CIRed()carry that through policy, ladder (mergeBlockersβ "CI still running"), plan blockers and the glossary effect.AdoptionLive(head)) and the review verdict artifact;delegatedPlanParkReasonsays "the reviewer returned requires_human: ".adopted-fixer("Have hive's fixer address the reviewer's finding (β¦) on #N; no action needed from you.") andadopted-security-finding(recommend-only, finding named in full β a person's policy call). Glossary + SPA mirrors updated. Direction on an adopted PR is recorded viaRecordOperatorPullRequestDecision.stagelabels.RouteHumannotes red checks as fix evidence before therequires_human β NeedsDecisionbranch; regression test added for clanker + red check + requires_human βReturnedToContributor.Complementary to #15757 (hive-authored superseding copies β fixer); this covers in-place adoptions and uses separate fields/rules.
Tests
TestDelegatedDecisionPlanAdoptedRequiresHumanIsFixersNotCIβ the exact live fixture (unstable, all checks green, tide pending, 085 viarequires_human, adopted in place): ruleadopted-fixer, no "CI" / "back to its author" anywhere; non-adopted variant never says "CI is red".TestDelegatedPlanPendingCIIsNotRed,TestDecidePRAdoptedByHiveRoutesToFixer(fixer / pending / red / security / clean / not-adopted).TestDelegatedDecisionPRBlockedStateReadsHeadChecks: "unstable" now split into green-checks β approve and red-checks β fix-then-merge.TestRouteHumanFixEvidence: red CI + requires_human on a clanker PR β 072.