Harden craft site preview readiness#288
Merged
Merged
Conversation
|
Deployment failed with the following error: Learn More: https://vercel.link/3Fpeeb1 |
Contributor
There was a problem hiding this comment.
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
channelSiteHoststatic serving to treat missing-file races (including post-statENOENT) 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>) => { |
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
Validation