Skip to content

Commit a196992

Browse files
committed
Remove branch protection for vwx releases
This change adapts our old branch protection rules - matching stackhpc/[vwxy]* to instead only match stackhpc/yoga for two reasons: 1. Older releases (V/W/X) are no longer supported 2. branch protection rules with wildcard matching regularly breaks our automation. For example, stackhpc/yoga-community files matches the existing rules, and is a common branch name for our automation, which can then no longer be deleted. This is a common occurance when re-creating an existing automated PR.
1 parent e2afa8b commit a196992

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

terraform/github/branches.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ resource "github_branch_protection" "kayobe_branch_protection_py_3-6" {
108108
# achieve more precision with the matching tools that GitHub provides.
109109
# https://stackoverflow.com/questions/53135414/how-to-apply-one-github-branch-rule-to-multiple-branches
110110
# Remember to update import_resources.py!
111-
pattern = "stackhpc/[vwxy]*"
111+
pattern = "stackhpc/yoga"
112112
require_conversation_resolution = true
113113
allows_deletions = false
114114
allows_force_pushes = false
@@ -128,7 +128,7 @@ resource "github_branch_protection" "kayobe_branch_protection_py_3-6" {
128128
}
129129

130130
required_status_checks {
131-
contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/[vwxy]*", lookup(var.required_status_checks, each.key, {
131+
contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/yoga", lookup(var.required_status_checks, each.key, {
132132
"default" : [
133133
"tox / Tox pep8 with Python 3.8",
134134
"tox / Tox py3 with Python 3.8"
@@ -381,7 +381,7 @@ resource "github_branch_protection" "openstack_branch_protection_py_3-6" {
381381
# achieve more precision with the matching tools that GitHub provides.
382382
# https://stackoverflow.com/questions/53135414/how-to-apply-one-github-branch-rule-to-multiple-branches
383383
# Remember to update import_resources.py!
384-
pattern = "stackhpc/[vwxy]*"
384+
pattern = "stackhpc/yoga"
385385
require_conversation_resolution = true
386386
allows_deletions = false
387387
allows_force_pushes = false
@@ -401,7 +401,7 @@ resource "github_branch_protection" "openstack_branch_protection_py_3-6" {
401401
}
402402

403403
required_status_checks {
404-
contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/[vwxy]*", lookup(var.required_status_checks, each.key, {
404+
contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/yoga", lookup(var.required_status_checks, each.key, {
405405
"default" : [
406406
"tox / Tox pep8 with Python 3.8",
407407
"tox / Tox py3 with Python 3.8"

terraform/github/import_resources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def main() -> None:
220220
if team_id == TeamID.KAYOBE or team_id == TeamID.OPENSTACK:
221221
# Pre-Zed branch protection
222222
branch_protection_resource = BranchProtection(team_id.name.lower(
223-
), {f"{name}:stackhpc/[vwxy]*": name for name in team_repositories}, parsed_args.dry_run, "_py_3-6")
223+
), {f"{name}:stackhpc/yoga": name for name in team_repositories}, parsed_args.dry_run, "_py_3-6")
224224
branch_protection_resource.refresh_resource()
225225
# Zed branch protection
226226
branch_protection_resource = BranchProtection(team_id.name.lower(

terraform/github/terraform.tfvars.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@
361361
"aio (Ubuntu Jammy OVN) / All in one",
362362
"aio upgrade (Rocky 9 OVN) / All in one"
363363
],
364-
"stackhpc/[vwxy]*": [
364+
"stackhpc/yoga": [
365365
"Tox pep8 with Python 3.8",
366366
"Tox releasenotes with Python 3.8",
367367
"Build Kayobe Image / Build kayobe image",

0 commit comments

Comments
 (0)