Skip to content

refactor(scripts): move provisioning scripts to scripts/provision/ - #2077

Merged
Smana merged 7 commits into
mainfrom
refactor/scripts-provision
Sep 22, 2026
Merged

Smana merged 7 commits into
mainfrom
refactor/scripts-provision

Conversation

@Smana

@Smana Smana commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

PR 3 of 3, and the last step of the scripts/ restructure. It moves the apply-time provisioning scripts into scripts/provision/. After it, scripts/ holds no loose executables (spec criterion 1):

$ ls scripts/
AGENTS.md  CLAUDE.md  README.md  tasks.yaml  ci/  docs/  lib/  ops/  provision/
flowchart LR
  T["terramate · tofu"] -->|"global.provisioner<br/>global.cloud_gate"| TP["provision/tm-provisioner.sh"]
  T -->|"data external (plan time)"| H["provision/helm-release-present.sh"]
  T --> OC["provision/openbao-config.sh"]
  OC -->|"sibling call"| S["provision/openbao-snapshot.sh<br/>(symlink → container-images/…)"]
  T --> Z["provision/zitadel-oidc-clients.sh"]
  HU["a human"] -->|"task provision:*"| Z & SS["provision/secret-store.sh"] & ZI["provision/zitadel-idp.sh"] & S
  classDef moved fill:#d4edda,stroke:#28a745
  class TP,H,OC,S,Z,SS,ZI moved
Loading

📋 Design

What moved

The files moved in three commits, one per risk group, each ending green. A fourth commit came from the rebase on #2078:

Commit Moves Refs failing, then fixed
plumbing tm-provisioner.sh, helm-release-present.sh, openbao-adopt-jwt-mount.sh 27 → 0
OpenBao openbao-config.sh, secret-store.sh, and the openbao-snapshot.sh symlink, re-pointed 19 → 0
ZITADEL zitadel-idp.sh, zitadel-actions/, zitadel-oidc-clients.sh 7 → 0
after the rebase on #2078 openbao-oidc-check.sh, which #2078 added at the root 3 refs + 5 paths → 0

Two lines change for 172 uses of tm-provisioner.sh: global.provisioner and global.cloud_gate, which names it separately.

openbao-snapshot.sh stays a symlink and moves next to openbao-config.sh, which runs it as a sibling at apply time (:1224, :1403, unchanged).

Nine lib/ sources gained one ../. Thirteen test suites now point at provision/, and no "still at scripts/ root" comment is left. The four human-run scripts are indexed as task provision:*. The terramate and tofu plumbing is not.

Every count was predicted by simulating each move first, and matched. Both gates are green on every intermediate commit, so the branch is bisectable.

⚠️ Merge gate

This is the one PR where terramate script run preview is real evidence: helm-release-present.sh runs at plan time through data "external" in both configure stacks, so a wrong path fails the preview. It can share a cluster session with the post-merge rebuild of #2078 (#2045).

  • TM_CLOUD=aws terramate script run preview and TM_CLOUD=gcp terramate script run preview both succeed

Evidence

Run on this branch, rebased on main @ 8eceefc6 (after #2078):

$ bash scripts/ci/tests/test-terramate-script-refs.sh
91 script reference(s) on executed opentofu/terramate lines checked; 0 failed
$ bash scripts/ci/tests/test-script-paths.sh
11 roots, 16 relative paths, 25 sources, 20 subjects checked; 0 failed
$ task ci:test
25 passed, 1 skipped, 0 failed
$ task ci:links / ci:doc-paths / ci:doc-claims / ci:idp-topology     # all exit 0
$ task --list | grep -cE '^\* (ops|docs|provision):'
19

In addition:

  • terramate fmt --check passes.
  • tofu fmt -check passes on all 11 touched directories, and tofu validate on 7 stacks. Neither step touched state.
  • ShellCheck with CI's exact find passes.
  • All 13 symlinks are intact.
  • terramate debug show globals resolves every scripts/ path in all 16 stacks.

Notes for review

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Rendered manifest diff — this PR vs main (desired state)

No changes to the rendered desired state. ✅

…cture

provision/: three risk-grouped moves, each simulated end to end (refs
88/0, paths 0 failed, suites 23/1/0). The openbao-snapshot symlink moves
with openbao-config.sh, which runs it as a sibling at apply time.
#2078 landed first and added the stage5 check at scripts/ root. It runs at
deploy time, so it belongs with the other provision scripts. Also points
#2078's new references (stage4's CA fetch, stage5, both suites, the lib
sources and docs) at their provision/ paths.
@Smana
Smana force-pushed the refactor/scripts-provision branch from bcc9430 to 0f95d7c Compare September 22, 2026 09:19
@Smana
Smana merged commit 3681e40 into main Sep 22, 2026
15 checks passed
@Smana
Smana deleted the refactor/scripts-provision branch September 22, 2026 09:22
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