Skip to content

move rustfmt to GitHub rulesets#2323

Merged
marcoieni merged 1 commit intomainfrom
move-rustfmt-to-github-rulesets
Mar 16, 2026
Merged

move rustfmt to GitHub rulesets#2323
marcoieni merged 1 commit intomainfrom
move-rustfmt-to-github-rulesets

Conversation

@marcoieni
Copy link
Member

rustfmt has multiple branch protections, so it's interesting to see if team handles this correctly.

See https://github.com/rust-lang/team/blob/main/repos/rust-lang/rustfmt.toml

@github-actions
Copy link

github-actions bot commented Mar 16, 2026

Dry-run check results

[WARN  rust_team::sync] sync-team is running in dry mode, no changes will be applied.
[INFO  rust_team::sync] synchronizing crates-io
[INFO  rust_team::sync] synchronizing github
[INFO  rust_team::sync] 💻 Repo Diffs:
    📝 Editing repo 'rust-lang/rustfmt':
      Branch Protections:
          libsyntax
            Deleting branch protection
          rust-1.*
            Deleting branch protection
          main
            Deleting branch protection
      Rulesets:
          Creating 'Ruleset for main'
            Target: Branch
            Source Type: Repository
            Enforcement: Active
            Include Branches: ["refs/heads/main"]
            Exclude Branches: []
            Bypass Actors: None
            Restrict creations: yes
            Restrict deletions: yes
            Required approvals: 0
            Require review thread resolution: false
            Dismiss stale reviews on push: false
            Require last push approval: false
            Require code owner review: false
            Strict policy for status checks: false
            Required status checks: (i686-pc-windows-gnu, nightly) (integration_id: 15368), (i686-pc-windows-gnu, stable) (integration_id: 15368), (i686-pc-windows-msvc, nightly) (integration_id: 15368), (i686-pc-windows-msvc, stable) (integration_id: 15368), (x86_64-apple-darwin, nightly) (integration_id: 15368), (x86_64-apple-darwin, stable) (integration_id: 15368), (x86_64-pc-windows-gnu, nightly) (integration_id: 15368), (x86_64-pc-windows-gnu, stable) (integration_id: 15368), (x86_64-pc-windows-msvc, nightly) (integration_id: 15368), (x86_64-pc-windows-msvc, stable) (integration_id: 15368), (x86_64-unknown-linux-gnu, nightly) (integration_id: 15368), (x86_64-unknown-linux-gnu, stable) (integration_id: 15368), rustdoc check (integration_id: 15368)
            Forbid force pushes: yes
          Creating 'Ruleset for libsyntax'
            Target: Branch
            Source Type: Repository
            Enforcement: Active
            Include Branches: ["refs/heads/libsyntax"]
            Exclude Branches: []
            Bypass Actors: None
            Require code owner review: false
            Require last push approval: false
            Required approvals: 0
            Require review thread resolution: false
            Forbid force pushes: yes
            Restrict deletions: yes
            Restrict creations: yes
            Dismiss stale reviews on push: false
          Creating 'Ruleset for rust-1.*'
            Target: Branch
            Source Type: Repository
            Enforcement: Active
            Include Branches: ["refs/heads/rust-1.*"]
            Exclude Branches: []
            Bypass Actors: None
            Forbid force pushes: yes
            Dismiss stale reviews on push: false
            Restrict deletions: yes
            Require review thread resolution: false
            Require code owner review: false
            Required approvals: 0
            Require last push approval: false
            Restrict creations: yes

@marcoieni
Copy link
Member Author

The "libsyntax" and "rust-1.*" have the following:
github com_rust-lang_rustfmt_settings_branch_protection_rules_891286

While "main" also allows force pushes.
github com_rust-lang_rustfmt_settings_branch_protection_rules_891286 (1)

@marcoieni
Copy link
Member Author

In the last commit, I edited the rustfmt branch protection to reflect the current settings

@ubiratansoares
Copy link
Contributor

In the last commit, I edited the rustfmt branch protection to reflect the current settings

Should one expect something like

Forbid force pushes: no 

in a dry-run?

@marcoieni
Copy link
Member Author

We only record that rule when it's present:

rules.insert("Forbid force pushes", RuleValue::Present);

Notice that the other two rulesets dry-run have Forbid force pushes: yes.

@marcoieni marcoieni force-pushed the move-rustfmt-to-github-rulesets branch from 8dcea79 to d1d0004 Compare March 16, 2026 15:37
@rustbot
Copy link

rustbot commented Mar 16, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@marcoieni
Copy link
Member Author

marcoieni commented Mar 16, 2026

I just removed allow force push from the main branch after talking to the maintainer, so I updated this branch accordingly
image

@marcoieni marcoieni added this pull request to the merge queue Mar 16, 2026
Merged via the queue into main with commit 6c6357c Mar 16, 2026
3 checks passed
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.

3 participants