Skip to content

Commit c036efc

Browse files
committed
Apply RFC0015 branch protection by default
1 parent 7b4f5aa commit c036efc

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

orgs/org_management.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,18 +192,17 @@ def generate_teams(self):
192192

193193
def generate_branch_protection(self):
194194
# basis is static config in self.branch_protection which is never overwritten
195-
# generate RFC0015 branch protection rules for every WG+TOC that opted in
195+
# generate RFC0015 branch protection rules for every WG+TOC by default
196196
for org in OrgGenerator._MANAGED_ORGS:
197197
branch_protection_repos = self.branch_protection["branch-protection"]["orgs"][org]["repos"]
198198
wgs = self.working_groups[org]
199199
if org == self.toc["org"]:
200200
wgs.append(self.toc)
201201
for wg in wgs:
202-
if wg.get("config", {}).get("generate_rfc0015_branch_protection_rules", False): # config is optional
203-
repo_rules = self._generate_wg_branch_protection(wg)
204-
for repo in repo_rules:
205-
if repo not in branch_protection_repos:
206-
branch_protection_repos[repo] = repo_rules[repo]
202+
repo_rules = self._generate_wg_branch_protection(wg)
203+
for repo in repo_rules:
204+
if repo not in branch_protection_repos:
205+
branch_protection_repos[repo] = repo_rules[repo]
207206

208207
def write_org_config(self, path: str):
209208
print(f"Writing org configuration to {path}")

toc/rfc/rfc-0015-branch-protection.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,11 @@ With respect to the approval of pull requests, we propose that the number of app
3737
* 1 approval will be required when a working group has 4 or more people in the approver role.
3838

3939
The automation should allow to override the standard branch protection per respository using a configuration file maintained in this community repository. This allows working group leads e.g. to reduce the number of required approvals if several approvers are temporarily not available.
40+
41+
## Amendments
42+
43+
### Protection by Default
44+
45+
To improve the security posture of the foundation, the branch protection rules defined in this RFC are applied by default to all repositories of all Working Groups. The previous opt-in mechanism via a flag in Working Group charters is removed.
46+
47+
Working Groups can request exceptions for specific repositories by creating a pull request against `orgs/branchprotection.yml`. The pull request description MUST contain a justification for the exception.

toc/working-groups/app-runtime-deployments.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,4 @@ areas:
7979
- cloudfoundry/relint-team
8080
- cloudfoundry/runtime-ci
8181
- cloudfoundry/uptimer
82-
config:
83-
generate_rfc0015_branch_protection_rules: true
8482
```

toc/working-groups/app-runtime-interfaces.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,4 @@ areas:
522522
repositories:
523523
- cloudfoundry/stratos
524524
- cloudfoundry/stratos-buildpack
525-
526-
config:
527-
generate_rfc0015_branch_protection_rules: true
528525
```

toc/working-groups/app-runtime-platform.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ bots:
5454
- name: Cryogenics CI bot
5555
github: Cryogenics-CI
5656
config:
57-
generate_rfc0015_branch_protection_rules: true
5857
github_project_sync:
5958
mapping:
6059
cloudfoundry: 41

toc/working-groups/cf-on-k8s.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ technical_leads:
3838
bots:
3939
- name: korifi-bot
4040
github: korifi-bot
41-
config:
42-
generate_rfc0015_branch_protection_rules: true
4341
areas:
4442
- name: Korifi
4543
approvers:

0 commit comments

Comments
 (0)