Skip to content

ci: add merge_group trigger to ci + codeql - #1982

Merged
HongmingWang-Rabbit merged 3 commits into
stagingfrom
feat/merge-queue-trigger
Apr 24, 2026
Merged

ci: add merge_group trigger to ci + codeql#1982
HongmingWang-Rabbit merged 3 commits into
stagingfrom
feat/merge-queue-trigger

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

[Molecule-Platform-Evolvement-Manager]

Step 1 of 3 to enable GitHub merge queue on the `staging` branch.

Why

Today: 27 of 28 open staging PRs are stale (DIRTY/BEHIND/BLOCKED). `required_status_checks.strict=true` forces every PR to be up-to-date with staging head, so each merge invalidates every other open PR. Agents are filing PRs faster than they can rebase them. The drop-stale endpoint that would fix the queue overflow (#1950) is itself stuck BEHIND staging — circular.

GitHub merge queue is the standard answer (Rust's bors since ~2013, Kubernetes' Tide, Google/Meta internal, GitHub itself, Shopify, Stripe, Datadog). It auto-rebases each PR against fresh staging head, runs CI on the rebased commit, merges if green, picks the next one.

What this PR changes

Adds `merge_group: { types: [checks_requested] }` to the two workflows that produce required-status checks on staging:

  • `ci.yml` — Detect changes, Platform (Go), Canvas (Next.js), Python Lint & Test, Shellcheck (E2E scripts)
  • `codeql.yml` — Analyze (go) / Analyze (javascript-typescript) / Analyze (python)

Without this, the queue's pre-merge run on the speculative `gh-readonly-queue/...` ref would never fire, every queued PR would show false-green, and queue would merge unverified rebases.

Why this is safe to land in isolation

The `merge_group` event only fires once the queue is enabled on a branch (separate UI/API toggle). So today this PR is a no-op — pure plumbing for step 2.

Sequence

  1. This PR — workflow triggers (zero behavior change)
  2. Enable merge queue on staging via UI/API: Settings → Branches → Edit `staging` rule → "Require merge queue". Merge method = MERGE (matches the no-squash/no-rebase policy on this repo). Strategy = ALLGREEN.
  3. Update IC cron prompt: `gh pr merge --auto --merge` instead of manual merge
  4. Manually queue the existing 28 staging PRs once enabled

Reversible at any step (toggle queue off in UI).

Other workflows checked

`e2e-staging-`, `canary-`, `publish-*` are not required status checks → no `merge_group` needed. `auto-promote-staging.yml` runs on push to staging only → also unaffected.

HongmingWang-Rabbit and others added 3 commits April 23, 2026 21:24
Pre-work for enabling GitHub merge queue on the staging branch (#TBD
follow-up issue). Without these triggers, the queue's pre-merge CI run
on the speculative `gh-readonly-queue/...` ref would never fire, every
queued PR would show false-green for the required checks, and queue
would merge things that don't actually pass on the rebased commit.

Adding the trigger now is **a no-op** — the `merge_group` event only
fires once the queue is enabled on a branch, which is a separate UI/API
toggle. So this PR is safe to land in isolation; merge-queue enablement
is the next step and reversible at the branch-protection level.

Why these two workflows:
- `ci.yml` provides 5 of the 8 required staging checks (Detect changes,
  Platform Go, Canvas Next.js, Python Lint & Test, Shellcheck E2E)
- `codeql.yml` provides the other 3 (Analyze go / js-ts / python)

Other workflows (e2e-staging-*, canary-*, publish-*) are not required
status checks and don't need the trigger to keep the queue working.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@HongmingWang-Rabbit
HongmingWang-Rabbit merged commit f4b301b into staging Apr 24, 2026
13 checks passed
@molecule-ai
molecule-ai Bot deleted the feat/merge-queue-trigger branch May 20, 2026 06:21
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