Skip to content

Commit

Permalink
chore(test-org): support add_checks (#2845)
Browse files Browse the repository at this point in the history
  • Loading branch information
apeabody authored Feb 12, 2025
1 parent 33b0442 commit 2d4e5ec
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions infra/terraform/modules/branch_protection/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ resource "github_branch_protection" "default" {

required_status_checks {
strict = true
contexts = [
contexts = setunion([
"cla/google",
"${each.key}-int-trigger (cloud-foundation-cicd)",
"lint",
"conventionalcommits.org"
]
], lookup(var.repos_map[each.key], "add_checks", []))
}

enforce_admins = false
Expand Down
1 change: 1 addition & 0 deletions infra/terraform/modules/branch_protection/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ variable "repos_map" {
admins = optional(list(string), [])
maintainers = optional(list(string), [])
groups = optional(list(string), [])
add_checks = optional(list(string), [])
}))
}

Expand Down
13 changes: 11 additions & 2 deletions infra/terraform/test-org/org/locals.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019-2024 Google LLC
* Copyright 2019-2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -71,6 +71,7 @@ locals {
* lint_env = "map(string)" (optional)
* disable_lint_yaml = BOOL (optional, default is true)
* enable_periodic = BOOL (optional, if enabled runs a daily periodic test. Defaults to false )
* add_checks = "list(string)" ["check name"] (optional)
*
*/

Expand Down Expand Up @@ -159,6 +160,7 @@ locals {
"ENABLE_PARALLEL" = "0",
"DISABLE_TFLINT" = "1"
}
add_checks = ["terraform-example-foundation-int-trigger-default (cloud-foundation-cicd)"]
},
{
name = "terraform-google-log-analysis"
Expand Down Expand Up @@ -855,8 +857,15 @@ locals {
name = "terraform-google-enterprise-application"
org = "GoogleCloudPlatform"
description = "Deploy an enterprise developer platform on Google Cloud"
maintainers = ["gtsorbo", "erictune", "yliaog", "sleighton2022", "apeabody"]
maintainers = ["yliaog", "sleighton2022"]
admins = ["apeabody"]
topics = join(",", [local.common_topics.e2e, local.common_topics.ops])
add_checks = [
"terraform-google-enterprise-application-single-int-trigger (cloud-foundation-cicd)",
"terraform-google-enterprise-application-hpc-int-trigger (cloud-foundation-cicd)",
"golangci (test/integration)",
"lint-terraform-min"
]
},
{
name = "terraform-genai-rag"
Expand Down

0 comments on commit 2d4e5ec

Please sign in to comment.