fix(ci): declare apollo-core's generated token files as build outputs - #1169
Conversation
packages/apollo-core/build runs build:tokens, which writes into src/tokens (css/, jss/, less/, scss/ and the per-token .ts files). All of it is gitignored. The root turbo.json only declares dist/**, .next/**, build/** and storybook-static/**, so on a cache HIT turbo skips the build and restores none of it -- and the replayed logs still print the generator's output, so CI looks like it ran. apollo-wind's tailwind.consumer.test.ts reads apollo-core/src/tokens/css/variables.css (709fdde, MST-14539, so a new core token fails the test instead of silently keeping the old stack), and ENOENTs whenever that cache hit happens. It has hit main twice: 56d2f61 on Sep 11 and 3b4dfcf today, both the same test and the same path. Retrying cannot clear it -- the turbo cache is keyed on the exact sha, so every attempt restores the identical state. Declare the generated paths as outputs so a cache hit restores them. src/tokens/index.ts is negated: it is the one committed file the .ts glob would otherwise cover. Mirrors packages/apollo-react/turbo.json, which exists for the same reason (src/**/locales/*.ts). Verified by deleting src/tokens/css, re-running with a cache hit, and confirming the files come back and the test passes.
|
Apollo Coded App preview deployments are ready.
|
There was a problem hiding this comment.
🟢 Approval recommended
The cache-restoration gap is addressed with no unresolved review issues.
Pull request overview
This PR configures Turbo to cache and restore Apollo Core’s generated token files on cache hits.
Changes:
- Adds package-scoped output patterns for generated token files.
- Excludes the committed
src/tokens/index.ts.
File summaries
| File | Description |
|---|---|
packages/apollo-core/turbo.json |
Configures generated token files as Turbo build outputs. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Dependency License Review
License distribution
Excluded packages
|
Storybook visual diff✅ No stories are affected by this PR's changes; nothing to compare. Logs Updated (PT): Sep 14, 2026, 03:59:39 PM |
📊 Coverage + size by packagePer-package bundle size on this PR (no JS/TS source changes detected under
"Coverage" is each package's own |
Summary
main's release run is red ontailwind.consumer.test.ts, and retrying cannot clear it. This declares apollo-core's generated token files as Turbo build outputs so a cache hit restores them.Root cause
@uipath/apollo-core'sbuildrunsbuild:tokens, which writes intosrc/tokens/—css/,jss/,less/,scss/and the per-token.tsfiles. All of it is gitignored (packages/apollo-core/.gitignore:7), so it exists only after a build.The root
turbo.jsondeclaresbuild.outputsas["dist/**", ".next/**", "build/**", "storybook-static/**"].src/tokens/**is not in that list, so on a cache hit Turbo skips the build and restores none of it.packages/apollo-wind/src/styles/tailwind.consumer.test.ts:113readsapollo-core/src/tokens/css/variables.css— added deliberately in 709fdde (MST-14539) so "a new token there fails here instead of silently keeping the old stack". Good intent; it just made a latent packaging gap reachable from the test suite.The trap is that the cached run's logs are replayed, so CI still prints
even though nothing was written. The log looks like the generator ran.
Why retrying does not help
The Turbo cache is keyed on the exact SHA (
release.yml:52). Run 34902294883 showsCache hit for: Linux-turbo-main-3b4dfcfae…— an exact-key hit, not a prefix fallback. Attempt 1 saved that cache, so every retry restores byte-identical state and fails identically. Both attempts on that run failed the same way.Not new, and not from the PR that surfaced it
It has hit
maintwice with the same test and the same path:56d2f61ENOENT … variables.css3b4dfcfNo commit since 709fdde has touched
packages/apollo-core, so its build hash has been stable — whether a given run fails depends purely on whether that cache entry happens to be present, which is why it reads as intermittent.Changes
Adds
packages/apollo-core/turbo.json, mirroringpackages/apollo-react/turbo.json, which already exists for exactly this reason ("outputs": ["dist/**", "src/**/locales/*.ts"]).src/tokens/index.tsis negated — it is the one committed file thesrc/tokens/*.tsglob would otherwise cover, and it must never be restored over.Testing
Reproduced and verified locally, since the failure is cache-state dependent and cannot be reached by simply running the test:
src/tokens/css, rebuild → cache hit, files not restoredENOENT … variables.csssrc/tokens/index.tsconfirmed unmodified throughout@uipath/apollo-core:buildhashfa7d695cd6051497matches the hash CI replayed, confirming the same cache entrytailwind.consumer.test.ts:113is the only consumer of these generated files outside apollo-core itself.Note for the first merge
Existing caches were written without these outputs, so the first run after this lands will be a cache miss that repopulates them. Expected, not a regression.
Flow
flowchart TD A[pnpm build] --> B{apollo-core build<br/>cache hit?} B -->|miss| C[build:tokens runs<br/>src/tokens written] B -->|hit| D[skipped, outputs restored] D --> E{src/tokens<br/>declared as outputs?} E -->|before: no| F[src/tokens missing<br/>logs replayed anyway] E -->|after: yes| C F --> G[tailwind.consumer.test.ts<br/>ENOENT] C --> H[test passes]