Skip to content

ci(pr): run the pull-request workflow on merge-group commits - #1597

Merged
HuiJun merged 4 commits into
developfrom
ci/merge-group-trigger
Oct 27, 2026
Merged

HuiJun merged 4 commits into
developfrom
ci/merge-group-trigger

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What and why

The develop ruleset requires the checks Changed areas and Build and test, both produced by .github/workflows/pr.yml. With a merge queue on the branch, GitHub builds a commit on refs/heads/gh-readonly-queue/develop/pr-<n>-<base-sha> for each enqueued pull request and asks for the required checks on it through the merge_group event — but pr.yml only listened for pull_request, so nothing ran on the queue commit, nothing reported, and the entry sat until the status-check timeout dequeued it as failed (PR #1580: queue commit created, no workflow run).

pr.yml now triggers on merge_group (checks_requested) as well, and every place that read the pull-request payload has a merge-group branch:

  • the concurrency group is merge-group-<ref> for a queue commit (each entry has its own ref) and pr-<number> for a pull request;
  • Changed areas treats a queue commit as a ready pull request — DRAFT and the ci:full label are both false, so the full tier runs — and computes the areas from the merge group's own diff, merge_group.base_sha..merge_group.head_sha, through the same scripts/ci-changed-areas.sh, so a queue commit gets exactly the checks a ready pull request with the same diff gets;
  • the protobuf wire-compatibility baseline is the merge group's base_ref (refs/heads/develop, stripped to the branch name) where a pull request uses github.base_ref;
  • the binaries are stamped VERSION=merge-queue (with the commit) instead of pr-<number>.

Build and test stays the single aggregate (if: always(), same needs) and reports on the queue commit.

The other workflows were audited: the ruleset's required checks are exactly the two pr.yml emits, and no other workflow gates pull requests, so none of them changes.

Also: tests/hygiene/merge_group_workflow_test.go holds the workflow to the trigger, the merge-group branches of Changed areas (diff range and draft flag), the two concurrency-group forms and the unconditional aggregate; CONTRIBUTING.md gains a paragraph on the queue next to the quick/full tier description; changelog fragment changes/unreleased/merge-group-ci.changed.md.

The merge queue is currently switched off in the develop ruleset. The change is inert while it is off and removes the stall if the queue is re-enabled.

How it was verified

  • actionlint .github/workflows/pr.yml: no finding introduced. The two it reports (shellcheck SC2129 style, SC2034 warning) are in untouched run: blocks and are reported identically on develop.
  • go test ./tests/hygiene -run TestPRWorkflow → ok. Against develop's pr.yml (the test file alone checked out over origin/develop) the five tests fail: no merge_group trigger, pull-request-only concurrency key, unguarded DRAFT/label reads, no merge-group diff range, unguarded payload reads.
  • go build ./... && go vet ./... && gofmt -l . → clean, gofmt -l . empty. python3 scripts/changelog.py check passes.
  • Dry evaluation of the changes job's shell for the merge_group case: the tier step with DRAFT=false CI_FULL_LABEL=false yields tier=full; a queue-shaped commit (origin/develop merged with this branch in a detached worktree) run through scripts/ci-changed-areas.sh <base_sha> <head_sha> with CI_TIER=full produced the same area outputs (go_shards=["runtime","runtime-corpus","model","export","graph","codegen","rest","migrate","cli"], …) as the pull-request form scripts/ci-changed-areas.sh origin/develop HEAD on this branch — byte-identical.

What this PR could not test

A real merge_group run cannot be triggered from this pull request: the queue runs the workflow that is on develop, and this is the change that makes develop's workflow listen. After merging, and once the queue is on again, enqueue a trivial pull request and confirm a PR workflow run appears for the gh-readonly-queue/develop/pr-<n>-... ref with Changed areas and Build and test reporting on the queue commit.

Ruleset settings to make when re-enabling the queue (GitHub UI, no CLI): repository Settings → Rules → Rulesets → develop → Require merge queue. Keep the required status checks exactly Changed areas and Build and test, and set Status check timeout to at least 120 minutes — of the last 40 green pr.yml runs, 10 exceeded 60 minutes (longest 92), so the previous 60-minute timeout would dequeue slow-but-passing entries as failed.

Checklist

  • make test and make lint pass locally (go build, go vet, gofmt -l, the hygiene suite; CI runs the rest)
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md
  • No internal work-item labels in the body, docs, or changelog

Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/41bd27e6714f4b5ca3c4fac9f92bb1fb
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/41bd27e6714f4b5ca3c4fac9f92bb1fb?variant=devin
Requested by: @HuiJun

The merge queue builds a commit on gh-readonly-queue/develop/... and asks for
the required checks on it, but nothing listened for merge_group, so Build and
test never reported and every queue entry timed out. Trigger on merge_group
(checks_requested), key the concurrency group on the queue ref, treat the run
as a ready pull request (full tier) over base_sha..head_sha of the merge group,
and give the protobuf baseline and the version stamp a merge-group branch.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration Bot and others added 2 commits October 27, 2026 17:56
The test fails on the workflow before this branch (no trigger, one concurrency
key, pull-request-only reads) and passes with it. CONTRIBUTING.md says how the
merge queue runs the full tier on the queue commit, with a changelog fragment.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review October 27, 2026 20:03
devin-ai-integration[bot]

This comment was marked as resolved.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@HuiJun
HuiJun merged commit f0cb5c3 into develop Oct 27, 2026
30 checks passed
@HuiJun
HuiJun deleted the ci/merge-group-trigger branch October 27, 2026 22:12
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