ci: drop the nx cache that nx 22 cannot use - #3034
Open
mfal wants to merge 1 commit into
Open
Conversation
Contributor
Coverage Report for ./packages/components/
File CoverageNo changed files found. |
Contributor
🚀 Preview DeploymentPreview environments are ready:
Images:
|
Nx 20 replaced the file-system task cache with a database keyed by the machine ID — `/etc/machine-id` on Linux, which every hosted runner generates fresh. A restored `.nx/cache` is therefore artifacts nx has no metadata for: it warns "Unrecognized Cache Artifacts" and re-runs every task. Caching `.nx/workspace-data` alongside would not help either, since the database file is named after the machine ID and nx never opens the restored one. The old escape hatches are gone too — `DbCache` does not read NX_REJECT_UNKNOWN_LOCAL_CACHE, and `useLegacyCache` no longer exists in nx 22. Measured on a preview run: both build jobs restored the 15MB cache in 4.3s and then executed all of their tasks (13 and 11) with zero hits. Remove the restore step, its `nx-cache` input and the `main`-only save step, and leave a comment in their place so the next reader does not re-add them. Sharing build results across runners needs a remote cache (Nx Cloud, or nx's self-hosted cache API). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mfal
force-pushed
the
claude/deployment-actions-performance-74c095
branch
from
September 2, 2026 11:53
a7b0ff2 to
8031512
Compare
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.
The nx cache restored by
prepare-workspacenever produced a single hit. Nx 20replaced the file-system task cache with a database keyed by the machine ID —
/etc/machine-idon Linux, which every hosted runner generates fresh. Therestored
.nx/cacheis therefore artifacts nx has no metadata for, so it warnsand re-runs every task:
Measured on run 33385191014: both preview build jobs spent 4.3s downloading and unpacking 15MB, then executed all of their tasks — 13 for docs, 11 for storybook — with zero cache hits.
Adding
.nx/workspace-datato the cached paths does not fix it. The databasefile is named after the machine ID, so nx never opens a restored one:
The old escape hatches are gone as well:
DbCachedoes not readNX_REJECT_UNKNOWN_LOCAL_CACHE(only the deprecatedCacheclass did), anduseLegacyCacheexists neither in nx 22's code nor innx-schema.json.What changes
prepare-workspace: the restore step and itsnx-cacheinput are gone, replaced by a comment recording why a local nx cache cannot work on CI — so the next reader does not re-add ittest.yml: themain-only save step is gone, as is the now-pointlessnx-cache: "false"on the lint jobEffect
Roughly 4–5s per job, across every job that uses
prepare-workspace. Small — thepoint is mainly that the previous comment promised something that never happened
("a hit turns those ~40s into unpacking"). Actually sharing build results across
runners needs a remote cache (Nx Cloud, or nx's self-hosted cache API); that is a
separate decision, not part of this PR.
Tooling-only, so this publishes nothing.
🤖 Generated with Claude Code