You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(ci): seed previews from staging and read its event stream
Restores what #1455 built and #1557 dropped: a preview starts from a pg_dump of
staging's database and consumes staging's JetStream, so it is worth looking at
rather than an empty install.
The seed loader runs before the application server may boot. It cancels queued
work, disables every review trigger, and drops the instance identity, then
verifies that against the database and refuses to mark the preview seeded if the
policy did not take — a preview that cannot be silenced stays down. It holds the
Docker socket read-only because pg_dump and psql run inside the two database
containers; check-preview-stack.ts now refuses that mount on any other service,
and refuses it writable on this one.
The local broker is gone. The application server joins staging's shared-network
for its broker, with a durable named per deploy so previews never compete for one
consumer, and a 72h inactivity window because a preview is deleted rather than
shut down. staging-shared is external and named, which the sandbox check now
distinguishes from the project-scoped networks every preview would share.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017VKWqbmrPJFv8aKZBp36uD
Copy file name to clipboardExpand all lines: .changeset/previews-deploy-on-purpose.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,6 @@
4
4
5
5
Pull request previews are now self-service. Add the `preview` label to a pull request in this repository and it deploys; every commit after that redeploys on its own. A preview waits only for its images to be published, never for the test suite, so it exists even when the tests are red — and it runs the same artifacts staging and production run, so what you see is what ships. A comment on the pull request carries the preview link, and GitHub's native deployment link opens it too. Removing the label, closing the pull request, or converting it back to draft removes the stack. Up to three previews run at once by default, and when the host is full the pull request comment names the ones holding the slots.
6
6
7
-
Preview stacks use their own database, message broker, credentials, and Docker networks, and reach neither the staging Docker socket, its data, nor any integration credential. Previews never run for forks, nor for changes to the deployment workflows themselves. Stacked pull requests each get their own preview.
7
+
Each preview starts from a copy of staging's database, so workspaces and synced work are already there — and that copy is silenced before the app starts: review triggers, agent bindings and sweep schedules off, queued jobs cancelled, and the sign-in identity dropped so the preview issues its own tokens. It reads staging's event stream on a consumer of its own. Agent runs and inbound webhooks stay off. Previews never run for forks, nor for changes to the deployment workflows themselves. Stacked pull requests each get their own preview.
8
8
9
-
**Operators:** follow the preview runbook before enabling the Coolify application. It requires a `preview` repository label, a preview-only Coolify application, two scoped Coolify secrets, and the repository variables listed there — including the optional `PREVIEW_MAX_ACTIVE` limit. Keep Coolify's automatic repository webhook disabled.
9
+
**Operators:** follow the preview runbook before enabling the Coolify application. It requires a `preview` repository label, a preview-only Coolify application, two scoped Coolify secrets, and the repository variables listed there — including the optional `PREVIEW_MAX_ACTIVE` limit. Previews must be deployed onto the staging host: they seed from its database and read its event stream. Keep Coolify's automatic repository webhook disabled.
0 commit comments