Make DB-skip silence loud, and match CI's Postgres locally - #532
Merged
Merged
Conversation
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
force-pushed
the
cl-7279-local-ci-parity
branch
from
August 31, 2026 04:05
85e9862 to
64d6c58
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First two items of CL-7279 (a red CI check should be locally reproducible/diagnosable):
docker-compose.test.yml: mirrors thewalking-skeleton/e2e/isolation/db-suitesjobs'services.postgresblock in.github/workflows/ci.ymlexactly —pgvector/pgvector:pg17,POSTGRES_USER=postgres/POSTGRES_PASSWORD=postgres, samepg_isreadyhealthcheck.docker compose -f docker-compose.test.yml up -dgives a local DB-gated run the same Postgres CI uses instead of a hand-rolled substitute.scripts/e2e/db-gate.ts(dbGate): everydescribeIfDbin the repo hand-rolled its ownDATABASE_URLcheck, 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.dbGatecentralizes the check: it still skips quietly by default, but prints an unmissable summary naming every skipped suite, and honorsE2E_REQUIRED=1(already CI's convention for the e2e suite) by throwing instead of skipping. CI already setsE2E_REQUIRED=1on itse2e/isolation/db-suitesjobs, so those skips are now hard failures there with no workflow change needed.check:db-gate: nine PRs merged tomainwhile this branch was in flight, adding 9 more hand-rolleddescribeIfDbcopies (plus one pre-existing one the original sweep missed) — proof a one-time sweep doesn't hold. All are repointed atdbGate.check:db-gate(wired into thestructuraljob) now fails CI on any new hand-rolleddescribeIfDbternary outsidescripts/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 twovendor/intx/dbfiles) are deliberately left hand-rolled — editing inside a vendored tree carries re-pin tax, socheck:db-gateonly scansapps/,packages/, andscripts/.Out of scope for this PR (rest of CL-7279): the
bun run cimega-command, stale-base detection, thinningcheck:structural, and the e2e tiering split (CL-7259).Test plan
bun run typecheckbunx prettier --check .bun run check:structuralsub-checks (all butcheck:report-error, which fails on main already and isn't wired into CI), including the newcheck:db-gateDATABASE_URL:bun test packages/inbox/test/snooze-store.test.ts packages/migration-runner/test/migration-runner.test.tsprints the loud skip summary and exits 0E2E_REQUIRED=1with noDATABASE_URL: a converted suite throws and exits non-zerodocker compose -f docker-compose.test.yml up -dthen a DB-gated suite passes for real against it