From 6454ec73ee3e0e296f7085fdf9f6b7bc8611cc6b Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Mon, 26 Jun 2023 15:23:26 +0100 Subject: [PATCH] Complete Azimuth to Platform team rename Only the Azimuth team definition remains, to keep Terraform happy. --- .../group_vars/all/source-repositories | 4 +- terraform/github/branches.tf | 52 +++++++++---------- terraform/github/import_resources.py | 2 +- terraform/github/teams.tf | 14 ++--- terraform/github/terraform.tfvars.json | 44 ++++++++-------- terraform/github/variables.tf | 18 +++---- 6 files changed, 66 insertions(+), 68 deletions(-) diff --git a/ansible/inventory/group_vars/all/source-repositories b/ansible/inventory/group_vars/all/source-repositories index 44d9b454..13679350 100644 --- a/ansible/inventory/group_vars/all/source-repositories +++ b/ansible/inventory/group_vars/all/source-repositories @@ -22,14 +22,14 @@ community_files: codeowners: ansible: | * @stackhpc/ansible - azimuth: | - * @stackhpc/azimuth batch: | * @stackhpc/batch kayobe: | * @stackhpc/kayobe openstack: | * @stackhpc/openstack + platform: | + * @stackhpc/platform release_train: | * @stackhpc/releasetrain sms_lab: | diff --git a/terraform/github/branches.tf b/terraform/github/branches.tf index e73aed16..f5c4006d 100644 --- a/terraform/github/branches.tf +++ b/terraform/github/branches.tf @@ -32,8 +32,8 @@ resource "github_branch_protection" "ansible_branch_protection" { } } -resource "github_branch_protection" "azimuth_branch_protection" { - for_each = toset(var.repositories["Azimuth"]) +resource "github_branch_protection" "batch_branch_protection" { + for_each = toset(var.repositories["Batch"]) repository_id = data.github_repository.repositories[each.key].node_id pattern = data.github_repository.repositories[each.key].default_branch @@ -61,11 +61,11 @@ resource "github_branch_protection" "azimuth_branch_protection" { } } -resource "github_branch_protection" "batch_branch_protection" { - for_each = toset(var.repositories["Batch"]) +resource "github_branch_protection" "kayobe_branch_protection" { + for_each = toset(var.repositories["Kayobe"]) repository_id = data.github_repository.repositories[each.key].node_id - pattern = data.github_repository.repositories[each.key].default_branch + pattern = "stackhpc/**" require_conversation_resolution = true allows_deletions = false allows_force_pushes = false @@ -81,8 +81,12 @@ resource "github_branch_protection" "batch_branch_protection" { ] required_status_checks { - contexts = lookup(var.required_status_checks, each.key, []) - strict = false + contexts = lookup(var.required_status_checks, each.key, [ + "tox / Tox pep8 with Python 3.8", + "tox / Tox py36 with Python 3.6", + "tox / Tox py38 with Python 3.8", + ]) + strict = false } lifecycle { @@ -90,8 +94,8 @@ resource "github_branch_protection" "batch_branch_protection" { } } -resource "github_branch_protection" "kayobe_branch_protection" { - for_each = toset(var.repositories["Kayobe"]) +resource "github_branch_protection" "openstack_branch_protection" { + for_each = toset(var.repositories["OpenStack"]) repository_id = data.github_repository.repositories[each.key].node_id pattern = "stackhpc/**" @@ -99,16 +103,16 @@ resource "github_branch_protection" "kayobe_branch_protection" { allows_deletions = false allows_force_pushes = false + push_restrictions = [ + resource.github_team.organisation_teams["Developers"].node_id + ] + required_pull_request_reviews { dismiss_stale_reviews = true require_code_owner_reviews = true required_approving_review_count = 1 } - push_restrictions = [ - resource.github_team.organisation_teams["Developers"].node_id - ] - required_status_checks { contexts = lookup(var.required_status_checks, each.key, [ "tox / Tox pep8 with Python 3.8", @@ -123,32 +127,28 @@ resource "github_branch_protection" "kayobe_branch_protection" { } } -resource "github_branch_protection" "openstack_branch_protection" { - for_each = toset(var.repositories["OpenStack"]) +resource "github_branch_protection" "platform_branch_protection" { + for_each = toset(var.repositories["Platform"]) repository_id = data.github_repository.repositories[each.key].node_id - pattern = "stackhpc/**" + pattern = data.github_repository.repositories[each.key].default_branch require_conversation_resolution = true allows_deletions = false allows_force_pushes = false - push_restrictions = [ - resource.github_team.organisation_teams["Developers"].node_id - ] - required_pull_request_reviews { dismiss_stale_reviews = true require_code_owner_reviews = true required_approving_review_count = 1 } + push_restrictions = [ + resource.github_team.organisation_teams["Developers"].node_id + ] + required_status_checks { - contexts = lookup(var.required_status_checks, each.key, [ - "tox / Tox pep8 with Python 3.8", - "tox / Tox py36 with Python 3.6", - "tox / Tox py38 with Python 3.8", - ]) - strict = false + contexts = lookup(var.required_status_checks, each.key, []) + strict = false } lifecycle { diff --git a/terraform/github/import_resources.py b/terraform/github/import_resources.py index 46922054..19127ece 100755 --- a/terraform/github/import_resources.py +++ b/terraform/github/import_resources.py @@ -94,11 +94,11 @@ class TeamID(Enum): # /orgs/stackhpc/teams -q '.[] | {id, name}' ADMINS = 6873229 ANSIBLE = 2454000 - AZIMUTH = 6372898 BATCH = 6372897 DEVELOPERS = 6309608 KAYOBE = 6156230 OPENSTACK = 6372899 + PLATFORM = 8139842 RELEASETRAIN = 6372895 SMSLAB = 6372896 diff --git a/terraform/github/teams.tf b/terraform/github/teams.tf index b2e4820d..e4531c37 100644 --- a/terraform/github/teams.tf +++ b/terraform/github/teams.tf @@ -25,13 +25,6 @@ resource "github_team_repository" "ansible_repositories" { permission = "push" } -resource "github_team_repository" "azimuth_repositories" { - for_each = toset(var.repositories["Azimuth"]) - team_id = resource.github_team.organisation_teams["Azimuth"].id - repository = each.value - permission = "push" -} - resource "github_team_repository" "batch_repositories" { for_each = toset(var.repositories["Batch"]) team_id = resource.github_team.organisation_teams["Batch"].id @@ -60,6 +53,13 @@ resource "github_team_repository" "openstack_repositories" { permission = "push" } +resource "github_team_repository" "platform_repositories" { + for_each = toset(var.repositories["Platform"]) + team_id = resource.github_team.organisation_teams["Platform"].id + repository = each.value + permission = "push" +} + resource "github_team_repository" "releasetrain_repositories" { for_each = toset(var.repositories["ReleaseTrain"]) team_id = resource.github_team.organisation_teams["ReleaseTrain"].id diff --git a/terraform/github/terraform.tfvars.json b/terraform/github/terraform.tfvars.json index 520df404..3bbc41e3 100644 --- a/terraform/github/terraform.tfvars.json +++ b/terraform/github/terraform.tfvars.json @@ -45,10 +45,6 @@ "ansible-role-vxlan", "openstack-config" ], - "Azimuth": [ - ], - "Platform": [ - ], "Batch": [ "ansible-role-cluster-nfs", "ansible-role-openhpc", @@ -82,6 +78,8 @@ "octavia-dashboard", "stackhpc-inspector-plugins" ], + "Platform": [ + ], "ReleaseTrain": [ ".github", "stackhpc-release-train", @@ -147,25 +145,6 @@ ] } }, - "Platform": { - "description": "Team responsible for Platform development", - "privacy": "closed", - "users": { - "maintainers": [], - "members": [ - "darmach", - "GregWhiteyBialas", - "JohnGarbutt", - "m-bull", - "mkjpryor", - "priteau", - "scrungus", - "sd109", - "sjpb", - "stackhpc-ci" - ] - } - }, "Batch": { "description": "Team responsible for Batch development", "privacy": "closed", @@ -253,6 +232,25 @@ ] } }, + "Platform": { + "description": "Team responsible for Platform development", + "privacy": "closed", + "users": { + "maintainers": [], + "members": [ + "darmach", + "GregWhiteyBialas", + "JohnGarbutt", + "m-bull", + "mkjpryor", + "priteau", + "scrungus", + "sd109", + "sjpb", + "stackhpc-ci" + ] + } + }, "ReleaseTrain": { "description": "Team responsible for Release Train development", "privacy": "closed", diff --git a/terraform/github/variables.tf b/terraform/github/variables.tf index 1af84744..4223a274 100644 --- a/terraform/github/variables.tf +++ b/terraform/github/variables.tf @@ -21,10 +21,10 @@ variable "owner" { variable "repositories" { default = { "Ansible" = [], - "Azimuth" = [], "Batch" = [], "Kayobe" = [], "OpenStack" = [], + "Platform" = [], "ReleaseTrain" = [], "SMSLab" = [], } @@ -48,14 +48,6 @@ variable "teams" { members = [], } }, - "Azimuth" = { - description = "Team responsible for Azimuth development" - privacy = "closed" - users = { - maintainers = [], - members = [], - } - }, "Batch" = { description = "Team responsible for Batch development" privacy = "closed" @@ -88,6 +80,14 @@ variable "teams" { members = [], } }, + "Platform" = { + description = "Team responsible for Platform development" + privacy = "closed" + users = { + maintainers = [], + members = [], + } + }, "ReleaseTrain" = { description = "Team responsible for Release Train development" privacy = "closed"