Task: Remove controller from db recreate required-vars check

Table of Contents

This page documents a task in the Collapse NATS config passthrough to a single environment-mapper fallback tier story. It captures the goal, current status, acceptance, and any notes or results.

Goal

Stop compass db recreate from demanding DB credentials for the decommissioned ores.controller service, so a fresh environment initialised by compass env configure can recreate its database without hand-editing .env.

Status

Field Value
State DONE
Parent story Collapse NATS config passthrough to a single environment-mapper fallback tier
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-08-05

Acceptance

  • compass db recreate -y -k succeeds on a fresh .env generated by compass env configure --preset <preset> -y, with no ORES_CONTROLLER_SERVICE_DB_USER / ORES_CONTROLLER_SERVICE_DB_PASSWORD present in .env.
  • The controller entry no longer appears in SERVICE_NAMES (the source that feeds compass_db.py cmd_recreate's required-vars loop — projects/ores.sql/service_vars.sh and its generator, likely the service registry codegen model), or decommissioned services are otherwise excluded from the loop.
  • ORES_CONTROLLER_SERVICE_HTTP_PORT / ORES_CONTROLLER_SERVICE_WT_PORT are left untouched: they are still read by systemd_generate.py's {wt_port} substitution, and their rename is covered by the sibling task "Rename still-functionally-used ORES_CONTROLLER_SERVICE_* env vars".

Plan

(Implementation strategy. Written when work starts; key decisions are distilled into the parent story's * Decisions at close, but the plan itself stays — it is the historical record of what we did.)

Notes

Test Scenarios

Manual QA scenarios (scaffolded via compass add test_scenario, run through the QA Validation Runner panel) that verify this task. Link new ones here as they're created; the scenario doc itself links back via its "Verifies task" field.

Scenario State Notes
     

PRs

PR Title
#1867 [sql] Remove decommissioned controller from db recreate pipeline

Review

# Comment summary File Decision Notes
1 Orphaned \set controller_service_pw left in generated file projects/ores.sql/populate/iam/iam_service_accounts_populate.sql:59 Fixed Regenerated the file from the service registry model via ores.codegen (ores.sql.service address); the generator drops the line. Grants file deliberately NOT regenerated: it carries hand-added cross-service grants (Acme provisioner logo access, refdata party image soft-FK) that the generator does not emit — regeneration would lose them.

Result

Shipped in commit 0863b91af, raised as a PR from feature/remove-controller-from-recreate-required-vars and merged to main:

  • Regenerated projects/ores.sql/service_vars.sh from the service registry model — controller was already absent from the model, so regeneration alone removed it from SERVICE_NAMES; the file was a stale generated artefact.
  • Removed the controller service user block from service_users_create.sql, the controller entries from iam_service_db_grants_create.sql (grant lists + DML grant block), and the controller service account / role assignment from the IAM populate files — all referenced the :'controller_service_user' psql variables that compass db recreate no longer passes.

All acceptance criteria met, verified on festive_dijkstra: compass db recreate -y -k completes all three phases on a fresh .env with no controller credentials present (1m 58s); local build clean (linux-clang-debug-make), ctest 71/71 passed.

Out of scope, left for the sibling decommission task: the ores_controller_service_*_tbl tables, RLS policies, ControllerService IAM role/permissions rows, and the ORES_CONTROLLER_SERVICE_{HTTP,WT}_PORT env vars (covered by the rename task).

Emacs 29.3 (Org mode 9.6.15)