Skip to content

ci: run the real-Postgres integration suite in CI - #3988

Merged
yannickmonney merged 7 commits into
mainfrom
ci/backend-integration
Sep 30, 2026
Merged

yannickmonney merged 7 commits into
mainfrom
ci/backend-integration

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The real-Postgres proofs (backend:integration) ran only by hand, so a regression in them failed no gate. This adds a Backend integration job to Checks. It runs the whole suite with ITEST_REQUIRE_ALL_LANES=1 (#3981) against two things:

  • tale-db, built from the commit's own services/db;
  • the object store the CLI pins.

It also updates every doc that called the suite hand-run.

Part of TALE-382, on top of #3981 (every lane must run and pass) and #3980 (the comment-burst lane's product fix), both on main and merged into this branch.

Proof

Head Change Checks run Backend integration
e2087fd00 the job, before #3980 36697957136 green: 1191/1191 checks passed across 204/204 lanes
a407682a6 review fixes + a deliberate regression of the RAG watchdog's stuck-first order (#3803) 36701485061 (job 109848988669) red: 1186/1191 checks passed across 204/204 lanes; checkRagWatchdogBatch fails with a stale running row is failed in one tick behind 201 settled failures queued before it — stuck=running (want failed) and its held-row-lock check, and the three status-hint checks that wait on the watchdog fail with it (Unit's watchdogs.test.ts SQL pin fails too)
e0d884dcb git revert of that regression 36705826143 (job 109864289118) green: 1191/1191 checks passed across 204/204 lanes, with #3980 on the base
af4d394b1 the same regression again, left until the job finished 36711567271 (job 109879495032) red: 1186/1191 checks passed across 204/204 lanes; the rag watchdog lane fails (a stale running row is failed in one tick behind 201 settled failures)
99594a655 git revert of it; the head to merge 36714558238 (job 109885496875) green, every Checks job green

In the green run on a hosted runner, the job took 5m21s and the harness about three minutes. It ran against:

  • PostgreSQL 16 with pg_search 0.22.6 and pgvector 0.8.1, from the tale-db the job built;
  • the pinned MinIO;
  • Node 22.21.1.

The job

Integration scope (dorny/paths-filter, already pinned in build.yml) decides who owes the proof:

  • every push to main, merge group and release candidate;
  • a pull request that touches:
    • the backend, lib/, the notification catalogs (messages/), sla-targets.ts, the platform's package.json or Dockerfile;
    • services/db/**, packages/shared/**, @tale/ui's manifest or its src/i18n/**, or configs/platform/**;
    • the CLI pin file tools/cli/src/lib/compose/types.ts;
    • package.json or bun.lock;
    • checks.yml or setup-turbo.

The platform guard tests/guards/integration-scope.guard.test.ts walks the harness's module graph, including its new URL(…, import.meta.url) reads, and fails on any file the list misses. checks.yml is now a hashed input of the platform's tests.

On other PRs the check reads skipped. If the scope job itself fails, Backend integration runs anyway and fails at its first step, so a broken paths filter never reads as "not owed".

Backend integration has a 40-minute budget, and the harness step alone has 30 minutes. It:

  1. Builds services/db/Dockerfile from the checked-out commit and loads it as tale-db:itest. It reads Build's db layer cache and never writes it.
  2. Starts that image and the object store from THIRD_PARTY_IMAGES['object-store'], which it reads from the CLI source at run time, with ITEST_S3_* set.
  3. Installs ffmpeg and the Node that the platform Dockerfile's node-bin stage names.
  4. Runs bun run backend:integration directly, never through turbo.
  5. Writes the tally and the failures to the job summary, and dumps the container logs on failure.

Both jobs join the candidate gate (CANDIDATE_JOBS.checks). The CLI's test inputs now hash every workflow its suites read.

The deployment-ci.test.ts cases pin the job's contract:

  • the scope script, run for every event;
  • the pin step, run and compared with THIRD_PARTY_IMAGES;
  • the containers started are the tag the build step produced and "$OBJECT_STORE_IMAGE";
  • a failed scope fails the job;
  • the non-import filter entries.

Each of these workflow mutations fails a test:

  • start paradedb/paradedb instead of the built tag;
  • hardcode another MinIO;
  • drop services/db/**;
  • disable the scope step.

actionlint passes. zizmor reports no new finding against main beyond a help-level self-repository note, the same one every job that uses setup-turbo has.

Vendor egress. A few lanes still reach real vendors:

  • the AI title lane calls api.anthropic.com;
  • the model-picker and deferred-send checks fetch the openrouter.ai and ai-gateway.vercel.sh catalogs;
  • five video-link checks resolve public DNS.

An outage at one of them can turn the check red. The job comment names these lanes, and RELEASING.md and the backend README say to re-run such a failure, never to waive it. Making them hermetic is #3993.

Docs updated

  • .agents/repo.md: the migration bullet, the "green check is not always a run" section, and the turbo inputs.
  • services/platform/backend/README.md, services/platform/README.md, services/platform/tests/README.md.
  • Five rows of tests/manual/reference/automation.md.
  • The create-migration skill, and its mirror.
  • .github/RELEASING.md.
  • Four test-file comments.

Review round 1

  • Paths filter. It missed sla-targets.ts, the two @tale/ui i18n modules and messages/. They are now in the filter, and the new guard enforces the list.
  • Contract test. It now checks the built image, the pinned store and the filter.
  • Scope failure. A failed scope job now fails the check.
  • Job comment. The duration is corrected, the vendor-bound lanes are named, and the tale-db note is right: compose runs db and knowledge-db from the same image. CI uses one container in the default role, as the harness's KNOWLEDGE_DATABASE_URL default expects.
  • Pushes to main. cancel-in-progress is left as it is. It is workflow-wide and shared by every Checks job. A newer push's run covers the tree of every earlier commit, which the job comment now says.

yannickmonney and others added 4 commits September 30, 2026 11:43
The real-Postgres proofs ran only by hand, so a regression in them
failed no gate. Checks now runs the suite in a Backend integration
job against tale-db built from the commit's own services/db and the
object store the CLI pins, on the platform image's Node, with
ITEST_REQUIRE_ALL_LANES=1. It calls the script directly, so no verdict
is a turbo replay, and its summary lists the failed checks.

An Integration scope job decides who owes the proof: every push to
main, merge group and release candidate, and a pull request that
touches the backend, its libraries, either database's migrations, the
database image, the pin, the dependencies or this workflow. Both jobs
join the candidate gate. The CLI's suites now hash every workflow they
read, and the docs stop calling these proofs hand-run.
The Integration scope filter missed three files the suite imports
(services/platform/sla-targets.ts and two @tale/ui i18n modules) and the
notification catalogs it reads under services/platform/messages/. A
platform guard now walks the harness's module graph and its
`new URL(..., import.meta.url)` reads and fails on any the filter
misses; checks.yml becomes a hashed input of the platform's tests.

Backend integration now runs, and fails, when the scope job did not
succeed, so a failed paths filter can never read as a skipped check.
The contract test pins the containers to the image the job builds and
the pinned object store, and the filter to its non-import entries.

The job comment gives the measured duration, names the vendor-bound
lanes, and describes the single tale-db container correctly;
RELEASING.md and the backend README say a vendor outage is re-run,
not waived.
A deliberate regression of the watchdog's stuck-first order: the Backend
integration check must fail on the checkRagWatchdogBatch lane. Revert
this commit once the red run is recorded.
@yannickmonney

Copy link
Copy Markdown
Contributor Author

Both CI proposals now have an actual healthy hosted run. Independent comparison at #3988 e2087fd / #3989 2f42f5e recommends consolidating to one unconditional all-event job in #3989: it retains source/image/exit artifacts, checks both extensions, includes the job in the candidate receipt/CLI contract, and avoids a second scope job. The later #3988 a407682a scope correction is acknowledged; the consolidation preference is the simpler job and evidence design, not a claim that the old scope omission remains at the new head.

Root is carrying over this PR’s remaining documentation/skill/comment sweep and persist-credentials:false into #3989. Do not merge both workflow implementations or start another agent for this same work. Useful source and healthy evidence from this PR will remain linked in the final handoff.

Verified first #3989 healthy run: 36698940184, backend job109834369207, actual tested tree identical to head 2f42f5e: 1191/1191 checks across204/204 lanes,0 skips,exit0. This PR’s initial job also passed1191/1191. Final consolidated source review, a reviewed actual watchdog regression turning the hosted lane red, exact revert/final green, and normal full checks remain before merge. No red control has yet been published; no production testing or release is part of this control.

This reverts commit a407682. Backend integration failed on it as intended
(Checks run 36701485061, checkRagWatchdogBatch: stuck=running, want
failed).
yannickmonney and others added 2 commits September 30, 2026 13:55
… red

A deliberate regression of the watchdog's stuck-first order: the Backend
integration check must fail on the checkRagWatchdogBatch lane. Revert
this commit once the red run is recorded.
Checks run 36711567271 (job 109879495032) failed Backend integration on
af4d394 with 1186 of 1191 checks, the rag watchdog lane among them,
which is the proof the gate goes red on a broken lane.
@yannickmonney
yannickmonney merged commit 5f8dfea into main Sep 30, 2026
67 of 69 checks passed
@yannickmonney
yannickmonney deleted the ci/backend-integration branch September 30, 2026 12:42
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