Skip to content

ci: prep test/lint workflows for a merge queue#677

Merged
DorianZheng merged 3 commits into
mainfrom
ci/merge-queue-prep
Jun 8, 2026
Merged

ci: prep test/lint workflows for a merge queue#677
DorianZheng merged 3 commits into
mainfrom
ci/merge-queue-prep

Conversation

@DorianZheng

@DorianZheng DorianZheng commented Jun 8, 2026

Copy link
Copy Markdown
Member

What

Prepares test.yml and lint.yml so they can gate a GitHub merge queue, without enabling the queue yet.

Three edits per workflow:

  1. Bare merge_group: trigger — a merge queue blocks until required checks report; a workflow that's path-filtered out of the merge_group event never runs and freezes the queue. The trigger has no top-level paths:.
  2. dorny/paths-filter@v3 → @v4 + explicit merge-group base/ref — v4 adds merge_group support; passing base_sha/head_sha lets it diff the merge group so only affected suites run in the queue. base/ref are empty on pull_request/push, where paths-filter ignores them. (PyO3 / vector pattern.)
  3. {test,lint}-conclusion aggregator — one required status check that passes only if every job succeeded or was skipped (path-filtered). if: !cancelled() is required so a failed dependency can't skip the gate, which GitHub would read as success. needs must be kept in sync when jobs are added/removed.

Why now (not enabling the queue here)

The conclusion checks must run at least once on a PR before they can be selected as required status checks. This PR makes that happen. Enabling the merge queue is a follow-up ruleset change (swap license/cla → the two conclusion checks, turn off strict "require up to date", turn on "require merge queue").

Verification

  • actionlint parses both files with no new errors (pre-existing warnings on test.yml:128 codecov input and lint.yml:142 shellcheck are in untouched jobs).
  • On this PR, expect Test (conclusion) and Lint (conclusion) to appear as checks.

Full runbook: docs/development/merge-queue-setup.md (separate).

Summary by CodeRabbit

  • Chores
    • Updated CI/CD workflow configurations to improve merge queue handling and status checks.

Add a bare `merge_group:` trigger and a single aggregator job to each of
test.yml and lint.yml so they can gate a GitHub merge queue, and keep
path-filtering working inside the queue.

- merge_group trigger: a merge queue blocks until required checks report;
  a workflow path-filtered out of the merge_group event would never run,
  freezing the queue. The trigger is bare (no top-level paths).
- paths-filter @V3 -> @v4 + explicit merge-group base/ref: v4 adds
  merge_group support; passing base_sha/head_sha lets it diff the merge
  group so only affected suites run in the queue (PyO3/vector pattern).
  base/ref are empty on pull_request/push, where paths-filter ignores them.
- {test,lint}-conclusion aggregator: one required status check that passes
  only if every job succeeded or was skipped. `if: !cancelled()` is required
  so a failed dependency can't skip the gate (a skipped required check reads
  as success). Keep `needs` in sync when adding jobs.

Does not enable the merge queue; that is a follow-up ruleset change once
these conclusion checks have run once and can be marked required.
Comment thread .github/workflows/lint.yml Fixed
Comment thread .github/workflows/test.yml Fixed
CodeQL flagged both aggregator jobs for not limiting GITHUB_TOKEN scope.
They only run jq over toJSON(needs), so add an explicit permissions: {}
(no permissions needed).
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Both GitHub Actions workflows (lint and test) now support GitHub merge queues by detecting merge_group events, conditionally computing path-filter diffs from merge-queue SHAs, and introducing separate conclusion jobs to serve as unified required status checks for branch protection.

Changes

Merge Queue Support for CI Workflows

Layer / File(s) Summary
Merge queue event triggers
.github/workflows/lint.yml, .github/workflows/test.yml
Both workflows now trigger on merge_group events (GitHub merge queues) alongside existing push and pull_request events.
Path filtering for merge-queue diffs
.github/workflows/lint.yml, .github/workflows/test.yml
dorny/paths-filter upgraded to v4 and configured to compute base and ref from github.event.merge_group SHAs when the event is merge_group, enabling correct path-change detection in merge-queue contexts.
Status-check conclusion jobs
.github/workflows/lint.yml, .github/workflows/test.yml
New lint-conclusion and test-conclusion jobs serve as single required status checks; each validates via jq that all upstream lint/test jobs either succeeded or were skipped, guarded by if: !cancelled() to prevent incorrect success semantics.

🐰 Merge queues now line up in a queue so fair,
With lint and test both working their care.
Path-filtering knows when changes appear,
Conclusion jobs gatekeep with a cheer—
CI checks pass when all jobs are clear! 🎯

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: prep test/lint workflows for a merge queue' clearly and accurately summarizes the main changes: preparing CI workflows to support GitHub merge queue functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/merge-queue-prep

Comment @coderabbitai help to get the list of available commands and usage tips.

@DorianZheng DorianZheng merged commit 5e08966 into main Jun 8, 2026
28 of 29 checks passed
@DorianZheng DorianZheng deleted the ci/merge-queue-prep branch June 8, 2026 12:13
DorianZheng added a commit that referenced this pull request Jun 8, 2026
…port (#679)

## Problem

After enabling the merge queue, `Test (conclusion)` and `Lint
(conclusion)` were made **required** status checks. But `test.yml` /
`lint.yml` still had a `paths:` filter on the **`pull_request`**
trigger, so a PR not touching those paths never runs the workflow — and
the required conclusion check stays **Pending**, blocking the PR from
merging.

Observed live on #678 (changed only `scripts/test/e2e/**` + `make/**` →
`test.yml` never ran → `Test (conclusion)` missing). Confirmed by
[GitHub
docs](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks):
*"a workflow skipped due to path filtering... checks... remain
'Pending'... blocked from merging."*

## Fix

Remove the `paths:` filter from the `pull_request` trigger on both
workflows so they run on **every** PR (matches rust-analyzer/bevy, which
have no top-level paths on their gating workflows). Nothing else
changes:
- Per-suite filtering still happens in the `changes` job (heavy jobs
skip when unaffected).
- The conclusion job reports `success`-or-`skipped`, so it always
reports green for unrelated PRs.
- `push:` paths are kept as-is (irrelevant to PR gating).

Cost: ~3 small jobs (config/changes/conclusion) per workflow per PR.

## Note

PRs opened before #677 merged still lack the conclusion jobs entirely
and need a rebase onto `main` to pick them up — separate from this fix.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Updated CI/CD workflows to ensure status checks remain responsive on
all pull requests targeting main, preventing them from getting stuck in
a pending state.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.

2 participants