Skip to content

Switch to GitHub Rulesets (second attempt) - #477

Merged
ppkarwasz merged 3 commits into
mainfrom
feat/rulesets2
Aug 16, 2026
Merged

Switch to GitHub Rulesets (second attempt)#477
ppkarwasz merged 3 commits into
mainfrom
feat/rulesets2

Conversation

@ppkarwasz

Copy link
Copy Markdown
Member

The first attempt (#456) had to be reverted in #471 because a bug in ASFYaml made the resulting rulesets impossible to modify or remove through .asf.yaml. We rolled back to the legacy protected_branches configuration.

apache/infrastructure-asfyaml#93 has now landed and addresses the underlying issues (broken app_slug resolution, silent REST API failures, missing refs/heads/ / refs/tags/ prefixing), so we can move back to Rulesets.

The benefits over protected_branches remain:

  • Tag references can also be protected (see the new rel/* ruleset).
  • A single ruleset can target a glob of refs (e.g. gha/*) instead of one branch at a time.
  • Rules are publicly visible at https://github.com/apache/logging-parent/rules, so we can verify that the effective rules are those configured and third parties can audit the project's protection policy too.

The first attempt (#456) had to be reverted in #471 because a bug in ASFYaml made the resulting rulesets impossible to modify or remove through `.asf.yaml`. We rolled back to the legacy `protected_branches` configuration.

apache/infrastructure-asfyaml#93 has now landed and addresses the underlying issues (broken `app_slug` resolution, silent REST API failures, missing `refs/heads/` / `refs/tags/` prefixing), so we can move back to Rulesets.

The benefits over `protected_branches` remain:

- Tag references can also be protected (see the new `rel/*` ruleset).
- A single ruleset can target a glob of refs (e.g. `gha/*`) instead of one branch at a time.
- Rules are publicly visible at https://github.com/apache/logging-parent/rules, so we can verify that the effective rules are those configured and third parties can audit the project's protection policy too.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Migrates this repository’s GitHub ref protection configuration in .asf.yaml from legacy protected_branches to GitHub Rulesets, leveraging the recent ASFYaml fixes mentioned in the PR description.

Changes:

  • Enable the ASFYaml rulesets feature via meta.environments.
  • Remove legacy protected_branches configuration.
  • Add rulesets targeting the default branch and gha/*, plus a new rel/* tag-targeting ruleset.

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

Comment thread .asf.yaml Outdated
Comment thread .asf.yaml Outdated
@ppkarwasz

Copy link
Copy Markdown
Member Author

The rulesets key has been tested in many repositories, including logging-flume (https://github.com/apache/logging-flume/rules).

@vy: can we merge it?

@ppkarwasz
ppkarwasz enabled auto-merge (squash) August 16, 2026 17:16
@ppkarwasz
ppkarwasz merged commit 4c425e1 into main Aug 16, 2026
6 checks passed
@ppkarwasz
ppkarwasz deleted the feat/rulesets2 branch August 16, 2026 17:16
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