Commit 2ae4413
committed
fix(ci): regenerate workspace codegen even when the node_modules cache hits
main has been red for four consecutive runs with nothing wrong in the tree, and
every PR fails validate-code regardless of what it changes -- including a
test-only PR touching no UI file.
setup-workspace restores a node_modules cache and, on a hit, skips `npm ci`
entirely. Skipping `npm ci` skips every workspace lifecycle script, and
apps/loopover-ui's `postinstall: fumadocs-mdx` is what generates `.source/` --
the directory tsconfig maps `collections/*` onto. `.source/` is gitignored and
is not among the cached paths, so on a cache hit the UI typechecks against
modules that do not exist:
src/lib/docs-client-loader.tsx(1,32): error TS2307: Cannot find module 'collections/browser'
src/lib/docs-source.server.ts(1,22): error TS2307: Cannot find module 'collections/server'
The cache key includes the lockfile, which is why it started when it did: a
lockfile change mints a fresh key, the first run misses and installs and passes
and saves, and every run after it hits and fails. Green through 5079601, red
from 40133d7 on, with no relevant change between them.
Same shape as the @eslint/js hoist bug the cache step already documents -- it
reproduces on no developer machine, because a real `npm ci` always runs
postinstall. Reproduced by simulating the cache-hit state: removing
apps/loopover-ui/.source with node_modules intact gives exactly those errors,
and running the codegen clears them.
REGENERATED, NOT CACHED. Adding `.source` to the cache paths is the smaller fix
and the wrong one: the key derives from the manifests and lockfile, while
`.source` derives from source.config.ts and content/docs/**. A cached copy would
serve a docs collection generated from different MDX than the commit under test
-- a stale pass, which is worse than an honest failure.
Closes #99751 parent a790a9e commit 2ae4413
1 file changed
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
94 | 119 | | |
95 | 120 | | |
96 | 121 | | |
| |||
0 commit comments