8000 Combine the main rulesets into a single protect-main ruleset · Issue #548 · google/ax · GitHub
[go: up one dir, main page]

Skip to content

Combine the main rulesets into a single protect-main ruleset #548

Open

Description

@MushuEE

Summary

Replace the two overlapping rulesets on main with one ruleset, protect-main, that holds every rule for the default branch.

Current state

Ruleset Target Rules
main ~DEFAULT_BRANCH deletion
main: require PR review and CI ~DEFAULT_BRANCH non_fast_forward; pull_request (1 approval, merge methods merge/squash/rebase, dismiss_stale_reviews_on_push: false); required_status_checks (build-and-test)

Problems:

  • To see the full policy for main, you have to read two rulesets.
  • The ruleset allows the merge method, but the repo settings disable merge commits (allow_merge_commit: false). The two disagree.

Proposal

Create one protect-main ruleset on ~DEFAULT_BRANCH containing:

  • deletion
  • non_fast_forward
  • pull_request:
    • required_approving_review_count: 1
    • allowed_merge_methods: ["squash", "rebase"], matching the repo settings
    • Leave dismiss_stale_revi 8216 ews_on_push unchanged here. Changing it is tracked in its own sub-issue, "Clear approvals on fresh commits".
  • required_status_checks: build-and-test, unchanged

This change doesn't make the policy stricter, apart from removing the merge method that the repo settings already disable. Stricter rules (stale-approval dismissal, merge queue, more required checks) come in later sub-issues of this epic.

Rollout

  1. Create protect-main in evaluate mode, next to the two existing rulesets.
  2. Check the rule insights to confirm it evaluates the same way as the existing rulesets.
  3. Switch protect-main to active, then delete main and main: require PR review and CI.

If #547 (Manage repository rulesets as code) lands first, this should land as .github/rulesets/protect-main.json and be applied with the script.

Acceptance criteria

  • Exactly one active branch ruleset (protect-main) targets main
  • protect-main contains deletion, non-fast-forward, pull request (1 approval, squash or rebase) and the build-and-test required check
  • The old main and main: require PR review and CI rulesets are deleted
  • Merging a PR still works with squash and rebase

Activity

  1. added
    devxDeveloper experience: onboarding, defaults, and gaps found building on AX
    on Nov 1, 2026
  2. added and removed
    devxDeveloper experience: onboarding, defaults, and gaps found building on AX
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      0