From 4411a67c71b4a3a2f64ec452bd4012874a331b2d Mon Sep 17 00:00:00 2001 From: Alexey Zhokhov Date: Thu, 12 Nov 2026 20:08:49 +0700 Subject: [PATCH] Track the -legacy repository names and add velnor-lab Four repositories carry a -legacy suffix on GitHub: velnor, velnor-actions-fixture, velnor-apt and homebrew-velnor. The inventory still used the names without the suffix, so an apply would rename them back. The inventory, the import triples, the mandatory list and the runner group now use the current names. moved.tf carries the state entries to the new keys. velnor-lab joins the inventory with the dco_only check list. Its merge settings and both rulesets exist on GitHub and are imported by ID. Co-Authored-By: Claude Fable 5.2 Signed-off-by: Alexey Zhokhov --- README.md | 2 +- checks.tf | 8 +++---- imports.tf | 63 ++++++++++++++++++++++++++++++------------------- moved.tf | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ variables.tf | 19 +++++++++------ 5 files changed, 122 insertions(+), 36 deletions(-) create mode 100644 moved.tf diff --git a/README.md b/README.md index 9bc6cc9..713ec1e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # github-terraform Manages GitHub repository settings and branch/tag protection for the -`tailrocks` organization: 45 repositories, each with repository merge +`tailrocks` organization: 46 repositories, each with repository merge settings plus `protect-main` and `protect-tags` rulesets. ## Layout diff --git a/checks.tf b/checks.tf index 5179754..ba95071 100644 --- a/checks.tf +++ b/checks.tf @@ -8,7 +8,7 @@ check "mandatory_target_repositories_present" { condition = toset(keys(var.repository_policies)) == toset([ "cloudflare-tofu", "github-terraform", "graphql-java-datetime", "holla", "holla-apt", "homebrew-holla", "homebrew-parallax", "homebrew-ruxel", - "homebrew-tablerock", "homebrew-velnor", "jambalaya", "parallax", + "homebrew-tablerock", "homebrew-velnor-legacy", "jambalaya", "parallax", "parallax-telemetry-playground", "pg-bigdecimal", "pgquill", "renovate-rust", "repo-scan", "rust-repository-policy", "ruxel", "schemalane", "tablerock", "tailrocks-asd-ste100-skills", @@ -20,10 +20,10 @@ check "mandatory_target_repositories_present" { "tailrocks-skill-authoring-skills", "tailrocks-skills", "tailrocks-sqldiff", "tailrocks-typescript-skills", "terminal-components-claude", "termpane", "termrock", - "tracing-request-level", "tuiscotti", "velnor", - "velnor-actions-fixture", "velnor-apt", "velnor-new", "vision", + "tracing-request-level", "tuiscotti", "velnor-actions-fixture-legacy", + "velnor-apt-legacy", "velnor-lab", "velnor-legacy", "velnor-new", "vision", ]) - error_message = "repository_policies must contain exactly the 45 managed tailrocks repositories." + error_message = "repository_policies must contain exactly the 46 managed tailrocks repositories." } } diff --git a/imports.tf b/imports.tf index 5fd2349..d7f759e 100644 --- a/imports.tf +++ b/imports.tf @@ -71,8 +71,8 @@ import { } import { - to = module.repository_policy.github_repository.managed_settings["homebrew-velnor"] - id = "homebrew-velnor" + to = module.repository_policy.github_repository.managed_settings["homebrew-velnor-legacy"] + id = "homebrew-velnor-legacy" } import { @@ -222,18 +222,18 @@ import { id = "tuiscotti" } import { - to = module.repository_policy.github_repository.managed_settings["velnor"] - id = "velnor" + to = module.repository_policy.github_repository.managed_settings["velnor-legacy"] + id = "velnor-legacy" } import { - to = module.repository_policy.github_repository.managed_settings["velnor-actions-fixture"] - id = "velnor-actions-fixture" + to = module.repository_policy.github_repository.managed_settings["velnor-actions-fixture-legacy"] + id = "velnor-actions-fixture-legacy" } import { - to = module.repository_policy.github_repository.managed_settings["velnor-apt"] - id = "velnor-apt" + to = module.repository_policy.github_repository.managed_settings["velnor-apt-legacy"] + id = "velnor-apt-legacy" } import { @@ -293,8 +293,8 @@ import { } import { - to = module.repository_policy.github_repository_ruleset.protect_main["homebrew-velnor"] - id = "homebrew-velnor:23746087" + to = module.repository_policy.github_repository_ruleset.protect_main["homebrew-velnor-legacy"] + id = "homebrew-velnor-legacy:23746087" } import { @@ -437,18 +437,18 @@ import { } import { - to = module.repository_policy.github_repository_ruleset.protect_main["velnor"] - id = "velnor:19573071" + to = module.repository_policy.github_repository_ruleset.protect_main["velnor-legacy"] + id = "velnor-legacy:19573071" } import { - to = module.repository_policy.github_repository_ruleset.protect_main["velnor-actions-fixture"] - id = "velnor-actions-fixture:19572977" + to = module.repository_policy.github_repository_ruleset.protect_main["velnor-actions-fixture-legacy"] + id = "velnor-actions-fixture-legacy:19572977" } import { - to = module.repository_policy.github_repository_ruleset.protect_main["velnor-apt"] - id = "velnor-apt:19572991" + to = module.repository_policy.github_repository_ruleset.protect_main["velnor-apt-legacy"] + id = "velnor-apt-legacy:19572991" } import { @@ -503,8 +503,8 @@ import { } import { - to = module.repository_policy.github_repository_ruleset.protect_tags["homebrew-velnor"] - id = "homebrew-velnor:23746066" + to = module.repository_policy.github_repository_ruleset.protect_tags["homebrew-velnor-legacy"] + id = "homebrew-velnor-legacy:23746066" } import { @@ -646,18 +646,18 @@ import { } import { - to = module.repository_policy.github_repository_ruleset.protect_tags["velnor"] - id = "velnor:19573007" + to = module.repository_policy.github_repository_ruleset.protect_tags["velnor-legacy"] + id = "velnor-legacy:19573007" } import { - to = module.repository_policy.github_repository_ruleset.protect_tags["velnor-actions-fixture"] - id = "velnor-actions-fixture:19572996" + to = module.repository_policy.github_repository_ruleset.protect_tags["velnor-actions-fixture-legacy"] + id = "velnor-actions-fixture-legacy:19572996" } import { - to = module.repository_policy.github_repository_ruleset.protect_tags["velnor-apt"] - id = "velnor-apt:19572989" + to = module.repository_policy.github_repository_ruleset.protect_tags["velnor-apt-legacy"] + id = "velnor-apt-legacy:19572989" } import { @@ -674,3 +674,18 @@ import { to = module.repository_policy.github_repository_ruleset.protect_tags["velnor-new"] id = "velnor-new:24397132" } + +import { + to = module.repository_policy.github_repository.managed_settings["velnor-lab"] + id = "velnor-lab" +} + +import { + to = module.repository_policy.github_repository_ruleset.protect_main["velnor-lab"] + id = "velnor-lab:27119695" +} + +import { + to = module.repository_policy.github_repository_ruleset.protect_tags["velnor-lab"] + id = "velnor-lab:27119696" +} diff --git a/moved.tf b/moved.tf new file mode 100644 index 0000000..6cc988d --- /dev/null +++ b/moved.tf @@ -0,0 +1,66 @@ +# SPDX-FileCopyrightText: 2026 Alexey Zhokhov +# SPDX-License-Identifier: Apache-2.0 + +# Four repositories carry a -legacy suffix on GitHub. These blocks move their state +# entries to the matching inventory keys so that no resource is destroyed. +# Delete this file after the first apply that includes it. + +moved { + from = module.repository_policy.github_repository.managed_settings["homebrew-velnor"] + to = module.repository_policy.github_repository.managed_settings["homebrew-velnor-legacy"] +} + +moved { + from = module.repository_policy.github_repository_ruleset.protect_main["homebrew-velnor"] + to = module.repository_policy.github_repository_ruleset.protect_main["homebrew-velnor-legacy"] +} + +moved { + from = module.repository_policy.github_repository_ruleset.protect_tags["homebrew-velnor"] + to = module.repository_policy.github_repository_ruleset.protect_tags["homebrew-velnor-legacy"] +} + +moved { + from = module.repository_policy.github_repository.managed_settings["velnor"] + to = module.repository_policy.github_repository.managed_settings["velnor-legacy"] +} + +moved { + from = module.repository_policy.github_repository_ruleset.protect_main["velnor"] + to = module.repository_policy.github_repository_ruleset.protect_main["velnor-legacy"] +} + +moved { + from = module.repository_policy.github_repository_ruleset.protect_tags["velnor"] + to = module.repository_policy.github_repository_ruleset.protect_tags["velnor-legacy"] +} + +moved { + from = module.repository_policy.github_repository.managed_settings["velnor-actions-fixture"] + to = module.repository_policy.github_repository.managed_settings["velnor-actions-fixture-legacy"] +} + +moved { + from = module.repository_policy.github_repository_ruleset.protect_main["velnor-actions-fixture"] + to = module.repository_policy.github_repository_ruleset.protect_main["velnor-actions-fixture-legacy"] +} + +moved { + from = module.repository_policy.github_repository_ruleset.protect_tags["velnor-actions-fixture"] + to = module.repository_policy.github_repository_ruleset.protect_tags["velnor-actions-fixture-legacy"] +} + +moved { + from = module.repository_policy.github_repository.managed_settings["velnor-apt"] + to = module.repository_policy.github_repository.managed_settings["velnor-apt-legacy"] +} + +moved { + from = module.repository_policy.github_repository_ruleset.protect_main["velnor-apt"] + to = module.repository_policy.github_repository_ruleset.protect_main["velnor-apt-legacy"] +} + +moved { + from = module.repository_policy.github_repository_ruleset.protect_tags["velnor-apt"] + to = module.repository_policy.github_repository_ruleset.protect_tags["velnor-apt-legacy"] +} diff --git a/variables.tf b/variables.tf index 4f363a9..eac4b08 100644 --- a/variables.tf +++ b/variables.tf @@ -82,7 +82,7 @@ variable "repository_policies" { visibility = "public" required_checks = ["DCO", "Policy", "ci-required"] } - "homebrew-velnor" = { + "homebrew-velnor-legacy" = { visibility = "public" required_checks = ["DCO", "Policy", "ci-required"] } @@ -216,15 +216,20 @@ variable "repository_policies" { visibility = "public" required_checks = ["DCO", "Required"] } - "velnor" = { + "velnor-actions-fixture-legacy" = { visibility = "public" required_checks = ["DCO", "Policy", "ci-required"] } - "velnor-actions-fixture" = { + "velnor-apt-legacy" = { visibility = "public" required_checks = ["DCO", "Policy", "ci-required"] } - "velnor-apt" = { + "velnor-lab" = { + # dco_only until the generated Rust CI workflow exists; then add its gate check. + visibility = "public" + required_checks = ["DCO"] + } + "velnor-legacy" = { visibility = "public" required_checks = ["DCO", "Policy", "ci-required"] } @@ -254,9 +259,9 @@ variable "velnor_runner_group_repositories" { "tablerock", "termrock", "tracing-request-level", - "velnor", - "velnor-actions-fixture", - "velnor-apt", + "velnor-actions-fixture-legacy", + "velnor-apt-legacy", + "velnor-legacy", ] validation {