Skip to content

Test GitHub Rulesets support in .asf.yaml#456

Open
ppkarwasz wants to merge 2 commits intomainfrom
feat/test-rulesets
Open

Test GitHub Rulesets support in .asf.yaml#456
ppkarwasz wants to merge 2 commits intomainfrom
feat/test-rulesets

Conversation

@ppkarwasz
Copy link
Copy Markdown
Contributor

@ppkarwasz ppkarwasz commented Apr 14, 2026

This change migrates branch protection from the deprecated Protected Branches feature to Rulesets, using the new rulesets key added in apache/infrastructure-asfyaml#89.

Why Rulesets?

The required_signatures rule was also dropped, as the project decided commit signing is not useful.

Testing strategy

The .asf.yaml file for Rulesets is only processed from the default branch. This means any mistake on main cannot be corrected without direct push access, which itself would be blocked by the broken rule. To avoid that trap, this PR:

  1. Applies the new ruleset only to test/rulesets, leaving main temporarily unprotected
  2. This allows direct fixes to main if the ruleset turns out to be misconfigured

Once the ruleset is verified to be correct on test/rulesets, I will restore full protection to main using a direct push.

This change migrates branch protection from the deprecated [Protected Branches](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches) feature to [Rulesets](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets), using the new `rulesets` key added in apache/infrastructure-asfyaml#89.

## WhyRulesets?

- Rules are publicly visible at https://github.com/apache/logging-parent/rules
- The same ruleset can be applied to multiple branches simultaneously
- `app_slug` identifiers replace fragile numeric `app_id` values

The `required_signatures` rule was also dropped, as the project decided commit signing is not useful.

## Testing strategy

The `.asf.yaml` file for Rulesets is only processed from the default branch. This means any mistake on `main` cannot be corrected without direct push access, which itself would be blocked by the broken rule. To avoid that trap, this PR:

1. Applies the new ruleset only to `test/rulesets`, leaving `main` temporarily unprotected
2. This allows direct fixes to `main` if the ruleset turns out to be misconfigured

Once the ruleset is verified to be correct on test/rulesets, a follow-up PR will apply it to `main` and restore full protection.
@ppkarwasz ppkarwasz enabled auto-merge (squash) April 14, 2026 16:28
ppkarwasz added a commit to apache/logging-log4j2 that referenced this pull request Apr 14, 2026
Similarly to apache/logging-parent#456 this PR switches from GitHub Branch Protection to Rulesets and:

- Keeps the same rules for `main`, while protection `2.x` is **temporarily** disabled in case we need to update the `.asf.yaml` file.
- Adds tag protection for the `rel/*` tags.
@ppkarwasz ppkarwasz requested review from Copilot and vy April 15, 2026 10:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates repository branch protection configuration in .asf.yaml from legacy Protected Branches to the newer GitHub Rulesets model, using app_slug-based status check identifiers and scoping the ruleset to a test branch for safe verification.

Changes:

  • Adds meta.environments: [github_rulesets] to enable non-standard Rulesets support in .asf.yaml.
  • Clears github.protected_branches and introduces a github.rulesets entry targeting test/rulesets.
  • Switches required status checks from app_id/context to app_slug/name and drops required_signatures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants