Skip to content

Commit d59312d

Browse files
authored
Provision quarkus-flags resources (#376)
- Configure ownership for the new `quarkus-flags` repository in CODEOWNERS. - Introduce Terraform script to automate creation and configuration of the `quarkus-flags` GitHub repository, including metadata, branch protection rules, and team permissions. - Set up `quarkiverse-flags` team with appropriate roles and maintainers.
1 parent ec737ed commit d59312d

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ terraform-scripts/quarkus-doma.tf @quarkiverse/qua
3636
terraform-scripts/quarkus-easy-retrofit.tf @quarkiverse/quarkiverse-easy-retrofit
3737
terraform-scripts/quarkus-eddi.tf @quarkiverse/quarkiverse-eddi
3838
terraform-scripts/quarkus-embedded-postgresql.tf @quarkiverse/quarkiverse-embedded-postgresql
39+
terraform-scripts/quarkus-flags.tf @quarkiverse/quarkiverse-flags
3940
terraform-scripts/quarkus-flow.tf @quarkiverse/quarkiverse-flow
4041
terraform-scripts/quarkus-fluentjdbc.tf @quarkiverse/quarkiverse-fluentjdbc
4142
terraform-scripts/quarkus-file-vault.tf @quarkiverse/quarkiverse-file-vault

terraform-scripts/quarkus-flags.tf

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Create repository
2+
resource "github_repository" "quarkus_flags" {
3+
name = "quarkus-flags"
4+
description = "A lightweight and extensible feature flag extension"
5+
homepage_url = "https://docs.quarkiverse.io/quarkus-flags/dev"
6+
allow_update_branch = true
7+
archive_on_destroy = true
8+
delete_branch_on_merge = true
9+
has_issues = true
10+
vulnerability_alerts = true
11+
topics = ["quarkus-extension", "feature-flags", "toggles"]
12+
}
13+
14+
# Create team
15+
resource "github_team" "quarkus_flags" {
16+
name = "quarkiverse-flags"
17+
description = "flags team"
18+
create_default_maintainer = false
19+
privacy = "closed"
20+
parent_team_id = data.github_team.quarkiverse_members.id
21+
}
22+
23+
# Add team to repository
24+
resource "github_team_repository" "quarkus_flags" {
25+
team_id = github_team.quarkus_flags.id
26+
repository = github_repository.quarkus_flags.name
27+
permission = "maintain"
28+
}
29+
30+
# Add users to the team
31+
resource "github_team_membership" "quarkus_flags" {
32+
for_each = { for tm in ["mkouba"] : tm => tm }
33+
team_id = github_team.quarkus_flags.id
34+
username = each.value
35+
role = "maintainer"
36+
}
37+
38+
# Protect main branch using a ruleset
39+
resource "github_repository_ruleset" "quarkus_flags" {
40+
name = "main"
41+
repository = github_repository.quarkus_flags.name
42+
target = "branch"
43+
enforcement = "active"
44+
45+
conditions {
46+
ref_name {
47+
include = ["~DEFAULT_BRANCH"]
48+
exclude = []
49+
}
50+
}
51+
52+
bypass_actors {
53+
actor_id = data.github_app.quarkiverse_ci.id
54+
actor_type = "Integration"
55+
bypass_mode = "always"
56+
}
57+
58+
rules {
59+
# Prevent force push
60+
non_fast_forward = true
61+
# Require pull request reviews before merging
62+
pull_request {
63+
64+
}
65+
}
66+
}

0 commit comments

Comments
 (0)