From 2d4e5ec17b6312df524c99c0097deab141805379 Mon Sep 17 00:00:00 2001 From: Andrew Peabody Date: Wed, 12 Feb 2025 11:05:54 -0800 Subject: [PATCH] chore(test-org): support add_checks (#2845) --- infra/terraform/modules/branch_protection/main.tf | 4 ++-- .../modules/branch_protection/variables.tf | 1 + infra/terraform/test-org/org/locals.tf | 13 +++++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/infra/terraform/modules/branch_protection/main.tf b/infra/terraform/modules/branch_protection/main.tf index 9541c330a08..4446196ab45 100644 --- a/infra/terraform/modules/branch_protection/main.tf +++ b/infra/terraform/modules/branch_protection/main.tf @@ -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 diff --git a/infra/terraform/modules/branch_protection/variables.tf b/infra/terraform/modules/branch_protection/variables.tf index ca11a343195..95f43e5aa31 100644 --- a/infra/terraform/modules/branch_protection/variables.tf +++ b/infra/terraform/modules/branch_protection/variables.tf @@ -31,6 +31,7 @@ variable "repos_map" { admins = optional(list(string), []) maintainers = optional(list(string), []) groups = optional(list(string), []) + add_checks = optional(list(string), []) })) } diff --git a/infra/terraform/test-org/org/locals.tf b/infra/terraform/test-org/org/locals.tf index 61914ace09e..f4f6d2a460e 100644 --- a/infra/terraform/test-org/org/locals.tf +++ b/infra/terraform/test-org/org/locals.tf @@ -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. @@ -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) * */ @@ -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" @@ -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"