Repository navigation
π fix(stage): make 085 asks agree on the workflow-path fence - #15026
hivecommons-hive[bot] merged 1 commit into
Conversation
One PR got two contradicting 085 notes (projectbluefin/testsuite#1037): the entry comment said no approval overrides the manual-merge rule, while the sign-off attribution / adoption-stalled note asked for an Approve review. Since hivecommons#14664 a trusted merger's Approve review on the head releases the contributor-lane workflow-path fence when the owner-approval toggle is on and the App can merge workflow files. - Evidence/Route carry ApprovalReleasesFence (set in humanEvidence from the lane reason or the head's diff fence). DecisionActions then asks for the Approve review (not `/hive approve`), notes it also settles a requires_human verdict, and keeps the sentinel/hold steps; the header reads "Needs a decision, not a merge". Absolute rules keep today's text. - The diff-fence fallback's cause text now uses the head's fence standing instead of always saying "never merges unattended". - mergeCommitRefusalText drops the approve route when the head is under a rule no approval overrides (Detail.ManualMergeRule), names the rule, and names an open sentinel alert (Detail.SentinelAlert). The facts are filled only right before the once-per-head note, reusing the cached per-head diff fence read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar <Danathar@users.noreply.github.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
|
There was a problem hiding this comment.
Reviewed (intent-alignment) at 92b1521 β the diff matches the PR body and stays on the #1037 contradiction: ApprovalReleasesFence (src/pkg/stagelabels/human.go:330, :508, :562-575) and withMergeAskFacts / headManualMergeRule (src/pkg/github/automerge/automerge_contributor_adopt.go:518-553) make the entry comment and the attribution/stall notes agree under both fence standings. No in-scope blocker.
One advisory (low, not blocking):
DecisionActions (src/pkg/stagelabels/human.go:570-577) asks for "a trusted merger approves this head β¦ which releases the CI workflow-file fence" whenever r.ManualMerge && r.ApprovalReleasesFence, without consulting r.HumanApprover. RouteHuman still routes to 085 with HumanApprover set when a sentinel/hold remains (human.go:320-333), and the diff-fence fallback in humanEvidence (automerge_stage_human.go:188-194) sets ApprovalReleasesFence from the head's diff regardless of whether the approval already landed. So an approved head parked only for a sentinel alert would be re-asked for the approval it already has. The pre-existing requires_human branch has the same gap, so this is the hive's own call; if you want it tight:
if r.ManualMerge && r.HumanApprover == "" {
β hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Correctness review (head 92b1521). Verified headManualMergeRule/withMergeAskFacts reuse the same process-shared tracker the stage pass hands routeHuman (automerge_stage_labels.go:758, stageTrackerOrShared :326), so the diff read stays one per head; RouteHuman gates ApprovalReleasesFence on ManualMerge (human.go:333); go build of the touched packages is clean. One low finding:
Low β the new release-ask still asks for an approval the head already has. DecisionActions emits "a trusted merger approves this head β¦ releases the CI workflow-file fence" whenever r.ManualMerge && r.ApprovalReleasesFence (src/pkg/stagelabels/human.go:566-574) without checking r.HumanApprover, which RouteHuman already carries on the route (human.go:333, populated from Detail.HumanApprover at automerge_stage_human.go:164-166). Reachable shape: release on, trusted merger has approved this head, sentinel alert still open β the fence is reached via the diff-fence fallback (automerge_stage_human.go:180-187), decide holds only the sentinel, and the comment asks for a review that was already given. The pre-existing requires_human branch has the same gap, but this PR adds a second copy of it. Non-blocking; suggested guard:
if r.ManualMerge && r.HumanApprover == "" {
(at human.go:566), so an approved head falls through to the sentinel/hold steps alone. A test in automerge_stage_human_manual_merge_test.go seeding Detail.HumanApprover/HumanApprovalHead for the sentinel case would pin it.
β hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Style perspective β approve; two small maintainability notes, neither blocking.
-
src/pkg/stageengine/prstage/types.go:65-72β the newManualMergeRule/SentinelAlertdoc says both are "filled only right before a sign-off attribution note is posted", butwithMergeAskFactsis also called fromescapeStalledAdoption(automerge_contributor_adopt.go:1631-1634) for the adoption-stalled note. The comment will mislead the next reader about where these facts are populated.// filled only right before a sign-off attribution or adoption-stalled // note is posted (withMergeAskFacts), so its merge-commit ask never // offers an approval that cannot land the head // (projectbluefin/testsuite#1037). -
automerge_contributor_adopt.go:519-523duplicates the sentinel-label fallback already inhumanEvidence(automerge_stage_human.go:192-196):sentinel := c.sentinelLabelName(); if sentinel == "" { sentinel = defaultSentinelLabel }. A tinyfunc (c *Engine) sentinelLabelOrDefault() stringused by both would keep the default in one place. Advisory.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Summary
One PR at
stage/085-needs-decisiongot two notes that contradict each other. On projectbluefin/testsuite#1037 (edits.github/workflows/e2e.yml, sentinel alert,requires_humanverdict):/hive approvedoes not override this lane's manual-merge rule".On current
v6the first note is the stale one. Since #14664 / #14672, a trusted merger's Approve review on the current head releases the workflow-path fence whenowner_approval_releases_workflow_fenceis on (the default) and the App may merge workflow files.DecisionActionsstill keyed onRoute.ManualMergealone. That flag is true for the releasable fence too, and for GitHub refusing the merge method, soManualMergeRulealone cannot pick the wording either. The attribution ask, for its part, offered "approve" without knowing whether the lane would ever merge the head.Change
pkg/stagelabels/human.go):EvidenceandRoutecarry a newApprovalReleasesFence, set inhumanEvidence(automerge_stage_human.go) from the lane reason or from the head's diff fence./hive decision approve, and says a/hive approvereply does not release it. It notes that the same review settles arequires_humanverdict, and still lists the sentinel and hold steps.workflows: write, and a refused merge method.mergeCommitRefusalText,automerge_contributor_adopt.go):ManualMergeRuleandSentinelAlert, are filled bywithMergeAskFactsonly right before a once-per-head note is posted. They reuse the cached diff read (headDiffFence), so there is no new API call per sweep.labels-and-control-signals.md(the 085 row, the sign-off paragraph and the adoption-fence bullet) andhive-merge.md(the fence bullet).changelog.d/fixed-085-ask-matches-workflow-fence.md.Testing
From
src/,TZ=UTC,-count=1:go test ./pkg/stagelabels/ ./pkg/github/automerge/ ./pkg/stageengine/...and./pkg/dashboard/pass.gofmtandgo vetare clean.check-changelog-fragment.sh v6,check-docs-links.pyandcheck-docs-citations.pypass.New tests:
human_test.go: bothDecisionActions/DecisionCommentwording branches.automerge_stage_human_manual_merge_test.go: the entry comment end to end. It covers an approval releasing the fence, the App lacking the workflows permission, and the lane's own workflow-path reason with the release on and off.automerge_signoff_attribution_085_test.go: the sign-off note with the release off, the App lacking permission, tests removed and an approval releasing the fence, plus a direct unit test of the text.automerge_adoption_escape_test.go: an adoption stall shaped like fix: no native browser dialogs β custom toast + confirmΒ #1037 (sentinel alert,requires_human, workflow edit). The stall note and the 085 entry comment now agree, with the release on and off.No existing expectation changed.
Mutation checks
20 mutants, each restored from a backup copy; 19 fail a test. The one survivor removes the "contributor lane only" guard in
headManualMergeRule. That guard only skips a pointless diff read on other lanes, mirroring the same guard inhumanEvidence.Not verified, or still open
ManualMergeRuleunset. Setting it in the diff-fence fallback would send an approved head with an absolute fence to 090 instead of 085. That is a routing change, left out.contributorLaneDiffReasonreports only the first fence, and workflow-path comes first. A head that both edits workflow files and removes tests is offered the approval route. A separate PR fixes the merge-side half of that, where the release skipped the tests-removed check: π fix(contributor-lane): check removed tests before an owner approval releases the workflow fenceΒ #15027.Contributor checklist
changelog.d/fixed-085-ask-matches-workflow-fence.md.v6.src/docs/labels-and-control-signals.md,src/docs/hive-merge.md).π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1