Skip to content

app/: the parity stack for cutover (sc-8900): staff pages, GitHub webhook, live transport, forge sync, security headers, the React app's pages, the image and CI build - #87

Merged
ndbroadbent merged 20 commits into
mainfrom
laravel-deploy
Dec 3, 2026

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

The rest of sc-8900's parity work, merged as one PR to cut serial CI time before cutover. Each part was reviewed in its own PR; those PRs are closed as included here.

Rebased onto main after #93, which added forge/events.rs byte for byte from #74, so it applied cleanly. Conflicts with main's later work were all "both sides added" (modules, boot checks, middleware, host tests): both sides were kept. fmt, clippy -D warnings and the full app suite pass on docspring-dev.

The cutover runbook is in sc-8900.

Also: tests read a committed stand-in app/public/index.html (the image's frontend build replaces it), so the production-boot tests find the page the security headers' check needs, and the app-shell tests no longer write and delete a shared file.

  • One test database URL (app::testing::database_url), so the live transport's test reaches CI's Postgres.

@visualci-com

visualci-com Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #434 · 333 unchanged · no changes

This PR vs base: 22 changed, 2 added since #337, across 3 builds

Updated as builds change. Agents can review with VisualCI's MCP tools.

@ndbroadbent ndbroadbent changed the title app/'s image and CI build (sc-8900) app/: the parity stack for cutover (sc-8900): staff pages, GitHub webhook, live transport, forge sync, security headers, the React app's pages, the image and CI build Dec 3, 2026
…ign-ups with how they heard about VisualCI, every email rendered with sample data, failed emails retried or dismissed; a 404 for anyone who isn't staff
…b-Signature-256, constant time); merges, closed and reopened pull requests (a fork's branch by its label), deleted branches and visibility changes dispatched to the domain once per linked project (by GitHub's repository ID, else URL) as forge::events; installations attach to and detach from linked projects (only from the installation being removed) and recheck their organizations' GitHub members; membership and team changes queue RecheckAccess, which asks the App for each person's permission on every linked repository and applies it as a sign-in does; the GitHub App client (JWT, installation tokens, collaborator permission)
…s collaborators once (affiliation=all; one installation token per installation for the run; the path looked up by GitHub's ID) and derives everyone's permission from that, keyed by repository ID; nothing changes unless every repository was read, and it stops when the rate limit is low; an installation is attached only after GitHub confirms it exists (a stale or redelivered 'created'); renamed and transferred repositories move their links by ID; a delivery naming a repository's ID backfills links that only had its URL; 'edited' takes the repository's own private flag; deliveries up to GitHub's 25 MB
…IFY on one channel, one listener per process (started by the first subscriber, reconnecting with backoff) fanning topics out to subscribers; notify() is delivered on commit; topics only say 'look again', so a missed one costs a moment and payloads carry no data; CheckLive notifies itself every minute and pushes VISUALCI_LIVE_HEARTBEAT only when it arrives
…h fresh LISTEN and each silent reconnect tells subscribers to re-read everything (*), as they must on Lagged too; every process probes its own listener each minute over a separate connection and restarts it when the probe doesn't come back in ten seconds (a half-open connection), with live::healthy() for its health check; the queue worker's heartbeat waits for the listener to be ready before probing; topics are capped well under Postgres's 8000 bytes; documented: LISTEN needs a direct or session-mode connection, not a transaction-mode PgBouncer
…Hub identity is rechecked through the App, so access lost without a webhook goes within the hour; people GitHub can't answer for keep their memberships (synced_at ages) and fail VISUALCI_FORGE_SYNC_HEARTBEAT, as does a run that can't read the database
…laborators (webhooks::reach) rechecks everyone, and recheck_links unlinks projects whose linker no longer maintains the repository or whose repository the App can't see (no more checks and comments from someone who lost access); links without GitHub's repository ID get it first; nothing changes unless GitHub answered for every repository, and a low rate limit defers the run without failing the heartbeat; an unconfigured App fails the heartbeat plainly
…oday's open_source.rs): GitHub's word on a repository's visibility and licence decides whether a project may be public and draws from the open source pool; a repository gone private makes its public project private (a notice, the admins emailed), a project that stops qualifying leaves a billing notice and emails the billing contact; the repository webhook applies changes at once (RepositoryVisibilityChanged), and the hourly sync checks each linked project once a day in an hour of its own
…7, ported): GitHub doesn't send a branch deletion without a pull request (the App has no Contents permission), so each branch with CI builds waiting for review is asked about once a day (500 a run), and a gone one gets BranchClosed { why: branch_deleted }, which the domain handles
…ff, the referrer policy, no framing (DENY, over Laravel's SAMEORIGIN) and the Content-Security-Policy allowing only VisualCI's scripts, the built page's inline script hashes (VISUALCI_FRONTEND_DIR) and the analytics; x-powered-by dropped; the gallery's /g/ paths CORS and CORP cross-origin; outermost, so the host check's 404s carry them too
…e the server serves (public/index.html under the application's base path, the frontend in the same image), read once at boot; in production a missing page or one with no inline scripts stops the boot (the theme script would be blocked), elsewhere it's logged
… as they are, and any other page path on the web group gets public/index.html (no-cache), so client-side routes load; a path naming a missing file, anything under /api/, and anything but GET or HEAD get a 404, as today
…dex.html come from the static file server), and /assets/ public, max-age=31536000, immutable; the fallback serves the page read at boot with the policy's hashes; only the app host serves the app's pages (any host when none are configured), so other hosts' unknown paths are a 404; the /api/ui 404 is tested as JSON
…h cargo-chef (the dependencies in a layer of their own; the CLI's crates by path with the repository's workspace manifest), the React frontend in public/ next to the base path (the CSP hashes the page it serves), a non-root user and an emptyDir-ready storage/; one image for serve, queue:work, schedule:work and migrate --force; CI's images job pushes it on main (not deployed until cutover); .dockerignore leaves out every target/
…nd build replaces it) instead of writing and removing one, which raced between tests; production-boot tests find the page the security headers' check needs
…P_TEST_DATABASE_URL else CI's), so the live transport's test reaches CI's Postgres instead of the dev box's user
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