Skip to content

fix(ci): declare apollo-core's generated token files as build outputs - #1169

Merged
akraminakib merged 1 commit into
mainfrom
fix/apollo-core-turbo-token-outputs
Sep 15, 2026
Merged

akraminakib merged 1 commit into
mainfrom
fix/apollo-core-turbo-token-outputs

Conversation

@akraminakib

Copy link
Copy Markdown
Member

Summary

main's release run is red on tailwind.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.

FAIL src/styles/tailwind.consumer.test.ts > future theme typography
     > points every apollo-core sans token at --font-sans
Error: ENOENT: no such file or directory, open
  '/home/runner/.../packages/apollo-core/src/tokens/css/variables.css'

Root cause

@uipath/apollo-core's build runs build:tokens, which writes into src/tokens/css/, jss/, less/, scss/ and the per-token .ts files. All of it is gitignored (packages/apollo-core/.gitignore:7), so it exists only after a build.

The root turbo.json declares build.outputs as ["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:113 reads apollo-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

✔︎  src/tokens/css/variables.css

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 shows Cache 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 main twice with the same test and the same path:

date sha run
Sep 11 56d2f61 same ENOENT … variables.css
Sep 14 3b4dfcf same, 2 attempts

No 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, mirroring packages/apollo-react/turbo.json, which already exists for exactly this reason ("outputs": ["dist/**", "src/**/locales/*.ts"]).

src/tokens/index.ts is negated — it is the one committed file the src/tokens/*.ts glob 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:

  • Warm the cache, delete src/tokens/css, rebuild → cache hit, files not restored
  • Run the test → identical ENOENT … variables.css
  • Apply this change, rebuild, delete, replay → all token files restored
  • Run the test → 18/18 pass
  • src/tokens/index.ts confirmed unmodified throughout
  • Local @uipath/apollo-core:build hash fa7d695cd6051497 matches the hash CI replayed, confirming the same cache entry

tailwind.consumer.test.ts:113 is 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]
Loading

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.
Copilot AI lite review requested due to automatic review settings September 14, 2026 22:49
@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Apollo Coded App preview deployments are ready.

Project Status Preview Updated (PT)
apollo-design Ready Preview · Logs Sep 14, 2026, 03:58:14 PM
apollo-docs Ready Preview · Logs Sep 14, 2026, 03:58:14 PM
apollo-landing Ready Preview · Logs Sep 14, 2026, 03:58:14 PM
apollo-vertex Ready Preview · Logs Sep 14, 2026, 03:58:14 PM

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 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.

@github-actions

Copy link
Copy Markdown
Contributor

Dependency License Review

  • 1937 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1708
ISC 88
Apache-2.0 55
BSD-3-Clause 27
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
MIT-0 3
CC0-1.0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.3.2 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage + size by package

Per-package bundle size on this PR (no JS/TS source changes detected under packages/* or web-packages/*).

Package Coverage New-line coverage Packed (gzip) Unpacked vs main
@uipath/apollo-core 75.0% 42.01 MB 50.12 MB ±0
@uipath/apollo-react 43.7% 7.56 MB 29.14 MB ±0
@uipath/apollo-ui-icons 2.85 MB 6.91 MB ±0
@uipath/apollo-wind 67.0% 461.8 KB 2.92 MB +1.8 KB
@uipath/ap-chat 85.8% 43.92 MB 56.68 MB ±0

"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.

@akraminakib
akraminakib merged commit 2b37cda into main Sep 15, 2026
40 checks passed
@akraminakib
akraminakib deleted the fix/apollo-core-turbo-token-outputs branch September 15, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:apollo-core size:S 10-29 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants