Skip to content

fix(@angular/cli): report the worktree-local cache in ng cache info - #34653

Open
MeAkib wants to merge 2 commits into
angular:mainfrom
MeAkib:fix/cache-info-worktree-path
Open

MeAkib wants to merge 2 commits into
angular:mainfrom
MeAkib:fix/cache-info-worktree-path

Conversation

@MeAkib

@MeAkib MeAkib commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

In a Git worktree the development server keeps its Vite cache in the worktree's own cache directory while the configured path resolves to the shared cache of the main checkout. ng cache clean removes both since the getCacheConfig localPath addition, but ng cache info still reports only the shared path and its size, so the cache that the development server actually writes to in that checkout is invisible.

Print the local path and its size when it differs from the shared path. Outside of a worktree both paths are the same and the output is unchanged.

In a Git worktree the development server keeps its Vite cache in the worktree's own cache
directory while the configured path resolves to the shared cache of the main checkout.
`ng cache clean` removes both since the `getCacheConfig` localPath addition, but `ng cache info`
still reports only the shared path and its size, so the cache that the development server
actually writes to in that checkout is invisible.

Print the local path and its size when it differs from the shared path. Outside of a worktree
both paths are the same and the output is unchanged. Tested with a unit spec that reproduces
the worktree layout; the spec fails without the fix.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the cache info command to display both the shared cache path and the worktree-local cache path (along with its size on disk) when running inside a Git worktree. It also adds comprehensive unit tests to verify this behavior in both standard repositories and Git worktrees. The feedback suggests parallelizing the directory size calculations for the shared and local cache paths using Promise.all to improve performance by avoiding sequential disk I/O operations.

@clydin clydin added the target: patch This PR is targeted for the next patch release label Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: @angular/cli target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants