ci: add isolated backend-only P05 runtime acceptance

This commit is contained in:
Vib Tools committed 2026-11-22 05:47:38 -08:00
1 parent 4857558005
commit 03fb58954d
22 files changed
+370 -27

No files matched your search

+1
View File
@@ -11,5 +11,6 @@ This is the chronological **index**. Phase-specific scope/implementation evidenc
| 2026-11-22 | DOCS-01 | Knowledge folders, first-party file/function maps, exact source inventory, user guides and mandatory AGENTS documentation policy | Documentation implementation complete; focused manifest/link/scope audit PASS; Git SHA in DOCS-01 local commit, see [DOCS-01.md](DOCS-01.md) |
| 2026-11-22 | P05-CI-01 | Gitea verification workflow, dependency lock reconciliation, narrow checkout remediation | Run #81: 2 PASS/2 FAIL; 1219 Login tests PASS, Account TS2345 and Docker checkout blocked; see [P05-CI-01.md](P05-CI-01.md) |
| 2026-11-22 | P05-CI-02 | Narrow Auth.js TS2345 fix, CI negative tests, advisory triage and post-run portless override | Run #83: Account/Login/Security PASS, Docker FAIL on host 8080; cleanup PASS; portless override unverified. [Evidence](P05-CI-02.md) |
| 2026-11-22 | P05-CI-03 | Backend-only Gitea CI workflow and disposable portless/persistence/OIDC acceptance scripts | Source preparation; one CI run pending, [scope/evidence](P05-CI-03.md) |
Rules: Append new phases or fixes; never silently rewrite a past result. Separate **implemented**, **verified**, **blocked**, and **proposed**. Never log a user secret or personal data.
+1
View File
@@ -7,6 +7,7 @@
| [DOCS-01.md](DOCS-01.md) | This documentation-governance change: baseline, scope, plan, implementation and closure | DOCS-01 / implementation complete |
| [P05-CI-01.md](P05-CI-01.md) | Scope/roots, allowed paths, implementation and Gitea CI acceptance evidence | P05-CI-01 / source complete, CI blockers open |
| [P05-CI-02.md](P05-CI-02.md) | Auth.js narrow patch, isolated Gitea CI gate, advisory triage and exact acceptance evidence | P05-CI-02 / run #83 completed; residual Docker gate blocked |
| [P05-CI-03.md](P05-CI-03.md) | Backend-only pre-change scope, disposable CI run evidence and exact acceptance result | P05-CI-03 / planned, run pending |
| [CHANGELOG.md](CHANGELOG.md) | Short append-only chronological phase log and links to detailed reports | DOCS-01 / active |
Update this manifest whenever any direct child file or directory changes. Use **actual source state**; a planned file must be labeled planned, not present.
+35
View File
@@ -0,0 +1,35 @@
# ZitPlane P05-CI-03 — Backend Runtime Final Acceptance
**Date:** 2026-11-22
**Status:** APPROVED — PRE-CHANGE PLAN (CI not started)
**Baseline / Gitea main:** `485755800504a7dea6e4c303e6b39ec9cc610b54`
**Prior CI:** [Run #83](https://dev.ivib.cc/vibtools/ZitPlane/actions/runs/83), tested `c27fe3d`; three jobs PASS (Account Portal, Login V2 including 1219 unit tests, High/Critical security gate), backend FAIL when proxy attempted to publish occupied host port 8080.
## Exact scope lock
**Allowed writes:** optional **new** `.gitea/workflows/p05-backend-acceptance.yml`; narrow `.gitea/workflows/p05-ci.yml` if justified; focused `tests/ci/**` (including `compose.portless.override.yaml`, `oidc_discovery.py`, README/MINIFEST), `.gitea/**/README.md` and `MINIFEST.md`; `notes/**`, `project/**`, related `docs/**`, root `README.md`/`MINIFEST.md` only as necessary.
**Strict read-only:** `core/backend/zitadel/**`, `deployment/docker/compose.backend.dev.yaml`, `auth/ui/v2/**`, `users/ui/**`, manifest/lockfiles, current UI/auth/session logic, production configuration and unrelated files. Existing untracked `AI_INSTRUCTIONS.md` must remain untouched.
**Execution:** one focused **backend-only** isolated Gitea Actions CI run after source commit/push; **no local tests/builds/dev servers/Docker**, no re-run of accepted Account/Login unit suites; no production deployment, release or real users/secrets.
## Verified pre-change root cause and constraints
1. Run #83 backend #174: Git Alpine pre-checkout and Docker daemon preflight PASS; P02 Python stdlib unit 3/3 PASS; PostgreSQL, official ZITADEL API v4.20.4, prebuilt Login v4.20.4 healthy. Traefik failed before health/discovery: `port 8080 is already allocated`. Always-cleanup removed CI-owned containers, volumes and network.
2. Post-run `tests/ci/compose.portless.override.yaml` uses Docker Compose supported `ports: !reset []` on `proxy`; P05-CI-02 inserted it on all 10 Compose references with effective-config `proxy.ports` guard. **This override has never been executed in CI**.
3. P02 developer Compose has fixed `zitplane-backend-dev-internal` network and local-only `127.0.0.1:8080:80` port. The CI must refuse any existing fixed network or competing project; never touch shared Docker stacks. CI-specific override must remove host port entirely.
4. Existing `tests/ci/oidc_discovery.py` checks synthetic rejection cases plus real `/debug/ready`, issuer/origin discovery, JWKS (nonempty key list) through internal Docker network and host `localhost:8080`. No real login, Admin Console, MFA or callback E2E acceptance is possible in this phase.
## Implementation plan (prior to source changes)
A. Add **backend-only manual** `.gitea/workflows/p05-backend-acceptance.yml` to avoid repeated Account/Login/Security jobs; use existing verified Alpine Git checkout prerequisite and Docker CLI capability preflight, previous P02 focused backend helper tests, guarded fixed network/project name, and P05 portless Compose overlay. Hard-fail before starting containers unless resulting proxy has no host ports.
B. Run disposable Compose `up -d --wait`; verify all four containers (`postgres`, `zitadel-api`, `zitadel-login`, `proxy`) are present and healthy/running as appropriate. Write a synthetic marker into the disposable Postgres default `postgres` DB, restart database, wait for health and confirm marker persists; probe readiness, exact local issuer metadata and public JWKS from an ephemeral probe container attached to the *new CI-owned network*.
C. Always tear down **only the run's Compose project/volumes**, delete generated local credentials; verify no run-owned containers, volumes or fixed network remain. If failure/cleanup incomplete, report exact blocker, never claim PASS.
D. Update manifest/README, `project/` function/file/CI history and `docs/` operator status. Audit exact staged paths/secrets. Commit and push source to Gitea main, dispatch **one** backend-only run, capture its actual terminal job logs.
E. Document exact CI SHA, PASS/FAIL/BLOCKED, remedy/outstanding risks and acceptance; do one final documentation-only commit/push with exact remote SHA. No rerun even if a focused defect is found. After closure provide next precise Scope Lock, concise implementation plan, and copy-ready approval.
## Acceptance definitions
Backend PASS only if effective Docker config is portless, four services reach the intended state, Postgres restart retains synthetic marker, real local ZITADEL ready + OIDC discovery + JWKS and negative test cases all PASS, and CI-owned network/volumes/container cleanup verified. Else mark FAILED/BLOCKED and preserve real source/log evidence.
**Not in scope:** real OIDC authorized login/callback, Admin Console human login, MFA/SSO, dependency Moderate fixes (18 Login + 1 Account package), UI redesign or production TLS/Coolify.