Skip to content

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

Merged
dgp1130 merged 2 commits into
angular:mainfrom
MeAkib:fix/cache-info-worktree-path
Nov 6, 2026
Merged

dgp1130 merged 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
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Nov 5, 2026
@dgp1130
dgp1130 merged commit acb3c8b into angular:main Nov 6, 2026
40 of 41 checks passed
@dgp1130

dgp1130 commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

This PR was merged into the repository. The changes were merged into the following branches:

@MeAkib
MeAkib deleted the fix/cache-info-worktree-path branch November 7, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker 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.

4 participants