Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions ansible/inventory/group_vars/all/source-repositories
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ community_files:
* @stackhpc/releasetrain
sms_lab: |
* @stackhpc/smslab
sre: |
* @stackhpc/sre
source_repositories:
# Kayobe team
beokay:
Expand Down Expand Up @@ -381,6 +383,21 @@ source_repositories:
- codeowners:
content: "{{ community_files.codeowners.admins }}"
dest: ".github/CODEOWNERS"
# SRE team
terraform-cloudflare-dns:
repository_type: "single-branch"
workflows: []
community_files:
- codeowners:
content: "{{ community_files.codeowners.sre }}"
dest: ".github/CODEOWNERS"
terraform-cloudflare-iam:
repository_type: "single-branch"
workflows: []
community_files:
- codeowners:
content: "{{ community_files.codeowners.sre }}"
dest: ".github/CODEOWNERS"
# Ansible team
ansible-role-libvirt-host:
repository_type: "ansible"
Expand Down
31 changes: 31 additions & 0 deletions terraform/github/branches.tf
Original file line number Diff line number Diff line change
Expand Up @@ -733,3 +733,34 @@ resource "github_branch_protection" "smslab_branch_protection" {
}
}

resource "github_branch_protection" "sre_branch_protection" {
for_each = toset(var.repositories["SRE"])
repository_id = data.github_repository.repositories[each.key].node_id

pattern = data.github_repository.repositories[each.key].default_branch
require_conversation_resolution = true
allows_deletions = false
allows_force_pushes = false

required_pull_request_reviews {
dismiss_stale_reviews = true
require_code_owner_reviews = true
required_approving_review_count = 1
}

restrict_pushes {
blocks_creations = false
push_allowances = [
resource.github_team.organisation_teams["Developers"].node_id
]
}

required_status_checks {
contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default
strict = false
}

lifecycle {
prevent_destroy = true
}
}
7 changes: 7 additions & 0 deletions terraform/github/teams.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ resource "github_team_repository" "smslab_repositories" {
permission = "push"
}

resource "github_team_repository" "sre_repositories" {
for_each = toset(var.repositories["SRE"])
team_id = resource.github_team.organisation_teams["SRE"].id
repository = each.value
permission = "push"
}

resource "github_team_membership" "team_membership" {
for_each = { for element in flatten([
for team in resource.github_team.organisation_teams : [
Expand Down
18 changes: 18 additions & 0 deletions terraform/github/terraform.tfvars.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@
"smslab-azimuth-config",
"smslab-config",
"smslab-kayobe-config"
],
"SRE": [
"terraform-cloudflare-dns",
"terraform-cloudflare-iam"
]
},
"teams": {
Expand Down Expand Up @@ -305,6 +309,20 @@
"seunghun1ee"
]
}
},
"SRE": {
"description": "Team responsible for internal infrastructure",
"privacy": "closed",
"users": {
"maintainers": [
"oneswig"
],
"members": [
"axelsimon",
"priteau",
"technowhizz"
]
Comment on lines +317 to +324

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 team members is a bit low to me, especially as Stig, Axel, and Pierre all have busy management roles as well. Might be worth adding a few more members. @jackhodgkiss and @mnasiadka at the very least I think.

}
}
},
"labels": [
Expand Down
9 changes: 9 additions & 0 deletions terraform/github/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ variable "repositories" {
"Platform" = [],
"ReleaseTrain" = [],
"SMSLab" = [],
"SRE" = [],
}
}

Expand Down Expand Up @@ -104,6 +105,14 @@ variable "teams" {
members = [],
}
},
"SRE" = {
description = "Team responsible for internal infrastructure"
privacy = "closed"
users = {
maintainers = [],
members = [],
}
},
}
}

Expand Down
Loading