Skip to content

Set up a merge queue on main #571

Open

Description

@MushuEE

Summary

Add a merge queue to main, so PRs land through GitHub instead of being merged by hand, and each PR is validated against the latest main (plus any PRs ahead of it in the queue) before it lands.

Current state (checked 2026-11-12)

  • No merge_queue rule on main. The author merges once the PR is approved and CI is green (CONTRIBUTING.md).
  • allow_auto_merge is false in the repo settings.
  • No workflow triggers on merge_group:
Workflow Job name Triggers Required today?
go.yml build-and-test push (main), pull_request Yes
e2e.yml E2E (Kind / Substrate ${{ inputs.substrate_ref || 'go.mod' }}) push (main), pull_request, nightly schedule, workflow_dispatch No
check-binaries.yml check-no-binaries pull_request No
  • strict_required_status_checks_policy is false, so a PR can merge with checks that ran against an older main.

Proposal

  1. Add a merge_queue rule to protect-main (Combine the main rulesets into a single protect-main ruleset #548). Starting point, copied from Substrate:

    Parameter Value
    merge_method SQUASH
    grouping_strategy ALLGREEN
    min_entries_to_merge 1
    max_entries_to_merge 5
    max_entries_to_build 5
    min_entries_to_merge_wait_minutes 5
    check_response_timeout_minutes 60
  2. Turn on allow_auto_merge, so a PR can be marked to merge as soon as it is approved and green.

  3. Land the rule as a change to .github/rulesets/protect-main.json (Manage rulesets as code and protect release tags and branches #547).

  4. Update CONTRIBUTING.md: replace "the author merges" with "add to the merge queue" (or enable auto-merge), for both member and external-contributor PRs.

Dependencies (Epic 2, not yet filed)

The queue only works once CI supports it. These need to land first:

  • Run every PR workflow on merge_group. Add merge_group: to go.yml, e2e.yml and check-binaries.yml, and make base-ref logic handle github.event.merge_group.base_ref. Without this, required checks never report in the queue and every PR times out. (Substrate #1712.)
  • Stable required-check names. The e2e job name is dynamic, so it can't be a required check. PR and queue runs should report a fixed name such as e2e. (Substrate #2225.)
  • [RFC] Merge queue validation stages. Decide which checks run before the queue, in the queue, after merge and nightly, especially whether e2e blocks in the queue.

Acceptance criteria

  • PRs to main can only land through the merge queue
  • The queue's required checks match the list decided in the Epic 2 validation-stages RFC
  • Auto-merge is enabled in the repo settings
  • CONTRIBUTING.md describes the queue flow

Rollout

  1. Land the Epic 2 workflow changes, and confirm that merge_group runs report the expected check names.
  2. Add the merge_queue rule with protect-main in evaluate mode, and check rule insights.
  3. Switch to active and announce the change to contributors.

Open questions

  • Squash only, or allow rebase too? A merge queue uses one merge method, so this also decides whether the ruleset still needs to allow rebase.
  • Batch size and wait time: start with Substrate's values, and adjust once e2e duration and flakiness in the queue are known.

Part of #546.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions