feat(e2e): /e2e-bootstrapped readiness endpoint + skip-when-unseeded gate (BUNYIP-163) #203
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/BUNYIP-163-e2e-bootstrapped-gate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Adds a
GET /e2e-bootstrappedreadiness endpoint to bunyip-api and an e2e.yml gate that skips the suite (job still succeeds) when staging is not seeded - soe2ecan be a REQUIRED check onmainwithout a merge lockout (BUNYIP-163, BUNYIP-148 sub-task).Why
The suite logs in as the seeded accounts (
e2e-user@a8n.run/e2e-admin@a8n.run). If staging is not bootstrapped (fresh DB,just e2e-bootstrap --cleanup, a reset), every run fails at login. Makinge2erequired would then block every PR - including the one that fixes bootstrapping. Same shape as the known deploy-gate deadlock.How
GET /e2e-bootstrappedat the deployment root (alongside/health,/version) ->{ "bootstrapped": bool }, true iff both seeded accounts exist withdeleted_at IS NULL, via one indexedCOUNT(*) ... WHERE email = ANY($1)(UserRepository::count_active_by_emails). Unauthenticated + information-minimal. Returnsfalseon a productionENVIRONMENTwithout querying, so it never probes prod user rows.bunyip_api::E2E_ACCOUNT_EMAILS, used by both the bootstrap binary and the endpoint - the probe can't drift from what's seeded.scripts/check-bootstrapped.mjsprobes the endpoint, writesbootstrappedto$GITHUB_OUTPUT, and fail-opens (any error ->false, exit 0). e2e.yml runs it after the reachability gate and gates the suite onbootstrapped == 'true'(OR a production dispatch, which is reachability-only and always reports false). When unseeded: suite skipped with a clear log line, job succeeds.dev-docs/e2e.mddocuments the endpoint, the skip, and thate2ecan now be required.Manual follow-up (yours, out of code scope)
The final AC - add
e2etomain's required status checks - is a Forgejo branch-protection setting, not code. Flip it once this lands; the skip-and-pass behavior makes it safe.Verification
cargo clippy --workspace --all-targets -D warnings+fmt --all --checkclean;node --check+ YAML parse clean.🤖 Generated with Claude Code