Skip to content
This repository was archived by the owner on Aug 26, 2026. It is now read-only.

chore(scripts): collect the cutover and recovery helpers into infra/scripts - #768

Merged
ExtraToast merged 1 commit into
mainfrom
chore/collect-ops-helper-scripts
Aug 26, 2026
Merged

chore(scripts): collect the cutover and recovery helpers into infra/scripts#768
ExtraToast merged 1 commit into
mainfrom
chore/collect-ops-helper-scripts

Conversation

@ExtraToast

Copy link
Copy Markdown
Owner

Why

Five operational scripts were sitting untracked in the repository root, surviving only as long as the working copy. Each encodes a procedure worth having on the next incident.

Script What it does
fix-vault-bootstrap-auth.sh Creates the vault-bootstrap policy and kubernetes auth role, then proves the ServiceAccount can log in from inside the cluster. Needed again after any Vault re-initialisation.
resume-mail-provisioner.sh Resumes apps-mail and verifies the provisioning sidecar, re-suspending and rolling back the Deployment on any failed check.
flip-flux-source-to-org.sh Points the Flux source at the organisation repository with GitHub App auth.
flip-flux-source-to-monorepo.sh The matching rollback, including the spec.provider removal that a plain kubectl apply does not undo.
post-cutover-fixups.sh Writes the Discord webhook and mints the Vault metrics token.

Renamed to the kebab-case the directory already uses; the cross-reference between the two flip scripts follows the rename.

Two fixes the move justified

flip-flux-source-to-monorepo.sh derived the monorepo path from a hardcoded absolute path under one user's home directory. Now that it lives in the tree it derives the root from its own location — verified to resolve correctly when invoked by relative path, by absolute path, and from an unrelated working directory.

flip-flux-source-to-org.sh runs under set -uo pipefail with no -e, so its unguarded cd "$WORK" would have carried on into the wrong tree had the cd failed. It now dies instead. Shellcheck flagged it; the missing -e is what made it real rather than cosmetic.

All five are bash -n clean with zero shellcheck warnings at -S warning. fix-vault-bootstrap-auth.sh was re-run from its new location to confirm the move did not break its preflight.

Deliberately not included

  • tmp.sh contains a live Discord webhook URL. It is scratch rather than a procedure, and that URL needs rotating regardless — it was pasted into a chat transcript.
  • tmp.js, tpm.sh, tmp.sh.bak-qbt are one-off fragments.
  • unseal-vault.sh was not part of this work, so it is left where it is rather than adopted without review.

…cripts

Five operational scripts were sitting untracked in the repository root, where
they survived only as long as the working copy. Each one encodes a procedure
that is worth having on the next incident:

  fix-vault-bootstrap-auth.sh       creates the vault-bootstrap policy and
                                    kubernetes auth role, and proves the
                                    ServiceAccount can log in from inside the
                                    cluster. Needed again after any Vault
                                    re-initialisation.
  resume-mail-provisioner.sh        resumes apps-mail and verifies the
                                    provisioning sidecar, re-suspending and
                                    rolling back on any failed check.
  flip-flux-source-to-org.sh        points the Flux source at the organisation
                                    repository with GitHub App auth.
  flip-flux-source-to-monorepo.sh   the matching rollback, including the
                                    spec.provider removal that a plain apply
                                    does not undo.
  post-cutover-fixups.sh            writes the Discord webhook and mints the
                                    Vault metrics token.

Renamed to the kebab-case the directory already uses, and the cross-reference
between the two flip scripts follows the rename.

flip-flux-source-to-monorepo.sh derived the monorepo path from a hardcoded
absolute path under one user's home directory. Now that it lives in the tree it
derives the root from its own location instead, verified to resolve correctly
when invoked by relative path, by absolute path, and from an unrelated working
directory.

flip-flux-source-to-org.sh runs under `set -uo pipefail` with no `-e`, so its
unguarded `cd "$WORK"` would have continued into the wrong tree had the cd
failed. It now dies instead.

Not included: tmp.sh contains a live Discord webhook URL and is scratch rather
than a procedure; tmp.js, tpm.sh and tmp.sh.bak-qbt are one-off fragments; and
unseal-vault.sh was not part of this work.
@ExtraToast ExtraToast added the ci CI pipeline / Pipeline Complete label Aug 26, 2026
@ExtraToast ExtraToast self-assigned this Aug 26, 2026
@ExtraToast
ExtraToast merged commit 3776942 into main Aug 26, 2026
30 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ci CI pipeline / Pipeline Complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant