Repository navigation
✨ merge: owner approval releases the workflow-path fence - #14672
Conversation
A contributor-lane PR editing .github/workflows/** or .github/actions/** was never merged by the hive: an owner's approval only moved it to stage/090 with a "click Merge" caption (hive#14568, hive#14498, rationguard#401). The App has workflows: write, so the fence is now released by explicit owner approval on the current head: a trusted merger's APPROVED review on that commit, or a dashboard / typed `/hive decision approve` bound to it. The PR then goes through every other gate and the lane merges it, logging `workflow-path fence released by owner approval` and leaving one hive:workflow-approval marker per head. A merge refused for want of the workflows permission marks the PR hive:unauthorized (merge-workflow-path) and returns the workflow-path reason so the approved head parks at 090 as before, with no retry loop. Toggle auto_merge.contributor_lane.owner_approval_releases_workflow_fence (default on) wired through config, merge_eligibility, the dashboard auto-merge API and Settings UI. The 085 note for an unapproved workflow-path PR now reads "awaiting owner approval"; dashboard approval comments carry a head marker so later readers can bind them. Fixes #14664 Signed-off-by: Andy Anderson <andy@clubanderson.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
|
|
@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. |
Signed-off-by: Andy Anderson <andy@clubanderson.com>
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 843f73e. |
Fixes #14664
Why
A contributor-lane PR touching
.github/workflows/**(or.github/actions/**) was never merged by the hive: an owner's approval only moved it tostage/090-ready-for-human-mergewith a "click Merge" caption (hive#14568, hive#14498, rationguard#401). The Apphivecommons-hivehasworkflows: write+contents: write, so the "App token cannot push workflow files" premise no longer holds for merging into the base. Owner's words: "if i approved it, it should auto merge".What
Explicit owner approval on the current head releases the workflow-path fence. Detected as either:
APPROVEDwhosecommit_idis the current head by a trusted merger (isTrustedMerger— the same/hive decision/ merger authorizer set; no new list), or/hive decision approvebound to the current head: the App-posted dashboard/approvecomment (now carries<!-- hive:pr-approval head=… by=… -->, parsed byhgithub.ParsePRApprovalCommandComment; falls back tocreated_at >= head pushed-at), or a person's comment whose first line is exactly/hive decision approve, posted after the head push./hive approveis never consumed.Approval on an older head does not count; a push re-arms the fence and the 090/085 text says to re-approve.
Once released the PR runs the normal gate (CI, DCO, lgtm, hold/do-not-merge, sentinel) and merges like any other PR. Log line
workflow-path fence released by owner approval login=… head=…; one audit comment<!-- hive:workflow-approval head=… by=… -->per head.Fallback (never loops): if the merge call fails with a workflows-permission error (403 resource-not-accessible or 403/422 mentioning workflow + permission),
markUnauthorizedwith stepmerge-workflow-path(hive:unauthorized), route to 090 "click Merge". The durable unauthorized marker comment and the in-memory step both block retries for that head. Dashboard tooltip added for the new step.Toggle
auto_merge.contributor_lane.owner_approval_releases_workflow_fence(default on), sibling ofapprove_held_runs_for_registry_trusted: config struct +Effective…(),cmd/hive/merge_eligibility.go, dashboard/api/config/automergeGET/PUT, Settings UI toggle.Unapproved workflow-path PRs behave exactly as before.
Docs
hive-merge.md(fence bullet + yaml example),operator-reference.md(new row),github-app-setup.md(Workflows permission row),labels-and-control-signals.md(decision-cause row, adoption bullet). Changelog fragmentchangelog.d/changed-owner-approval-workflow-fence.md.Coordination with #14669 (
feat/human-merge-reason)That PR has not landed yet. Its
HumanMergeReasonWorkflowFilestooltip reads "the hive never merges workflow changes and its GitHub App lacks the workflows permission" — after this PR that is only true when the toggle is off or the merge was refused for the permission; otherwise the 090 is "awaiting owner approval". This PR's own 085/090 cause text already says "awaiting owner approval … re-approve after a push". Whichever lands second should reconcile the #14669 string (I left a note on #14669).Tests
Table tests in
automerge_contributor_workflow_approval_test.go: APPROVED by owner on head → merged + marker; non-owner → fenced; stale head → fenced; dashboard/approvebound to head → merged; marker on older head → fenced; typed/hive decision approveafter push → merged; plain/hive approveignored; toggle off → fenced; marker once per head; permission-error fallback (403 / 422 / restart with existing marker → no retry) →hive:unauthorized+ 090. Plus parser/classifier unit tests and config/dashboard toggle tests. Notime.Sleep. Not run locally per AGENTS.md — CI is the verdict.