feat(deploy): add release manifest with pinned base image digests

This commit is contained in:
shira committed 2026-10-06 15:43:03 +03:00
1 parent ea0982a762
commit a0551a34b8
18 files changed
+2316 -21

No files matched your search

+15 -1
View File
@@ -25,7 +25,7 @@ Useful focused commands:
| make -C ml check | Ruff, mypy, pytest, and wheel build |
| make -C ml check-generated | Pydantic models match the ML bundle without rewriting files |
| make -C deploy config | Render Compose configurations without starting them |
| make -C deploy check | Render Compose configurations and run `check-workflows`, which fails when a workflow `aggregate` job does not need every other job or lacks `if: always()` |
| make -C deploy check | Render Compose configurations and run `check-workflows`, which fails when a workflow `aggregate` job does not need every other job or lacks `if: always()`, and `check-release`; see [Release manifest tests](#release-manifest-tests) |
| make -C deploy smoke | Isolated technical smoke of service health routes |
| make -C deploy test-e2e | Playwright browser suite against an isolated throwaway stack |
| make -C observability check | Validate Prometheus, Loki, Alloy, and dashboard JSON |
@@ -60,6 +60,20 @@ The current suite (`frontend/e2e/smoke.spec.ts`) checks that the SPA serves `/`
The suite does not cover candidate or employer workflows, sign-in, mail delivery, dependency failures (deployment smoke covers those), browsers other than desktop Chromium, layout, or accessibility. CI runs the suite in the `e2e` job after `backend`, `frontend`, and `infrastructure` pass: `make -C frontend install`, then `make -C deploy test-e2e`. The job needs no repository secrets or root `.env`; each run uses its own generated env file and fresh stand. On failure CI uploads the `e2e-diagnostics-attempt-<n>` artifact with `report/`, `results/` (traces and screenshots), and `stand.log` for 14 days. Hidden files and the env file are not uploaded. The `e2e` result is part of the required aggregate.
## Release manifest tests
`make -C deploy check-release` runs `deploy/scripts/test_release_manifest.py` with the Python standard library and without Docker. It fails when go.mod, the `GO_IMAGE` default, and `GOTOOLCHAIN=local` in backend/Dockerfile stop pinning Go 1.26.8, or when a service Dockerfile uses a base image that is not a pinnable `*_IMAGE` build argument, including an external image in `COPY --from` or `RUN --mount=from`. On fake image, Compose, and container data it checks that:
- the manifest copies no environment values, labels, or local paths, and two generations differ only in `generated_at`;
- evidence counts only for the same tag, commit, and working tree fingerprint, and malformed evidence or build records are not used;
- a component is `verified` only with evidence for its exact image ID, ML, monitoring, and missing components are never verified, and the release stays unverified without both smoke and E2E on the current images, on a dirty tree, with a core pulled image without a registry digest, a missing lockfile or Dockerfile, another Go version in the binary, or another Node version in the build image;
- `release-build` refuses to write the build record when the commit or the working tree changes during the build;
- the working tree fingerprint of a temporary Git repository ignores diff and line ending settings, covers untracked files, skips ignored ones, and leaves the real index unchanged;
- the secret scan finds key blocks, tokens, credentials in URLs, local paths, user and host names, and values of secret-like variables, also as substrings and in base64, without echoing them;
- the running-container comparison reports a different digest, a missing service, and an unknown service.
The test does not build images or start containers. The end-to-end path is `release-build`, `release-smoke` and `release-e2e`, `release-manifest`, `release-up`, `release-manifest-verify`, and `release-manifest-check`; see [DEPLOY.md](DEPLOY.md#release-manifest).
## Integration test bootstrap
The shared helper lives in `backend/integration_test/bootstrap_test.go`. Calling `env := bootstrap(t)` starts PostgreSQL, Redis, and SeaweedFS, waits for adapter readiness, and returns an environment with configuration and clients. To test one adapter, use `bootstrap(t, postgresService)`, `bootstrap(t, redisService)`, or `bootstrap(t, seaweedfsService)`. Multiple services can be selected.