Skip to content

Make DB-skip silence loud, and match CI's Postgres locally - #532

Merged
TheGreatAxios merged 6 commits into
mainfrom
cl-7279-local-ci-parity
Aug 31, 2026
Merged

TheGreatAxios merged 6 commits into
mainfrom
cl-7279-local-ci-parity

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

First two items of CL-7279 (a red CI check should be locally reproducible/diagnosable):

  • docker-compose.test.yml: mirrors the walking-skeleton/e2e/isolation/db-suites jobs' services.postgres block in .github/workflows/ci.yml exactly — pgvector/pgvector:pg17, POSTGRES_USER=postgres/POSTGRES_PASSWORD=postgres, same pg_isready healthcheck. docker compose -f docker-compose.test.yml up -d gives a local DB-gated run the same Postgres CI uses instead of a hand-rolled substitute.
  • scripts/e2e/db-gate.ts (dbGate): every describeIfDb in the repo hand-rolled its own DATABASE_URL check, so a missing database skipped a suite in total silence — a run reported green whether the suite passed or never ran. That hid a real migration-list bug in PR Close the GitHub connect grant/webhook-trigger duplication race #508 for hours. dbGate centralizes the check: it still skips quietly by default, but prints an unmissable summary naming every skipped suite, and honors E2E_REQUIRED=1 (already CI's convention for the e2e suite) by throwing instead of skipping. CI already sets E2E_REQUIRED=1 on its e2e/isolation/db-suites jobs, so those skips are now hard failures there with no workflow change needed.
  • check:db-gate: nine PRs merged to main while this branch was in flight, adding 9 more hand-rolled describeIfDb copies (plus one pre-existing one the original sweep missed) — proof a one-time sweep doesn't hold. All are repointed at dbGate. check:db-gate (wired into the structural job) now fails CI on any new hand-rolled describeIfDb ternary outside scripts/e2e/db-gate.ts, so the invariant is enforced rather than swept once.

vendor/intx/hub-api/src/middleware/workflow-run-deploy-auth.test.ts (and the two vendor/intx/db files) are deliberately left hand-rolled — editing inside a vendored tree carries re-pin tax, so check:db-gate only scans apps/, packages/, and scripts/.

Out of scope for this PR (rest of CL-7279): the bun run ci mega-command, stale-base detection, thinning check:structural, and the e2e tiering split (CL-7259).

Test plan

  • bun run typecheck
  • bunx prettier --check .
  • bun run check:structural sub-checks (all but check:report-error, which fails on main already and isn't wired into CI), including the new check:db-gate
  • No DATABASE_URL: bun test packages/inbox/test/snooze-store.test.ts packages/migration-runner/test/migration-runner.test.ts prints the loud skip summary and exits 0
  • E2E_REQUIRED=1 with no DATABASE_URL: a converted suite throws and exits non-zero
  • docker compose -f docker-compose.test.yml up -d then a DB-gated suite passes for real against it

Covers: a configured DATABASE_URL returns describe; an absent one
returns describe.skip; E2E_REQUIRED=1 turns the skip into a throw
naming the suite, and stops doing so once a database is configured.
describeIfDb across the repo hand-rolled its own DATABASE_URL check,
so a locally-missing database skipped every DB-gated suite in total
silence — a run reported green whether the suites passed or never ran
at all. That hid a real migration-list bug in PR #508 for hours.

dbGate centralizes the check: it still skips quietly by default, but
prints an unmissable summary naming every skipped suite, and honors
E2E_REQUIRED=1 (already CI's convention for the e2e suite) by throwing
instead of skipping. Every describeIfDb definition now goes through it.

docker-compose.test.yml mirrors the walking-skeleton job's postgres
service in ci.yml exactly (pgvector/pgvector:pg17, postgres/postgres,
same healthcheck), so a local DB-gated run uses the same database CI
does instead of a hand-rolled substitute.
Points developers at docker-compose.test.yml for a Postgres matching
CI, and documents dbGate's skip summary and E2E_REQUIRED for the
package/hub DB-gated suites alongside the existing e2e docs.
Covers: a hand-rolled describeIfDb ternary (both the undefined and ""
variants) is a violation naming the file; a suite already routed
through dbGate, or with no DB gate at all, passes.
Nine PRs merged since the first CL-7279 sweep, adding 9 more (10
counting a pre-existing one the original grep missed) files that
still hand-rolled their own describeIfDb ternary instead of going
through dbGate — proving a one-time sweep doesn't hold. Repointed all
of them at dbGate; vendor/intx/hub-api's copy is left alone, since
editing inside a vendored tree carries re-pin tax.

check:db-gate makes the invariant self-enforcing: it fails on any
`databaseUrl === undefined/"" ? describe.skip : describe` ternary
outside scripts/e2e/db-gate.ts itself, in the same structural job the
other checks already run in.
@TheGreatAxios
TheGreatAxios force-pushed the cl-7279-local-ci-parity branch from 85e9862 to 64d6c58 Compare August 31, 2026 04:05
@TheGreatAxios
TheGreatAxios merged commit e4a7937 into main Aug 31, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant