Skip to content

feat: allow auto-merge on kustomize-cluster for chart pin PRs - #47

Merged
xnoto merged 4 commits into
mainfrom
auto-merge-kustomize-cluster
Aug 30, 2026
Merged

feat: allow auto-merge on kustomize-cluster for chart pin PRs#47
xnoto merged 4 commits into
mainfrom
auto-merge-kustomize-cluster

Conversation

@xnoto

@xnoto xnoto commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Enables GitHub auto-merge on kustomize-cluster so the charts post-publish workflow can flag its generated opencode-server pin PR for automatic squash merge once the required test check passes.

  • main.tf: new local.auto_merge_github_repositories allowlist containing only kustomize-cluster, with a comment explaining the intent.
  • gh-repositories.tf: allow_auto_merge = contains(local.auto_merge_github_repositories, each.key) — every other managed repository keeps auto-merge disabled (explicit false, previously unset/default).
  • docs/chart-updater-github-app.md: runbook updated for the auto-merge behavior; ownership table now records that this root owns repository merge settings including the auto-merge allowlist; "Add a new destination repository" now asks whether the destination belongs in the auto-merge list.

Expected plan

One attribute change on github_repository.repositories["kustomize-cluster"] (allow_auto_merge: false → true). No new resources, no protection changes, no secret rotation. Branch protections (required check test, PR required, zero approvals) are unchanged and remain the merge gate — auto-merge does not bypass them.

Rollout order

This must merge and complete the environment-gated apply before the companion charts PR (auto-merge enable step) is exercised by a real chart release. If a release lands before the apply, the updater job fails at the enable step after publication; the chart artifact stays valid and the pin PR remains open for manual merge — no broken state.

Companion PR: charts (auto-merge enable step in update-opencode-gitops).

Enable GitHub auto-merge on kustomize-cluster so the charts
post-publish workflow can flag its generated opencode-server pin pull
request for automatic squash merge once the required `test` check
passes. Other repositories keep auto-merge disabled.

Update the chart updater runbook for the auto-merge behavior and record
that this root owns repository merge settings, including the
auto-merge allowlist.
@xnoto
xnoto requested a review from a team as a code owner August 30, 2026 18:39
@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

OpenTofu Test

OpenTofu test passed.

View the workflow run.

View run output
Terraform validate.......................................................Passed
Terraform validate with tflint...........................................Passed
Checkov..................................................................Passed
Terraform fmt............................................................Passed
Terraform docs...........................................................Passed
Detect hardcoded secrets.................................................Passed
check for case conflicts.................................................Passed
check for merge conflicts................................................Passed
check for broken symlinks............................(no files to check)Skipped
check vcs permalinks.....................................................Passed
detect destroyed symlinks................................................Passed
detect private key.......................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
don't commit to branch..................................................Skipped
check for added large files..............................................Passed

xnoto added 3 commits August 30, 2026 12:41
The auto-merge change accidentally normalized four SOPS data key
references to match their map keys (onion/www access key entries point
at *_aws_* keys in secrets.yaml). Restore the original references;
the only intended main.tf change is the auto-merge repository list.
@github-actions

Copy link
Copy Markdown
Contributor

OpenTofu Plan

OpenTofu plan passed.

View the workflow run.

View run output
OpenTofu will perform the following actions:

  # github_branch_protection.relaxed_protections["agent-knowledge"] will be created
  + resource "github_branch_protection" "relaxed_protections" {
      + allows_deletions                = false
      + allows_force_pushes             = false
      + enforce_admins                  = true
      + id                              = (known after apply)
      + lock_branch                     = false
      + pattern                         = "main"
      + repository_id                   = "R_kgDOUIbYrw"
      + require_conversation_resolution = false
      + require_signed_commits          = false
      + required_linear_history         = true

      + required_pull_request_reviews {
          + require_code_owner_reviews      = false
          + require_last_push_approval      = false
          + required_approving_review_count = 0
        }

      + restrict_pushes {
          + blocks_creations = true
          + push_allowances  = [
              + "makeitworkcloud/admins",
            ]
        }
    }

  # github_repository.repositories["kustomize-cluster"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      ~ allow_auto_merge                        = false -> true
        id                                      = "kustomize-cluster"
        name                                    = "kustomize-cluster"
        # (35 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 1 to add, 1 to change, 0 to destroy.
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
OpenTofu used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place (current -> planned)

OpenTofu will perform the following actions:

  # github_branch_protection.relaxed_protections["agent-knowledge"] will be created
  + resource "github_branch_protection" "relaxed_protections" {
      + allows_deletions                = false
      + allows_force_pushes             = false
      + enforce_admins                  = true
      + id                              = (known after apply)
      + lock_branch                     = false
      + pattern                         = "main"
      + repository_id                   = "R_kgDOUIbYrw"
      + require_conversation_resolution = false
      + require_signed_commits          = false
      + required_linear_history         = true

      + required_pull_request_reviews {
          + require_code_owner_reviews      = false
          + require_last_push_approval      = false
          + required_approving_review_count = 0
        }

      + restrict_pushes {
          + blocks_creations = true
          + push_allowances  = [
              + "makeitworkcloud/admins",
            ]
        }
    }

  # github_repository.repositories["kustomize-cluster"] will be updated in-place
  ~ resource "github_repository" "repositories" {
      ~ allow_auto_merge                        = false -> true
        id                                      = "kustomize-cluster"
        name                                    = "kustomize-cluster"
        # (35 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 1 to add, 1 to change, 0 to destroy.

@xnoto
xnoto merged commit f84b1a1 into main Aug 30, 2026
3 checks passed
@xnoto
xnoto deleted the auto-merge-kustomize-cluster branch August 30, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant