Skip to content

feat: distribute chart updater App key to kustomize-cluster - #58

Merged
xnoto merged 1 commit into
mainfrom
distribute-chart-updater-key-kustomize-cluster
Sep 4, 2026
Merged

feat: distribute chart updater App key to kustomize-cluster#58
xnoto merged 1 commit into
mainfrom
distribute-chart-updater-key-kustomize-cluster

Conversation

@xnoto

@xnoto xnoto commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds kustomize-cluster to the chart_updater_github_app_private_key recipient list so the repository's new rotate-opencode-openai workflow (kustomize-cluster pull request #200) can mint scoped makeitworkbot installation tokens.

Branch protection on kustomize-cluster main allows only the admins team and this App to complete pull-request merges (restrict_pushes in gh-protections.tf), so the App token is required for that workflow's unattended auto-merge. The App installation is organization-wide, so no installation change accompanies this recipient addition.

Type of change

  • Infrastructure (OpenTofu root or module)

Validation

  • Required pull-request checks pass — opentofu / test and opentofu / plan both succeeded
  • Generated or centrally distributed files were regenerated by their owning automation, not hand-edited — one-line local.secrets recipient-list change; no generated files touched

Impact and rollout

Plan scope (from the plan check): 1 to addgithub_actions_secret for CHART_UPDATER_GITHUB_APP_PRIVATE_KEY on kustomize-cluster (sensitive value redacted in output), and 2 to change — pre-existing topic drift on github_repository tfroot-twilio (removes tfstate) and www (removes cloudflare), reconciling live topics to the declared topics_by_repository map; not caused by this change. 0 to destroy.

After merge, the environment-gated apply distributes the secret. No change to App permissions, installation scope, or any other repository.

Safety and secrets

  • Contains no plaintext secrets, decrypted SOPS values, state files, kubeconfigs, tokens, or private endpoints — this change references the existing SOPS-backed field only
  • No local OpenTofu init/plan/apply/destroy/import/state operations were run or claimed — plans come from pull-request checks
  • Breaking or irreversible effects are described above with rollback notes — rollback is reverting this recipient entry and re-applying

Agent disclosure: change, branch, and this pull request were prepared by the makeitwork OpenCode agent at the owner's direction, following the chart-updater runbook's add-a-source procedure.

Adds kustomize-cluster to the chart updater GitHub App private-key
recipient list so its in-repo rotation workflow can mint makeitworkbot
installation tokens. Branch protection on kustomize-cluster allows only
the admins team and this App to complete pull-request merges, so the
App token is required for the rotation workflow's unattended auto-merge.
The App installation is organization-wide, so no installation change
accompanies this recipient addition.
@xnoto
xnoto requested a review from a team as a code owner September 4, 2026 20:34
@github-actions

github-actions Bot commented Sep 4, 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

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

OpenTofu Plan

OpenTofu plan passed.

View the workflow run.

View run output
OpenTofu will perform the following actions:

[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
      + created_at        = (known after apply)
      + id                = (known after apply)
      + key_id            = (known after apply)
      + plaintext_value   = (sensitive value)
      + remote_updated_at = (known after apply)
      + repository        = "kustomize-cluster"
      + repository_id     = (known after apply)
[REDACTED: potentially sensitive plan output]
      + updated_at        = (known after apply)
    }

  # github_repository.repositories["tfroot-twilio"] will be updated in-place
  ~ resource "github_repository" "repositories" {
        id                                      = "tfroot-twilio"
        name                                    = "tfroot-twilio"
      ~ topics                                  = [
          - "tfstate",
            # (5 unchanged elements hidden)
        ]
        # (36 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["www"] will be updated in-place
  ~ resource "github_repository" "repositories" {
        id                                      = "www"
        name                                    = "www"
      ~ topics                                  = [
          - "cloudflare",
            # (5 unchanged elements hidden)
        ]
        # (38 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 1 to add, 2 to change, 0 to destroy.
OpenTofu will perform the following actions:

[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
      + created_at        = (known after apply)
      + id                = (known after apply)
      + key_id            = (known after apply)
      + plaintext_value   = (sensitive value)
      + remote_updated_at = (known after apply)
      + repository        = "kustomize-cluster"
      + repository_id     = (known after apply)
[REDACTED: potentially sensitive plan output]
      + updated_at        = (known after apply)
    }

  # github_repository.repositories["tfroot-twilio"] will be updated in-place
  ~ resource "github_repository" "repositories" {
        id                                      = "tfroot-twilio"
        name                                    = "tfroot-twilio"
      ~ topics                                  = [
          - "tfstate",
            # (5 unchanged elements hidden)
        ]
        # (36 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # github_repository.repositories["www"] will be updated in-place
  ~ resource "github_repository" "repositories" {
        id                                      = "www"
        name                                    = "www"
      ~ topics                                  = [
          - "cloudflare",
            # (5 unchanged elements hidden)
        ]
        # (38 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

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

@xnoto
xnoto merged commit 0e10745 into main Sep 4, 2026
4 checks passed
@xnoto
xnoto deleted the distribute-chart-updater-key-kustomize-cluster branch September 4, 2026 20:43
xnoto added a commit to makeitworkcloud/kustomize-cluster that referenced this pull request Sep 4, 2026
## Summary

Adds `.github/workflows/rotate-opencode-openai.yml`, a
`workflow_dispatch` workflow that rotates the OpenAI OAuth grant in
`workloads/opencode/opencode-openai-secret.yaml` end to end:

1. Runs `opencode auth login --provider openai --method "ChatGPT
Pro/Plus (headless)"` (verified device flow on the deployed CLI 1.18.23)
and surfaces the device URL and code in the run summary.
2. Regenerates the Secret manifest and encrypts with `sops --encrypt`
under the repository creation rules — encryption-only, so CI holds no
age key and no Actions secret beyond the App key below.
3. Bumps `auth-seed-revision` to `<date>-<run_number>` in the same
change so the `seed-openai-auth` init container re-seeds the home PVC.
4. Commits to a rotation branch, opens a pull request, and enables
auto-merge using a scoped `makeitworkbot` installation token
(`actions/create-github-app-token`, mirroring the charts post-publish
pattern), which branch protection on `main` allows to complete the merge
once the required `test` check passes. Includes a branch-update fallback
for the strict up-to-date requirement.

## Type of change

- [x] CI / reusable workflow

## Validation

- [x] Required pull-request checks pass — [`test` (pre-commit):
success](https://github.com/makeitworkcloud/kustomize-cluster/actions/runs/33916941304/job/101166164341)
- [x] Generated or centrally distributed files were regenerated by their
owning automation, not hand-edited — no generated files touched

Design evidence: CLI behavior probed on the deployed image version
(device flow output, no localhost callback), install steps pinned to
`opencode-ai@1.18.23` and sops `v3.13.3` with checksum verification, and
the App-token merge pattern copied from the proven charts
`update-opencode-gitops` job. First dispatch is the smoke test.

## Impact and rollout

Prerequisite: makeitworkcloud/tfroot-github#58 distributing
`CHART_UPDATER_GITHUB_APP_PRIVATE_KEY` to this repository must be
applied before the first dispatch; until then the token step fails fast.
The workflow is dispatch-only, serialized by a concurrency group, and
never syncs Argo CD — generated rotation pull requests merge through the
required `test` check, then the existing Argo CD + Reloader +
init-container chain applies them.

## Safety and secrets

- [x] Contains no plaintext secrets, decrypted SOPS values, state files,
kubeconfigs, tokens, or private endpoints — the decrypted grant exists
only in ephemeral runner memory, is never echoed or uploaded, and the
generated commit is ciphertext plus the deliberately non-secret revision
key. The device URL and one-time code appear in the run summary by
design; they are short-lived and single-use
- [x] No local OpenTofu init/plan/apply/destroy/import/state operations
were run or claimed
- [x] Breaking or irreversible effects are described above with rollback
notes — rotation intentionally replaces the persisted grant; rollback
restores prior ciphertext with a new revision value

Agent disclosure: workflow, branch, and this pull request were prepared
by the makeitwork OpenCode agent at the owner's direction.
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