Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

Cammisuli
Copy link
Member

@Cammisuli Cammisuli commented Jan 9, 2025

Current Behavior

Expected Behavior

Related Issue(s)

Fixes #

Copy link

vercel bot commented Jan 9, 2025

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

Copy link

nx-cloud bot commented Jan 9, 2025

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

@@ -90,6 +91,11 @@ export function withRunOptions<T>(yargs: Argv<T>): Argv<T & RunOptions> {
type: 'boolean',
default: false,
})
.options('skipRemoteCache', {
type: 'boolean',
describe: 'Do not save cache results to the remote cache.',
Copy link
Collaborator

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.',

@@ -75,6 +75,7 @@ export interface DefaultTasksRunnerOptions {
lifeCycle: LifeCycle;
captureStderr?: boolean;
skipNxCache?: boolean;
skipRemoteCache?: boolean;
Copy link
Collaborator

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

Copy link
Collaborator

@FrozenPandaz FrozenPandaz left a comment

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
Collaborator

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.

@@ -103,6 +103,7 @@ Print the task graph to the console:
| `--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
Collaborator

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
6 checks passed
@FrozenPandaz FrozenPandaz deleted the feature/nxc-1318-add-option-to-skip-all-remote-caches-in-nx branch January 15, 2025 15:33
Copy link

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