Verify and retry compiled asset copy to fix missing open-write bundle - #8
Merged
Merged
Conversation
…#7) CI logs from two separate deploys showed os-app/open-write/__compiled consistently missing from the uploaded Pages artifact, while every other controller's __compiled output copied fine — even though the build step logs confirm it created the file, and local rebuilds always reproduce it correctly. open-write is the last (and heaviest, ~7s) module olsk-rollup builds; this looks like a race where the build CLI logs "created" and exits before that module's output is fully flushed to disk on the CI runner. Rather than chase the exact upstream timing bug, make the copy self-verifying: after copying os-app to .static, check that every module with a rollup-start.js has its __compiled output present in the copy, retrying (with a short wait) up to 5 times before failing the deploy loudly. Better to fail CI than silently ship a page missing its script and stylesheet, as happened in the last two deploys.
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
Fixes #7. Diagnosed by pulling the CI job logs from two successful deploy runs (30100919497, 30252869956) and comparing the uploaded artifact's file listing (the
##[group]log block right beforeactions/upload-artifact@v4runs) against what should be there:sub-detail/__compiled,sub-item/__compiled,sub-input/__compiled, andsub-template/__compiledall appear with theirui-behaviour.js/ui-style.css, butopen-write/__compiledis missing entirely from both runs — despite the "Build" step's own log confirmingcreated os-app/open-write/__compiled/ui-behaviour.js, and despite every local rebuild reproducing it correctly.open-writeis the last (and heaviest — ~7s Svelte compile) moduleolsk-rollupbuilds. Best explanation: the build CLI logs "created" and exits before that module's compiled output is fully flushed to disk on the CI runner — a timing race in the upstream toolchain that isn't reproducible locally.Change
Rather than chase the exact upstream race,
static-export.js's asset copy is now self-verifying: after copyingos-appinto.static, it checks that every module with arollup-start.jsactually has its__compiledoutput present in the copy. If any are missing, it retries (with a 1s wait) up to 5 times before throwing — so a transient race self-heals, and a genuine problem fails the deploy loudly instead of silently shipping a page missing its script/stylesheet (which is what happened on the last two deploys).Test plan
npm run static-export— happy path unaffected,open-write/__compiled/{ui-behaviour.js,ui-style.css}presentopen-write/__compiled, andhyperdraft.pondersource.com/en/write/loads without 404shttps://claude.ai/code/session_01AcjKc8vk2fb84yYZsE8k5d
Generated by Claude Code