Skip to content

Set up default protection ruleset for default and release branches - #222

Merged
borisstoyanov merged 3 commits into
apache:mainfrom
borisstoyanov:asf-yaml-rulesets
Sep 10, 2026
Merged

Set up default protection ruleset for default and release branches#222
borisstoyanov merged 3 commits into
apache:mainfrom
borisstoyanov:asf-yaml-rulesets

Conversation

@borisstoyanov

Copy link
Copy Markdown
Contributor

Replaces #210, which cannot be merged as it stands.

Why #210 does not work

The ASF infrastructure bot opened #210 against an old main, before .asf.yaml existed in the repo (added by #218). That leaves two problems:

  1. Add/add conflict on .asf.yaml.
  2. The bot's file carries only the rulesets: block. Merging it would drop everything the project already set — description, homepage, labels, features, protected_branches and copilot_code_review — and it has no ASF licence header, so the Apache RAT check fails.

This PR

The bot's commit rebased onto current main, with the rulesets: block merged into the existing .asf.yaml instead of replacing it. Authorship is kept on the ASF bot's commit.

Result: 14 lines added, nothing removed. The licence header, all existing settings and protected_branches stay exactly as they are.

Testing

  • .asf.yaml parses (yaml.safe_load).
  • Apache RAT 0.18 run locally with the workflow's own command: .asf.yaml is not flagged.

Once this merges, #210 can be closed.

Copilot AI lite review requested due to automatic review settings September 10, 2026 07:12
Comment thread .asf.yaml Outdated
Comment thread .asf.yaml
Comment thread .asf.yaml Outdated
@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown

✅ Build complete for PR #222.

📦 Binary artifacts are available in the workflow run (expires on September 20, 2026).

Note: Download artifacts by clicking on the workflow run link above, then scroll to the "Artifacts" section.
Artifacts from PR builds are for testing only and may contain unreviewed, malicious code.

No release/* or rel/* branches exist in this repo, and .asf.yaml already
defaults branches to ~DEFAULT_BRANCH when the key is omitted, so the block
only restated the default.
Copilot review credits are limited; reviewers can trigger a review by hand
when one is wanted.

@vishesh92 vishesh92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Adds an ASF GitHub rulesets configuration intended to enforce branch protection, while also changing Copilot code review trigger settings.

Changes:

  • Introduces a rulesets block with “Default Branch Protection” settings (force-push/deletion restrictions with a bypass team).
  • Changes copilot_code_review.review_drafts and copilot_code_review.review_on_push from true to false.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .asf.yaml Outdated
Comment thread .asf.yaml Outdated
Comment on lines +41 to +44
excludes: []
bypass_teams:
- root
restrict_deletion: true
Copilot AI review requested due to automatic review settings September 10, 2026 07:28

@sureshanaparti sureshanaparti 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.

LGTM

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Comment thread .asf.yaml
Comment on lines +33 to +39
rulesets:
- name: "Default Branch Protection"
type: branch
bypass_teams:
- root
restrict_deletion: true
restrict_force_push: true
Comment thread .asf.yaml
Comment on lines +43 to +44
review_drafts: false
review_on_push: false
Comment thread .asf.yaml
Comment on lines 41 to +44
copilot_code_review:
enabled: true
review_drafts: true
review_on_push: true
review_drafts: false
review_on_push: false
@borisstoyanov
borisstoyanov merged commit c903ec8 into apache:main Sep 10, 2026
4 of 5 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.

5 participants