Skip to content

ci: land pull requests to main through a merge queue - #575

Open
MushuEE wants to merge 1 commit into
rulesets/3-release-refsfrom
rulesets/4-merge-queue
Open

MushuEE wants to merge 1 commit into
rulesets/3-release-refsfrom
rulesets/4-merge-queue

Conversation

@MushuEE

@MushuEE MushuEE commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a merge queue to main, so each PR is tested on top of the latest main (plus anything ahead of it in the queue) before it lands, instead of being merged by hand. Stacked on #574. Review only the top commit.

Changes

  • .github/rulesets/protect-main.json: adds a merge_queue rule, starting from Substrate's settings:

    Parameter Value
    merge_method SQUASH
    grouping_strategy ALLGREEN
    min_entries_to_merge / max_entries_to_merge / max_entries_to_build 1 / 5 / 5
    min_entries_to_merge_wait_minutes 5
    check_response_timeout_minutes 60
  • go.yml now triggers on merge_group. build-and-test is the only required check, so it must report in the queue, or queued PRs time out after 60 minutes.

  • CONTRIBUTING.md: the Merging section now describes Merge when ready and the queue, for both member and external PRs. docs/rulesets.md and AGENTS.md are updated to match.

Scope

This PR covers only what the queue needs to work with today's single required check. Out of scope, for follow-up CI work:

  • Running e2e and check-no-binaries on merge_group.
  • Giving the e2e job a fixed name so it can become a required check.
  • Deciding which checks run before the queue, in the queue, and after merge.

Those checks aren't required today, so they don't block the queue.

After merge (repo admin)

  1. Merge this PR before applying the ruleset, so go.yml already listens on merge_group.
  2. Run hack/apply-rulesets.sh. protect-main is active, so the queue takes effect immediately.
  3. Optional: turn on Allow auto-merge in Settings → General.
  4. Announce the change to contributors.

Open question

The queue squash-merges. Should protect-main still allow rebase for PRs, or should it be squash-only to match the queue?

Fixes #571.

Add a merge_queue rule to protect-main, with Substrate's settings as a
starting point: squash, ALLGREEN, 1-5 pull requests per group, 5 minute
wait, 60 minute check timeout.

Trigger go.yml on merge_group, so the required build-and-test check
reports in the queue. The other workflows aren't required checks, so
they don't block the queue; running them in the queue and choosing the
queue's checks is follow-up CI work.

Update CONTRIBUTING.md: pull requests are added to the queue instead of
being merged by hand.

Fixes #571.
@rakyll

rakyll commented Nov 14, 2026

Copy link
Copy Markdown
Member

Why do we need this?

@MushuEE

MushuEE commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

This is only needed if the repo starts to get a lot more contributions [keeps the main branch stable while increasing developer velocity with lots of parallel merges], we needed it in substrate and I was working towards parity. Not required for now, feel free to close @rakyll if you don't think it will be valuable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants