Skip to content

Commit

Permalink
Complete Azimuth to Platform team rename
Browse files Browse the repository at this point in the history
Only the Azimuth team definition remains, to keep Terraform happy.
  • Loading branch information
markgoddard committed Jun 26, 2023
1 parent 4555cef commit 6454ec7
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 68 deletions.
4 changes: 2 additions & 2 deletions ansible/inventory/group_vars/all/source-repositories
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
52 changes: 26 additions & 26 deletions terraform/github/branches.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -81,34 +81,38 @@ 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 {
prevent_destroy = true
}
}

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/**"
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",
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion terraform/github/import_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 7 additions & 7 deletions terraform/github/teams.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
44 changes: 21 additions & 23 deletions terraform/github/terraform.tfvars.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@
"ansible-role-vxlan",
"openstack-config"
],
"Azimuth": [
],
"Platform": [
],
"Batch": [
"ansible-role-cluster-nfs",
"ansible-role-openhpc",
Expand Down Expand Up @@ -82,6 +78,8 @@
"octavia-dashboard",
"stackhpc-inspector-plugins"
],
"Platform": [
],
"ReleaseTrain": [
".github",
"stackhpc-release-train",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
18 changes: 9 additions & 9 deletions terraform/github/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ variable "owner" {
variable "repositories" {
default = {
"Ansible" = [],
"Azimuth" = [],
"Batch" = [],
"Kayobe" = [],
"OpenStack" = [],
"Platform" = [],
"ReleaseTrain" = [],
"SMSLab" = [],
}
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 6454ec7

Please sign in to comment.