Skip to content

fix(infra): wire tracker-api → real Core + MasterDataDb on local kind#74

Merged
beyondnetPeru merged 4 commits into
mainfrom
fix/local-kind-core-wiring
Jul 13, 2026
Merged

fix(infra): wire tracker-api → real Core + MasterDataDb on local kind#74
beyondnetPeru merged 4 commits into
mainfrom
fix/local-kind-core-wiring

Conversation

@beyondnetPeru

Copy link
Copy Markdown
Contributor

Qué

Cablea el chart evolith-tracker-api para que, en el cluster kind local, el BFF del Tracker gobierne contra el Core real (no los stubs por defecto) y arranque sin crashloop.

Cambios (solo Helm, 2 archivos)

  • values-local.yaml
    • coreApi.baseUrlhttp://evolith-core-api-evolith-core-api.evolith-local.svc.cluster.local/api/v1 (Core real cross-namespace vía FQDN) + existingSecretName: tracker-core-auth (API key requerida, 401 sin ella).
    • agentRuntime.baseUrl → servicio real del agent-runtime en evolith-local + existingSecretName: tracker-runtime-auth.
  • templates/deployment.yaml
    • Añade ConnectionStrings__MasterDataDb (mismo secret -db). Sin esto, TenantProjectionMigrator (DS-07) cae a localhost:5432 y hace crashloop. En local broker-less comparte el Postgres del Tracker; una BD dedicada es una preocupación de prod.

Evidencia (Objetivo 1 end-to-end en kind)

Con estos valores, la cadena quedó verificada:
POST /api/core/evaluate (Tracker BFF) → POST core-api /api/v1/evaluate real (200 ALLOW, SecurityAudit, desde IP del pod Tracker) → CoreEvaluationTransaction (status=completed) persistida en tracker_governance.core_evaluation_transactions.

Alcance / notas

  • Solo values-local.yaml (overrides de kind) — no toca defaults de prod.
  • Deliberadamente NO incluye un cambio de app sin commitear presente en el árbol de trabajo (un TrackerDbMigrator hosted-service + su registro en DependencyInjection.cs) que no forma parte de este fix de infra.

🤖 Generated with Claude Code

beyondnetPeru and others added 4 commits July 13, 2026 11:08
Deploying the Tracker onto the same kind cluster as the Evolith Core, wired to the
REAL stateless Core (not the default stub), verified end-to-end.

- values-local: coreApi/agentRuntime baseUrl → the real in-cluster services in the
  evolith-local namespace (cross-namespace FQDN); existingSecretName supplies the API
  key the Core requires (401 otherwise).
- deployment: wire ConnectionStrings__MasterDataDb (the tenant-projection context, DS-07).
  It was unset, so TenantProjectionMigrator defaulted to localhost:5432 and crashlooped;
  now it shares the local Tracker Postgres (a dedicated DB is a prod concern).

Verified on kind: POST /api/core/evaluate → real POST core-api /api/v1/evaluate
(SecurityAudit 200 ALLOW, from the tracker pod) → CoreEvaluationTransaction persisted
(status=completed) in tracker_governance.core_evaluation_transactions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…isting break)

DS-07 introduced a second DbContext (TenantProjectionDbContext for the
MasterData tenant-projection schema) alongside TrackerDbContext, but the
'Apply EF Core migrations' step still ran 'dotnet ef database update' with no
--context. dotnet-ef aborts with 'More than one DbContext was found', which
was red on main for every PR. Apply each context explicitly against the CI DB.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…text

After disambiguating the EF migrate step, TenantProjectionDbContext (DS-07)
failed with 28P01 auth against user 'postgres' because ConnectionStrings__MasterDataDb
was unset and defaulted to localhost/postgres. Point it at the same CI Postgres
(as DefaultConnection) — the CI analog of the local-kind Helm wiring in this PR.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ets CI DB

Setting ConnectionStrings__MasterDataDb env was insufficient: at design time
GetConnectionString("MasterDataDb") still resolves null and the context falls
back to localhost/postgres (28P01). Pass --connection explicitly to dotnet ef so
both contexts apply against the CI Postgres deterministically.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@beyondnetPeru beyondnetPeru merged commit f216814 into main Jul 13, 2026
3 checks passed
@beyondnetPeru beyondnetPeru deleted the fix/local-kind-core-wiring branch July 13, 2026 16:37
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