Skip to content

ci: linter to catch missing merge_group triggers on required workflows - #2002

Merged
HongmingWang-Rabbit merged 1 commit into
stagingfrom
ci/merge-group-trigger-linter
Apr 24, 2026
Merged

ci: linter to catch missing merge_group triggers on required workflows#2002
HongmingWang-Rabbit merged 1 commit into
stagingfrom
ci/merge-group-trigger-linter

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

[Molecule-Platform-Evolvement-Manager]

Why

Twice today the merge queue deadlocked because a required workflow lacked a merge_group: trigger. Each incident: 30-60min debug + hot-fix PR + temporarily removing the required check. Post-mortem recommendation #2: prevent the class of bug at CI time.

What it does

On every PR touching .github/workflows/ and on push to staging/main:

  1. Reads required_status_checks.contexts for the staging branch
  2. For each required check, finds the workflow that produces it (job-name match)
  3. Fails if that workflow doesn't declare merge_group: as a trigger

Error messages include the exact snippet to paste into the workflow's on: block.

Acceptance

Add a check to required_status_checks → this linter fires on any PR that touches the owning workflow until merge_group is declared. Class of bug gone.

…igger

Pre-merge guard against the deadlock pattern that hit twice today:
adding a workflow's check to required_status_checks while the workflow
itself doesn't have a `merge_group:` trigger → merge queue stalls
forever in AWAITING_CHECKS because the required check can't fire on
gh-readonly-queue/* refs.

Each time today this happened it cost 30-60min of debug + a hot-fix PR
+ temporary removal of the required check. This workflow runs on every
PR touching .github/workflows/ and on push to staging/main, listing
required checks for staging and verifying each one's owning workflow
declares merge_group.

Self-listens on merge_group so the linter passes its own queue runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@HongmingWang-Rabbit
HongmingWang-Rabbit added this pull request to the merge queue Apr 24, 2026
Merged via the queue into staging with commit b5c93cf Apr 24, 2026
14 checks passed
@molecule-ai
molecule-ai Bot deleted the ci/merge-group-trigger-linter branch May 20, 2026 06:21
HongmingWang-Rabbit pushed a commit that referenced this pull request Jun 12, 2026
…etGlobal (global vendor keys are tenant-owned)' (#2002) from fix/setglobal-drop-retired-org-billing-guard into main
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