Skip to content

Harden craft site preview readiness#288

Merged
crazygo merged 3 commits into
mainfrom
codex/craft-preview-production-readiness
Jul 4, 2026
Merged

Harden craft site preview readiness#288
crazygo merged 3 commits into
mainfrom
codex/craft-preview-production-readiness

Conversation

@crazygo

@crazygo crazygo commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • handle generated-site asset read races as controlled not-published responses instead of backend 500s
  • confirm and document shared production sandbox root for production/preview Dokku apps
  • move the preview readiness task to done and update code maps

Validation

  • npm test -- channelSiteHost.test.ts auth.test.ts
  • npm run type-check
  • npm test
  • live checks: craft.bricks.cool 200, s-d1893c434ca7.craft-spaces.bricks.cool 200, JS asset 200
  • live Dokku checks: BRICKS_SANDBOX_ROOT=/app/data/sandboxes, BRICKS_SANDBOX_RUNNER_ROOT_SEGMENTS=production,sandboxes, storage mount /home/bricks/data/production/sandboxes:/app/data/sandboxes
  • live OAuth init checks: production and craft-dev preview return_to URLs redirect to GitHub via https://craft.bricks.cool/api/callback

@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Hobby accounts are limited to daily cron jobs. This cron expression (* * * * *) would run more than once per day. Upgrade to the Pro plan to unlock all Cron Jobs features on Vercel.

Learn More: https://vercel.link/3Fpeeb1

@crazygo crazygo marked this pull request as ready for review July 4, 2026 05:07
Copilot AI review requested due to automatic review settings July 4, 2026 05:07
@crazygo crazygo merged commit fa4d7dc into main Jul 4, 2026
11 of 14 checks passed
@crazygo crazygo deleted the codex/craft-preview-production-readiness branch July 4, 2026 05:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens generated-site (“craft-spaces”) preview/production readiness by ensuring missing static assets during build/deploy races return a controlled “Site not published” 404 (with X-Robots-Tag: noindex) instead of bubbling into backend 500s, and it documents/records the intentional shared-root deployment model for Dokku preview apps.

Changes:

  • Harden channelSiteHost static serving to treat missing-file races (including post-stat ENOENT) as controlled not-published responses.
  • Add a regression test for “asset disappears during read” and update code maps to reflect the operational risk/behavior.
  • Document and capture the shared production sandbox root model in deployment docs and task history (move task to done).

Reviewed changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
README.md Updates showcase layout and image reference.
docs/tasks/done/2026-06-30-18-35-CST-preview-site-storage-db-isolation.md Adds completed task write-up documenting shared-root preview/prod model and requirements.
docs/tasks/backlog/2026-07-03-15-47-CST-editable-todo-and-note-resources.md Adds a new backlog task for editable todo/note resources.
docs/tasks/backlog/2026-06-30-18-35-CST-preview-site-storage-db-isolation.md Removes the prior backlog task version now that work is marked done.
docs/deploy/dokku.md Updates Dokku runbook to describe preview apps sharing production data root and cleanup constraints.
docs/code_maps/logic_map.yaml Adds note about static asset read races and controlled 404 behavior.
docs/code_maps/feature_map.yaml Updates deployment feature description and smoke checks to reflect shared-root preview/prod model.
apps/node_backend/src/routes/channelSiteHost.ts Catches missing-file errors during static serving to avoid 500s during dist replacement races.
apps/node_backend/src/routes/channelSiteHost.test.ts Adds fs read failure simulation for missing asset race and asserts 404 not-published response.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +19 to +21
vi.mock('node:fs/promises', async (importOriginal) => {
const actual = await importOriginal<typeof import('node:fs/promises')>();
const readFile = vi.fn((...args: Parameters<typeof actual.readFile>) => {
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.

2 participants