Skip to content

support require up-to-date branches option#2362

Merged
marcoieni merged 1 commit intomainfrom
rulesets-support-require-up-to-date-branches
Apr 2, 2026
Merged

support require up-to-date branches option#2362
marcoieni merged 1 commit intomainfrom
rulesets-support-require-up-to-date-branches

Conversation

@marcoieni
Copy link
Copy Markdown
Member

@marcoieni marcoieni commented Mar 31, 2026

This setting was set manually from the UI. With this PR we add in team the ability to set this field via toml.

For the docs, check the field requiresStrictStatusChecks in: https://docs.github.com/en/graphql/reference/objects#branchprotectionrule

Why is the dry run not empty?

This PR disables this field for repositories that don't have checks. As you can see from the settings page, this field does nothing in this case:
image

  • When reviewing this PR, I checked that all the repositories shown in the dry run don't have any required checks.

@marcoieni marcoieni force-pushed the rulesets-support-require-up-to-date-branches branch from ff813d0 to 070e5e8 Compare March 31, 2026 11:25
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 31, 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/arewewebyet':
      Branch Protections:
          master
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/async-fundamentals-initiative':
      Branch Protections:
          master
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/book':
      Branch Protections:
          main
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/calendar':
      Branch Protections:
          main
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/calendar-generation':
      Branch Protections:
          main
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/cargo-bisect-rustc':
      Branch Protections:
          master
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/compiler-team':
      Branch Protections:
          master
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/crates.io-index':
      Branch Protections:
          master
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/docs.rs':
      Branch Protections:
          main
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/ena':
      Branch Protections:
          master
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/futures-rs':
      Branch Protections:
          master
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/impl-trait-utils':
      Branch Protections:
          main
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/leadership-council':
      Branch Protections:
          main
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/llvm-project':
      Branch Protections:
          rustc/*
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/portable-simd':
      Branch Protections:
          master
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/project-stable-mir':
      Branch Protections:
          main
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/rfcs':
      Branch Protections:
          master
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/rust-playground':
      Branch Protections:
          main
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/rustc-hash':
      Branch Protections:
          master
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/rustc-stable-hash':
      Branch Protections:
          main
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/this-week-in-rust':
      Branch Protections:
          main
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/wg-async':
      Branch Protections:
          master
            Require branches to be up to date: true => false
    📝 Editing repo 'rust-lang/wg-macros':
      Branch Protections:
          main
            Require branches to be up to date: true => false

@marcoieni marcoieni force-pushed the rulesets-support-require-up-to-date-branches branch 4 times, most recently from 0dfe7a9 to 9be08cb Compare March 31, 2026 11:59
})
.collect(),
strict_required_status_checks_policy: STRICT_REQUIRED_STATUS_CHECKS_POLICY_DEFAULT,
strict_required_status_checks_policy: branch_protection.require_up_to_date_branches,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I named this differently from the github api because imo this name is better

@marcoieni marcoieni force-pushed the rulesets-support-require-up-to-date-branches branch 6 times, most recently from 6d0bd87 to cd1e9a6 Compare March 31, 2026 13:22
@marcoieni marcoieni changed the title rulesets: support require up-to-date branches support require up-to-date branches option Mar 31, 2026
@marcoieni marcoieni force-pushed the rulesets-support-require-up-to-date-branches branch from cd1e9a6 to 52f5442 Compare March 31, 2026 13:29
@marcoieni
Copy link
Copy Markdown
Member Author

marcoieni commented Mar 31, 2026

Branch protections mentioned in the dry run:

  • rust-lang/arewewebyet master: link
  • rust-lang/async-fundamentals-initiative master: link
  • rust-lang/book main: link
  • rust-lang/calendar main: link
  • rust-lang/calendar-generation main: link
  • rust-lang/cargo-bisect-rustc master: link
  • rust-lang/compiler-team master: link
  • rust-lang/crates.io-index master: link
  • rust-lang/docs.rs main: link
  • rust-lang/ena master: link
  • rust-lang/futures-rs master: link
  • rust-lang/impl-trait-utils main: link
  • rust-lang/leadership-council main: link
  • rust-lang/llvm-project rustc/*: link
  • rust-lang/portable-simd master: link
  • rust-lang/project-stable-mir main: link
  • rust-lang/rfcs master: link
  • rust-lang/rust-playground main: link
  • rust-lang/rustc-stable-hash main: link
  • rust-lang/rustc-hash master: link
  • rust-lang/this-week-in-rust main: link
  • rust-lang/wg-async master: link
  • rust-lang/wg-macros main: link

@marcoieni
Copy link
Copy Markdown
Member Author

marcoieni commented Mar 31, 2026

Screenshots of Branch protections mentioned in the dry run

002-github-com-rust-lang-arewewebyet-settings-branch-protection-rules-36491779 004-github-com-rust-lang-async-fundamentals-initiative-settings-branch-protection-ru 007-github-com-rust-lang-book-settings-branch-protection-rules-679526 008-github-com-rust-lang-calendar-settings-branch-protection-rules-45683448 009-github-com-rust-lang-calendar-generation-settings-branch-protection-rules-456834 010-github-com-rust-lang-cargo-bisect-rustc-settings-branch-protection-rules-4568064 014-github-com-rust-lang-compiler-team-settings-branch-protection-rules-44253640 016-github-com-rust-lang-crates-io-index-settings-branch-protection-rules-5881191 020-github-com-rust-lang-docs-rs-settings-branch-protection-rules-70108634 021-github-com-rust-lang-ena-settings-branch-protection-rules-45747577 025-github-com-rust-lang-futures-rs-settings-branch-protection-rules-2061605 028-github-com-rust-lang-impl-trait-utils-settings-branch-protection-rules-42056592 031-github-com-rust-lang-leadership-council-settings-branch-protection-rules-3901164 033-github-com-rust-lang-llvm-project-settings-branch-protection-rules-55108342 035-github-com-rust-lang-portable-simd-settings-branch-protection-rules-46129211 037-github-com-rust-lang-project-stable-mir-settings-branch-protection-rules-4113567 040-github-com-rust-lang-rfcs-settings-branch-protection-rules-51333 043-github-com-rust-lang-rust-playground-settings-branch-protection-rules-46129215 048-github-com-rust-lang-rustc-stable-hash-settings-branch-protection-rules-50961826 047-github-com-rust-lang-rustc-hash-settings-branch-protection-rules-45765633 055-github-com-rust-lang-this-week-in-rust-settings-branch-protection-rules-70070614 057-github-com-rust-lang-wg-async-settings-branch-protection-rules-28658918 058-github-com-rust-lang-wg-macros-settings-branch-protection-rules-42221811

@rustbot

This comment has been minimized.

@marcoieni marcoieni force-pushed the rulesets-support-require-up-to-date-branches branch from e9d21d7 to 7faf175 Compare March 31, 2026 20:18
@marcoieni marcoieni force-pushed the rulesets-support-require-up-to-date-branches branch from 7faf175 to 9ca8874 Compare March 31, 2026 20:20
pub allowed_merge_teams: Vec<String>,
pub merge_bots: Vec<MergeBot>,
pub allowed_merge_apps: Vec<MergeBot>,
#[serde(default, skip_serializing_if = "is_false")]
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed anymore, we can always send this field to triagebot.

@marcoieni marcoieni marked this pull request as ready for review March 31, 2026 20:23
@rustbot
Copy link
Copy Markdown

rustbot commented Mar 31, 2026

rust_team_data/src/v1.rs has been modified, it is used (as a git dependency) by multiple sub-projects like triagebot, the www.rust-lang.org website and others.

If you are changing the data structures, please make sure that the changes are not going to break serde deserialization (adding a field is fine; removing or renaming a field isn't).

If you must do a breaking change to the format, make sure to coordinate it with all the users of the rust_team_data crate.

@ubiratansoares
Copy link
Copy Markdown
Contributor

ubiratansoares commented Apr 2, 2026

This PR disables this field for repositories that don't have checks. As you can see from the settings page, this field does nothing in this case

[EDIT] : I confirmed my previous comment here was inaccurate, because I was working with a wrong assumption. I think I need a coffee :P

@marcoieni marcoieni added this pull request to the merge queue Apr 2, 2026
Merged via the queue into main with commit 3c43021 Apr 2, 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