Skip to content

ci: run workflows on merge_group events - #378

Open
coretl wants to merge 1 commit into
mainfrom
merge-queue-ci
Open

ci: run workflows on merge_group events#378
coretl wants to merge 1 commit into
mainfrom
merge-queue-ci

Conversation

@coretl

@coretl coretl commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

What changed

Adds merge_group: to the on: trigger list in the generated CI workflow: template/{% if git_platform=="github.com" %}.github{% endif %}/workflows/ci.yml.jinja. A single-line addition, nothing else — the template repo's own .github/workflows/ci.yml (which tests the template itself) is untouched, out of scope for this change.

Why

No merge queue is enabled by default on projects generated from this template, but if one were turned on, GitHub only runs a workflow against gh-readonly-queue/* refs when that workflow explicitly subscribes to the merge_group event. Neither push nor pull_request covers it, so a queued PR would sit there indefinitely waiting on checks that never start. This change makes generated projects' CI queue-ready ahead of time.

What this PR is not

This PR does not enable a merge queue for any project. Turning one on is a repo-admin ruleset / branch-protection setting outside a workflow file's control — that decision stays with whoever administers each downstream repo. Until it's flipped on, this change is a safe no-op: merge_group events simply never fire.

Confirmed safe under merge_group

  • The tag-gated pypi/release jobs stay off — under merge_group the ref is gh-readonly-queue/main/pr-N-<sha>, which is ref_type == 'branch', not tag.
  • The main-gated docs-deploy job stays off for the same reason (ref_name under merge_group isn't main).

So no release or deploy can fire from a merge-queue run in any generated project.

Test suite

Ran uv run --locked tox -e tests before pushing. 4 pre-existing failures remain (docs/Sphinx trying to fetch switcher.json from diamondlightsource.github.io), all caused by this sandbox's outbound network restrictions — reproducible on a clean checkout with no changes, unrelated to this PR. pre-commit and type-checking pass. No test snapshots or asserts on the generated CI workflow's content, so nothing needed updating for this change.

Downstream repos

This is the durable upstream fix. bluesky/bluesky and bluesky/ophyd-async carry the identical merge_group: addition directly (both currently generated from this template) until they next re-run copier and pick it up from here:


🤖 Generated with Claude Code


Generated by Claude Code

Add merge_group to the generated CI workflow's on: triggers so
projects built from this template get merge-queue-ready CI. Without
this, a GitHub merge queue would stall forever waiting on checks that
never start on its gh-readonly-queue/* refs.

The 4 pre-existing test failures (docs / sphinx switcher.json fetch)
are a sandbox network restriction unrelated to this change; no
snapshot test compares generated CI workflow content.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y9bkocE5cCMw4LC72sJFHm
@coretl coretl changed the title CI: run workflows on merge_group events ci: run workflows on merge_group events Sep 2, 2026
@coretl
coretl requested a review from ZohebShaikh September 2, 2026 11:38
@coretl

coretl commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@ZohebShaikh is this the only change that blueapi had to make to use merge queues?

@ZohebShaikh ZohebShaikh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's it. This was only needed for our PR Conventional Commit Validation, which isn't in the copier template by default.

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.

3 participants