diff --git a/terraform/github/branches.tf b/terraform/github/branches.tf index 0fbd8f58..8be1d6b6 100644 --- a/terraform/github/branches.tf +++ b/terraform/github/branches.tf @@ -23,7 +23,7 @@ resource "github_branch_protection" "ansible_branch_protection" { ] required_status_checks { - contexts = lookup(var.required_status_checks, each.key, []) + contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default strict = false } @@ -52,7 +52,7 @@ resource "github_branch_protection" "batch_branch_protection" { ] required_status_checks { - contexts = lookup(var.required_status_checks, each.key, []) + contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default strict = false } @@ -84,11 +84,13 @@ resource "github_branch_protection" "kayobe_branch_protection_py_3-6" { ] required_status_checks { - contexts = lookup(var.required_status_checks, each.key, [ - "tox / Tox pep8 with Python 3.8", - "tox / Tox py3 with Python 3.6", - "tox / Tox py3 with Python 3.8", - ]) + contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/[vwxy]*", lookup(var.required_status_checks, each.key, { + "default" : [ + "tox / Tox pep8 with Python 3.8", + "tox / Tox py3 with Python 3.8", + "tox / Tox py3 with Python 3.6" + ] + }).default) strict = false } @@ -117,11 +119,13 @@ resource "github_branch_protection" "kayobe_branch_protection_py_3-10" { ] required_status_checks { - contexts = lookup(var.required_status_checks, each.key, [ - "tox / Tox pep8 with Python 3.10", - "tox / Tox py3 with Python 3.10", - "tox / Tox py3 with Python 3.8", - ]) + contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/[z,2]*", lookup(var.required_status_checks, each.key, { + "default" : [ + "tox / Tox pep8 with Python 3.10", + "tox / Tox py3 with Python 3.10", + "tox / Tox py3 with Python 3.8" + ] + }).default) strict = false } @@ -153,11 +157,13 @@ resource "github_branch_protection" "openstack_branch_protection_py_3-6" { } required_status_checks { - contexts = lookup(var.required_status_checks, each.key, [ - "tox / Tox pep8 with Python 3.8", - "tox / Tox py3 with Python 3.6", - "tox / Tox py3 with Python 3.8", - ]) + contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/[vwxy]*", lookup(var.required_status_checks, each.key, { + "default" : [ + "tox / Tox pep8 with Python 3.8", + "tox / Tox py3 with Python 3.8", + "tox / Tox py3 with Python 3.6" + ] + }).default) strict = false } lifecycle { @@ -185,11 +191,13 @@ resource "github_branch_protection" "openstack_branch_protection_py_3-10" { } required_status_checks { - contexts = lookup(var.required_status_checks, each.key, [ - "tox / Tox pep8 with Python 3.10", - "tox / Tox py3 with Python 3.10", - "tox / Tox py3 with Python 3.8", - ]) + contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/[z,2]*", lookup(var.required_status_checks, each.key, { + "default" : [ + "tox / Tox pep8 with Python 3.10", + "tox / Tox py3 with Python 3.10", + "tox / Tox py3 with Python 3.8" + ] + }).default) strict = false } @@ -218,7 +226,7 @@ resource "github_branch_protection" "platform_branch_protection" { ] required_status_checks { - contexts = lookup(var.required_status_checks, each.key, []) + contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default strict = false } @@ -247,7 +255,7 @@ resource "github_branch_protection" "releasetrain_branch_protection" { ] required_status_checks { - contexts = lookup(var.required_status_checks, each.key, []) + contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default strict = false } @@ -276,7 +284,7 @@ resource "github_branch_protection" "smslab_branch_protection" { ] required_status_checks { - contexts = lookup(var.required_status_checks, each.key, []) + contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default strict = false } diff --git a/terraform/github/terraform.tfvars.json b/terraform/github/terraform.tfvars.json index 7e3646b7..2d9aa669 100644 --- a/terraform/github/terraform.tfvars.json +++ b/terraform/github/terraform.tfvars.json @@ -296,37 +296,67 @@ "community_files" ], "required_status_checks": { - "ansible-collection-pulp": [ - "integration (3.16)", - "integration (3.21)", - "lint (2.10)", - "lint (2.12)", - "lint (2.9)" - ], - "designate-dashboard": [], - "horizon": [], - "ironic-ui": [], - "magnum-ui": [], - "neutron": [], - "octavia-dashboard": [], - "openstack-admin-guide": [ - "Build OpenStack admin guide" - ], - "stackhpc-kayobe-config": [ - "Tox pep8 with Python 3.8", - "Tox releasenotes with Python 3.8", - "Build Kayobe Image / Build kayobe image", - "aio (CentOS OVS) / All in one", - "aio (CentOS OVN) / All in one", - "aio (Rocky OVS) / All in one", - "aio (Rocky OVN) / All in one", - "aio (Ubuntu OVS) / All in one", - "aio (Ubuntu OVN) / All in one" - ], - "stackhpc-release-train": [ - "Ansible Lint", - "Ansible Validations", - "Build documentation" - ] + "ansible-collection-pulp": { + "default": [ + "integration (3.16)", + "integration (3.21)", + "lint (2.10)", + "lint (2.12)", + "lint (2.9)" + ] + }, + "designate-dashboard": { + "default": [] + }, + "horizon": { + "default": [] + }, + "ironic-ui": { + "default": [] + }, + "magnum-ui": { + "default": [] + }, + "neutron": { + "default": [] + }, + "octavia-dashboard": { + "default": [] + }, + "openstack-admin-guide": { + "default": [ + "Build OpenStack admin guide" + ] + }, + "stackhpc-kayobe-config": { + "default": ["none"], + "stackhpc/[vwxy]*": [ + "Tox pep8 with Python 3.8", + "Tox releasenotes with Python 3.8", + "Build Kayobe Image / Build kayobe image", + "aio (CentOS OVS) / All in one", + "aio (CentOS OVN) / All in one", + "aio (Rocky OVS) / All in one", + "aio (Rocky OVN) / All in one", + "aio (Ubuntu OVS) / All in one", + "aio (Ubuntu OVN) / All in one" + ], + "stackhpc/[z,2]*": [ + "Tox pep8 with Python 3.10", + "Tox releasenotes with Python 3.10", + "Build Kayobe Image / Build kayobe image", + "aio (Rocky 9 OVS) / All in one", + "aio (Rocky 9 OVN) / All in one", + "aio (Ubuntu Jammy OVS) / All in one", + "aio (Ubuntu Jammy OVN) / All in one" + ] + }, + "stackhpc-release-train": { + "default": [ + "Ansible Lint", + "Ansible Validations", + "Build documentation" + ] + } } }