Skip to content

Change branch protections to allow deleting branches that meet the fallback **/** pattern? #2696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
trask opened this issue Apr 22, 2025 · 2 comments
Labels
area/repo-maintenance Maintenance of repos in the open-telemetry org

Comments

@trask
Copy link
Member

trask commented Apr 22, 2025

From #2695:

Currently I can push changes to any new branch in the repository, and the branch is created, but then I can't update the branch nor delete it. Maybe I should either be able to update/delete other branches than main, or not being able to create them, to avoid polluting the repository with read-only branches.

One reason not to allow deleting these branches is in case a release branch is created later, without thinking to update the branch protection rules, and then the release branch could be deleted.

Preventing these branches from being created in the first place seems ideal, because then it requires intentionally setting up branch protections ahead of time, such as for a release branch pattern.

Preventing these branches from being created can be achieved using the newer "Rulesets", e.g. https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/.github/repository-settings.md#restrict-branch-creation

But I didn't find a way to achieve this using the older "Branch protection rules".

The only reason I'm hesitant to recommend switching repos over to the newer Rulesets is that there's one feature we use that I couldn't find a way to migrate, which requires still maintaining at least one branch protection rule still in addition to the rulesets: https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/.github/repository-settings.md#branch-protections, and it could be a bit confusing to have a mix of the two.

@trask
Copy link
Member Author

trask commented Apr 28, 2025

Another advantage of rule sets is we can set org-level rule set (e.g. for EasyCLA)

@trask
Copy link
Member Author

trask commented May 14, 2025

Note: I'm officially giving up on Rulesets until https://github.com/orgs/community/discussions/61107#discussioncomment-6569780 is fixed 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/repo-maintenance Maintenance of repos in the open-telemetry org
Projects
Status: No status
Development

No branches or pull requests

2 participants