Repository navigation
Align test and staging databases with their Terraform stacks (#172 follow-up) - #217
amar-python wants to merge 1 commit into
Conversation
…llow-up) infra/terraform-test and infra/terraform-staging create te_test and te_staging for server admin pgadmin, while the deployer built te_mgmt_test and te_mgmt_staging owned by postgres: the same three-way disagreement #172 fixed for prod. They are code only (#31), so nothing was deployed; this lands before #31 resumes. - env_test/env_staging.example.sql: db_name te_test/te_staging, db_owner pgadmin. deploy_all.sh already reads both from the launcher. - infra/terraform-test, -staging: Key Vault secret and job wiring for APP_USER_PASSWORD, as for prod (entrypoint.sh refuses to deploy without it). - CI creates te_test, te_staging and te_prod owned by pgadmin, dev by postgres. - Consumers of the old names follow: evals Tier E, parity and env tests, run_tests.sh, config examples, provisioning script, README, docs. - tests/test_prod_db_naming.py becomes tests/test_azure_db_naming.py and its static checks run for prod, test and staging, so one test covers every stack. Dev stays te_mgmt_dev / postgres and is pinned as unchanged. - Decision record extended. Stacked on #172: it needs the launcher-driven deployer and the runtime launcher generation from that change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011T6WqjTEDRRQGLEYPPFVXx
|
Closing: this was stacked on #211, which is closed in favour of #213. The branch Renaming test and staging to What is still worth doing, on top of #213 once it merges: Closed by Claude at the owner's request. Generated by Claude Code |
Follow-up to #172. Stacked on #211: this PR's base is that branch, not
main. It needs #211's launcher-driven deployer and runtime launcher generation, so it cannot sit onmainalone. Merge #211 first; GitHub then retargets this PR tomain, and its diff is just the commit shown here.What
infra/terraform-testandinfra/terraform-stagingalready createte_testandte_stagingfor server adminpgadmin, but the deployer builtte_mgmt_testandte_mgmt_stagingowned bypostgres: the same three-way disagreement #172 fixed for prod. Those stacks are code only (#31), so nothing is deployed and nothing is broken. This lands before #31 resumes, as recommended.The names are now
te_<env>, owned bypgadmin, for prod, test and staging. Dev stayste_mgmt_devowned bypostgres: it is local-only and has no stack.te_mgmt_test/postgreste_test/pgadminte_mgmt_staging/postgreste_staging/pgadminte_prod/pgadminte_mgmt_dev/postgresenv_test.example.sqlandenv_staging.example.sqlchangedb_nameanddb_owner.deploy_all.shalready reads both from the launcher, so no code change was needed there.APP_USER_PASSWORDKey Vault secret and job wiring that RV-S1: align Terraform, deployer and entrypoint on the prod database (#172) #211 added for prod. Without it the entrypoint refuses to deploy, so a first run in either stack would fail.te_test,te_stagingandte_prodowned bypgadmin, and dev owned bypostgres.test_parity, the per-environment tests,run_tests.sh, config examples, the provisioning script, README and docs.tests/test_prod_db_naming.pyis renamedtests/test_azure_db_naming.pyand its static checks now run for all three Azure environments, so one test guards every stack. It also pins dev as unchanged and checks each job is given the app-role password.Verification
The new checks bite. With only the test/staging launchers and Terraform reverted to #211's versions, the test and staging subtests of
test_each_launcher_names_the_canonical_database_and_owner,test_terraform_admin_is_the_launchers_ownerandtest_terraform_creates_the_same_databasefail; prod's subtests still pass. With this change all 15 pass.Clean image, fresh server (same method as #211: tree from
git archiveof the commit,/opt/migrationlayout, run as uid 1001, brand-new PostgreSQL 16 whose only role ispgadmin,scram-sha-256, database pre-created bypgadminas Terraform does):terraform validatepasses on all three stacks (terraform-prod,-test,-staging; Terraform 1.9.8).terraform planwas not run: it needs Azure credentials.CI replica, on a live PostgreSQL 16 with the databases created by the workflow's own step:
Please read
terraform plan/applyand any real Azure deploy; a realdocker build/run.te_mgmt_testorte_mgmt_stagingdatabases will get new emptyte_test/te_stagingones on the next deploy and keep the old ones. Localbuild/config.local.envis gitignored and is not updated: changePG_DB_TESTandPG_DB_STAGINGto the new names, or re-runbuild/setup.sh. Nothing is dropped automatically.docs/HANDOFF-20261104.mdstill lists the old names. It is a dated hand-off record, so I left it as written.Generated by Claude Code