community
community copied to clipboard
Change branch protections to allow deleting branches that meet the fallback `**/**` pattern?
From https://github.com/open-telemetry/community/issues/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.