Skip to content

feat(core): add support for skipping remote cache#29574

Merged
FrozenPandaz merged 5 commits into
masterfrom
feature/nxc-1318-add-option-to-skip-all-remote-caches-in-nx
Jan 15, 2025
Merged

feat(core): add support for skipping remote cache#29574
FrozenPandaz merged 5 commits into
masterfrom
feature/nxc-1318-add-option-to-skip-all-remote-caches-in-nx

Conversation

@Cammisuli

@Cammisuli Cammisuli commented Jan 9, 2025

Copy link
Copy Markdown
Member

Current Behavior

Expected Behavior

Related Issue(s)

Fixes #

@vercel

vercel Bot commented Jan 9, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Jan 14, 2025 5:44pm

@nx-cloud

nx-cloud Bot commented Jan 9, 2025

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit ac0f1a4.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 41m 3s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 20s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check --base=9dbeb... ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗
nx documentation --no-dte ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-14 21:16:45 UTC

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
describe: 'Do not save cache results to the remote cache.',
describe: 'Disables the remote cache.',

Comment thread packages/nx/src/command-line/yargs-utils/shared-options.ts Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rename this too

@Cammisuli Cammisuli force-pushed the feature/nxc-1318-add-option-to-skip-all-remote-caches-in-nx branch from d6a05be to c21f3e2 Compare January 9, 2025 19:37
- Introduced `skipRemoteCache` option to bypass saving and reading from remote cache.
- Updated command-line and configuration options to support `skipRemoteCache`.
- Adjusted cache runner logic to handle `skipRemoteCache` flag and log warnings when remote cache is disabled.
@Cammisuli Cammisuli force-pushed the feature/nxc-1318-add-option-to-skip-all-remote-caches-in-nx branch from 2bcb3f5 to 025816c Compare January 10, 2025 21:43
@Cammisuli Cammisuli marked this pull request as ready for review January 14, 2025 14:53
@Cammisuli Cammisuli requested review from a team as code owners January 14, 2025 14:53
Comment on lines +77 to +78
skipNxCache?: boolean;
disableRemoteCache?: boolean;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's the reason for disable vs skip here? I feel like it should match with the --skip-nx-cache flag

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yup, I was discussing this with Jason.

@FrozenPandaz FrozenPandaz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add aliases to support all.

// option
skipNxCache
disableNxCache
skipRemoteCache
disableRemoteCache

// env
SKIP_NX_CACHE
DISABLE_NX_CACHE
SKIP_REMOTE_CACHE
DISABLE_REMOTE_CACHE

Comment on lines +195 to +200
output.warn({
title: 'Remote Cache Disabled',
bodyLines: [
'Nx will continue running, but nothing will be written or read from the remote cache.',
],
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Handle this in the old cache as well.

| `--parallel` | string | Max number of parallel processes [default is 3]. |
| `--runner` | string | This is the name of the tasks runner configured in nx.json. |
| `--skipNxCache` | boolean | Rerun the tasks even when the results are available in the cache. (Default: `false`) |
| `--skipRemoteCache` | boolean | Disables the remote cache. (Default: `false`) |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This doesn't show the different aliases? @isaacplmann can we update nx.dev to show all of the aliases here? 🤔

@FrozenPandaz FrozenPandaz merged commit d46761d into master Jan 15, 2025
@FrozenPandaz FrozenPandaz deleted the feature/nxc-1318-add-option-to-skip-all-remote-caches-in-nx branch January 15, 2025 15:33
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jan 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants