Files
corp-v1-channel-uat/references/journey-repository-contract.md

57 lines
3.4 KiB
Markdown

# Journey repository contract
The UAT repository is a standalone pnpm/Playwright project and the authoritative home for functional non-unit tests. It may contain source-coupled integration, browser, database-backed, performance, acceptance, and deployed-environment suites. It contains no application implementation, image/container publication validation, Helm installation/rendering, deployable Kubernetes/Helm desired state, image publication, Argo CD mutation, or deployment logic.
## Required baseline
```text
applications/functional/
packages/journeys/
packages/testing/
packages/evidence/
artifacts/.gitkeep
package.json
pnpm-lock.yaml
pnpm-workspace.yaml
Taskfile.yml
.gitea/workflows/change-validation.yaml
.gitea/workflows/integrated-regression.yaml
```
A smaller standalone repository may keep `journeys/`, `fixtures/`, `helpers/`, and `playwright.config.ts` at the root. The responsibility boundaries and two-workflow contract remain the same.
## Journey rules
- Stable journey IDs appear in test titles and evidence.
- `UAT_BASE_URL` is required; no production-looking default is embedded.
- Authentication is loaded from runtime secrets and never persisted in committed storage-state files.
- Retries are explicit and low; a retry cannot turn a flaky first failure into an undisclosed pass.
- Failure evidence includes trace and screenshot; video is opt-in when data handling permits it.
- Taskfile is the human and automation interface and delegates to package scripts.
- The README documents local execution, evidence locations, environment-variable names, failure classification, and workflow behavior.
## Gitea Actions contract
```text
non-default branch push
└── CI / Change Validation
├── formatting, linting, type checks, contract tests, journey discovery, build when applicable
└── smoke journeys for explicit PR events or exact review-associated commits
PR opened or reopened
└── CI / Change Validation
├── the same repository validation
└── smoke journeys
push to test after merge
└── UAT / Integrated Regression
├── exact integrated-commit validation
├── smoke journeys
├── complete regression journeys
└── structured regression evidence upload
```
Use one change workflow rather than separate branch and PR workflow files. It subscribes to non-default `push` plus `pull_request` `opened` and `reopened`, but not `synchronize`; later branch pushes are the single trigger. The classification job compares the exact commit with Gitea pull-request head refs without exposing a broad API token to candidate-controlled code. Because Gitea retains those refs after closure, an unchanged closed-PR head may conservatively receive smoke again; a new branch-only commit receives repository validation only. Cancel superseded change runs for the same branch and expose one required aggregate result.
The integrated workflow runs only on `push` to `test` and queues instead of cancelling older integrated commits. It requires an explicit non-production base URL and runtime-only authentication when the regression set requires it. Its artifacts are integrated regression evidence, not a release-facing UAT verdict. `UAT_PASSED` additionally requires the project UAT procedure to verify the immutable Delivery deployment tuple live before and after the run. Smoke is not complete UAT, and full regression does not run on a PR.