Repository navigation
✨ feat(automerge): workflow fence can be limited to release-critical workflows - #17484
Merged
hivecommons-hive[bot] merged 1 commit intoNov 10, 2026
Merged
Conversation
…workflows Add auto_merge.contributor_lane.workflow_fence_scope. "all" (default) keeps today's fence on every .github/workflows / .github/actions edit. "human_merge_paths" fences only workflow / action files that also match the repository's auto_merge.human_merge_paths, so routine workflow edits go through review, CI and soak without an owner Approve on every head. The scoped fence fails closed: no human_merge_paths entry, a renamed workflow file, or a head GitHub refused to merge for want of workflows: write keeps the fence. One helper (contributorLaneMergeFence) feeds the lane, the stage notes and merge asks (headDiffFence) and /hive approve. The held-run approval guard and adoption's refusal to publish workflow edits upstream stay unscoped. The tests-removed fence, Sentinel and the human-merge hold are unchanged. 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>
Contributor
|
[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 |
Contributor
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds an opt-in setting so the contributor lane's workflow fence covers only each repository's release-critical workflows. Today every edit to
.github/workflowsor.github/actionswaits for an owner's GitHub Approve on the exact head, and every push resets it. With the new setting, routine workflow edits (pin bumps, permission tightening) go through the normal review, CI and soak instead. The workflows an operator already lists inauto_merge.human_merge_pathskeep the full fence. The default is unchanged.What changes for an operator: nothing until they set
auto_merge.contributor_lane.workflow_fence_scope: human_merge_paths(Settings → Features → Auto Merge → Contributor-lane auto-merge → Workflow fence scope). Sentinel still labels these PRs by default; see "Sentinel" below.Why
On knuckle (hosted-projectbluefin-knuckle), about 30 open contributor-lane PRs touch
.github/workflowsor.github/actions. Each one waits for an owner Approve on the current head. Agents push often, so the approval keeps resetting. Most of these PRs are pin bumps or permission tightening.The repositories already name their release-critical workflows in
auto_merge.human_merge_paths, for example utah'sbuild.yml,execute-release.yml,promote-testing-to-main.ymlandpost-testing-e2e.yml. The fence ignores that list.What changes
auto_merge.contributor_lane.workflow_fence_scope:all(default) is today's behaviour;human_merge_pathsfences a workflow or action file only if it also matches the repository'shuman_merge_paths, using the human-merge hold's own matcher.PUT /api/config/auto-merge) and read asall.human_merge_pathsentry;workflows: write. The head is markedhive:unauthorized(merge-workflow-path) and parks for a person, the same as an owner-released head. The durable marker is re-read after a restart, so the lane does not retry./hive approvereplies all read the same scoped fence, so they cannot disagree.Safety
sentinel-alertstill blocks the lane);pull_requestworkflows there run with repository context.Sentinel
Sentinel's default
sensitive_pathlist includes.github/workflows/**and.github/actions/**. It labels a contributor's PRsentinel-alert, and the contributor lane will not merge until a person clears that label. This PR does not change Sentinel. On a hive that keeps the default list, scoped workflow PRs still wait for a person, at the Sentinel label instead of the fence. The docs namesentinel.sensitive_pathsas the second setting an operator would change, and what that costs.Files
pkg/config/review_config.go: the key, values,EffectiveWorkflowFenceScope, validation.cmd/hive/merge_eligibility.go: passes it into the lane policy.pkg/github/automerge/automerge_workflow_fence_scope.go(new):contributorLaneMergeFence,workflowFenceCovers,contributorLaneTouchesWorkflowFiles,workflowFenceScopeKey,workflowMergeRefusedOnRecord.automerge_contributor_lane.go: the lane uses the scoped fence.automerge_contributor_workflow_approval.go: the permission-refusal fallback also covers an unfenced workflow edit.automerge_contributor_held_runs.go: unscoped workflow check.automerge_contributor_adopt.go:adoptionDiffRefusal(unscoped, for publication guards) andadoptionMergeFence(scoped). The in-place adoption note uses the scoped fence.automerge_stage_human.go:headDiffFenceuses the scoped fence; the cache key includes the scope.pr_approve_command.go:/hive approveuses the scoped fence.pkg/dashboard/api_config_automerge.go,static-src/js/config-features.js,static-src/js/config-helpers.js,static/index.html: the setting and its control. The same edit was made in both the sources andindex.html; concatenating the manifest's files matchesindex.htmlbyte for byte.hive-merge.md,operator-reference/README.md,labels-and-control-signals/stage-labels.md.changelog.d/added-workflow-fence-scope.mdTests
None were run locally (AGENTS.md:7). CI is the verdict. Only
gofmt -landnode --checkwere run.TestContributorLaneWorkflowFenceScope:all, unset or unknown scope keeps the fence;TestContributorLaneWorkflowFenceScopeMergeUnauthorized: aworkflows: writerefusal marks the head and stops at workflow-path. Neither a second tick nor a restart that sees the marker retries the merge.TestContributorLaneWorkflowFenceScopeKeepsHeldRunsRefused: a registry-trusted fork PR whose workflow edit the scope lets through still has no held runs approved.TestWorkflowFenceScopeStageNoteAgreesWithLane: the 085 note behind a sentinel alert does not call an unlisted workflow edit a manual merge, but does for a listed one.TestPRApproveReplyWorkflowFenceScope:/hive approvegives the ordinary acknowledgement for an unlisted edit, says a person merges a listed one, and keeps today's wording underall.TestContributorLaneMergeFenceHelpers,TestContributorLaneAutoMergeConfigWorkflowFenceScope, and new assertions inTestAutoMergeGet_ContributorLaneDefaults/TestAutoMergePut_ContributorLaneValidation: GET/PUT round-trip and rejection of unknown values.🤖 Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1