Skip to content

ci: auto-merge labeled PRs after all CI and approval - #443

Draft
xinredhat wants to merge 6 commits into
RHEcosystemAppEng:mainfrom
xinredhat:ci/mintmaker-native-auto-merge
Draft

xinredhat wants to merge 6 commits into
RHEcosystemAppEng:mainfrom
xinredhat:ci/mintmaker-native-auto-merge

Conversation

@xinredhat

@xinredhat xinredhat commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Replace the MintMaker-only native-auto-merge enabler with guarded squash merging for PRs from any author and any base branch. This does not require admin-configured branch checks or GitHub's native auto-merge setting.

Merge policy

The workflow requires all of the following:

  • An open, non-draft PR with both exact labels /approve and /lgtm.
  • At least one approving review on the current head commit from a repository writer other than the author. An effective change request from another writer blocks merging.
  • Every latest reported Check Run and legacy commit-status context on the head and current test-merge commits is successful. Queued or unfinished Actions runs also block, even before their jobs report checks. Empty CI does not pass, and at least one base-repository CI workflow must have succeeded.

The CI policy is deliberately strict: skipped and neutral results block, as do failures, cancellations, and pending results. Conditional CI that reports skipped must complete successfully before this workflow can merge that PR.

Implementation

  • Use pinned GitHub-owned actions/checkout and actions/github-script actions. Checkout is restricted to automation from the trusted default branch, with credentials not persisted. No PR code or artifacts are executed.
  • Recheck live PR metadata, reviews, and CI before merging. Pass the verified head SHA to the REST merge API and respect any existing branch rules; never use an admin bypass.
  • Reconcile all eligible open PRs, so empty fork PR associations and coalesced pending events do not lose a PR.
  • React to PR changes, workflow completion, external Check Runs, and legacy statuses. A read-only review signal wakes the privileged default-branch consumer for fork reviews. Exclude the merge workflow from its own workflow_run trigger.
  • Add manual dispatch and a five-minute scheduled backstop because GitHub suppresses some check events. GitHub can delay scheduled runs. Older release branches without the review-signal workflow may depend on the backstop for review-only changes.

Validation

  • 105 mocked Node policy tests passed. The tests use fake APIs and cannot merge PRs.
  • Full pytest hack/e2e: 208 passed after syncing the branch with current upstream main.
  • Both new workflows passed actionlint v1.7.7; git diff --check passed.

Rollout and limits

Install the workflows and guard together by merging this PR into the default branch after review. This PR remains draft; no repository settings have been changed and no PRs have been merged by this work.

Head-SHA protection is atomic. Labels, reviews, base changes, and CI publication cannot be checked atomically with merging through this API. Without enforced server-side rules or an expected CI inventory, no metadata-only workflow can prove that a future, not-yet-reported check will not appear. This workflow controls only its own merges, not manual merges or another bot's existing auto-merge policy.

@xinredhat
xinredhat marked this pull request as draft November 12, 2026 13:26
@xinredhat xinredhat changed the title ci: enable native auto-merge for MintMaker PRs ci: auto-merge labeled PRs after all CI and approval Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant