Organizational branch protection #35831
Draft
+1,290
−55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In organizations with a large number of repositories, managing branch protection rules on a per-repository basis is not scalable and can lead to security inconsistencies. This pull request introduces organization-level branch protection rules to address this, allowing administrators to define rules that apply to all repositories within an organization.
To enhance security and ensure consistent policy enforcement, organization-level rules are designed to take precedence over repository-level rules. When determining the effective protection for a branch, the system will first look for a matching rule at the organization level. If one is found, it is applied. If not, it falls back to checking for repository-specific rules.
This change includes:
As I am not deeply familiar with the Gitea codebase and am relatively new to Go, I would greatly appreciate a thorough community review of these changes.