Skip to content

✨ merge: owner approval releases the workflow-path fence - #14672

Merged
hivecommons-hive[bot] merged 2 commits into
v5from
feat/owner-approval-workflow-fence
Oct 27, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
v5from
feat/owner-approval-workflow-fence

Conversation

@clubanderson

Copy link
Copy Markdown
Member

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 to stage/090-ready-for-human-merge with a "click Merge" caption (hive#14568, hive#14498, rationguard#401). The App hivecommons-hive has workflows: 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:

  • a GitHub review with state APPROVED whose commit_id is the current head by a trusted merger (isTrustedMerger — the same /hive decision / merger authorizer set; no new list), or
  • a /hive decision approve bound to the current head: the App-posted dashboard /approve comment (now carries <!-- hive:pr-approval head=… by=… -->, parsed by hgithub.ParsePRApprovalCommandComment; falls back to created_at >= head pushed-at), or a person's comment whose first line is exactly /hive decision approve, posted after the head push. /hive approve is 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), markUnauthorized with step merge-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 of approve_held_runs_for_registry_trusted: config struct + Effective…(), cmd/hive/merge_eligibility.go, dashboard /api/config/automerge GET/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 fragment changelog.d/changed-owner-approval-workflow-fence.md.

Coordination with #14669 (feat/human-merge-reason)

That PR has not landed yet. Its HumanMergeReasonWorkflowFiles tooltip 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 /approve bound to head → merged; marker on older head → fenced; typed /hive decision approve after push → merged; plain /hive approve ignored; 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. No time.Sleep. Not run locally per AGENTS.md — CI is the verdict.

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>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 27, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kellyaa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#14651 🌱 dashboard: defer merge-gate pills until the PR reaches the gate same files src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#14573 ✨ feat(dashboard): show a draft pill in the activity tracker same files src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#14657 🐛 dashboard: anchor tracker rows on the open PR when the issue has closed same files src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#14630 🐛 fix(dashboard): enrich soft-linked stage-tracker issues with title and state same files src/pkg/dashboard/stage_tracker.go
#14669 ✨ dashboard: say why a PR is waiting on a human merge same files src/docs/hive-merge.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
src/pkg/stageengine/prstage/reasons.go
#14656 🐛 fix: keep the header's right chips from overlapping the title at 769-900px same files src/pkg/dashboard/static/index.html
#14660 ✨ review: wire review.pending_fix_ttl into the fix dispatcher same files src/docs/labels-and-control-signals.md
src/pkg/config/config.go
#14677 ✨ review: wire review.pending_fix_ttl into the fix dispatcher same files src/docs/labels-and-control-signals.md
src/pkg/config/config.go

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@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.

@hivecommons-hive hivecommons-hive Bot added author/human A person pushed this PR themselves dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 27, 2026
Signed-off-by: Andy Anderson <andy@clubanderson.com>
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#14672843f73e` sha256:1c097b5b885561f496cdab0077c821db468233026bdb6fb08f5b3f2e413a9a4f — download from the dashboard or `hivectl review evidence #14672`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 843f73e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/human A person pushed this PR themselves dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

merge: owner-approved workflow-path PRs should auto-merge instead of parking at 090

1 participant