4.7 KiB
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, 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
- 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. - Post-run
tests/ci/compose.portless.override.yamluses Docker Compose supportedports: !reset []onproxy; P05-CI-02 inserted it on all 10 Compose references with effective-configproxy.portsguard. This override has never been executed in CI. - P02 developer Compose has fixed
zitplane-backend-dev-internalnetwork and local-only127.0.0.1:8080:80port. The CI must refuse any existing fixed network or competing project; never touch shared Docker stacks. CI-specific override must remove host port entirely. - Existing
tests/ci/oidc_discovery.pychecks synthetic rejection cases plus real/debug/ready, issuer/origin discovery, JWKS (nonempty key list) through internal Docker network and hostlocalhost: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.