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): allow partially resetting workspace #23381

Merged
merged 1 commit into from
Jun 4, 2024
Merged

Conversation

AgentEnder
Copy link
Member

@AgentEnder AgentEnder commented May 14, 2024

Current Behavior

  • nx reset takes no options, and will always shut down the daemon as well as remove all local cache entries. This isn't great, because it means that the next task gets a full cold start when the user may have just needed to restart the daemon to clear up the issue they are facing.
  • The projectGraphCacheDirectory defaults to the same directory as the regular cache directory, which can be a bit confusing when updating it doesn't cause it to go away.

Expected Behavior

  • nx reset allows users to pick what data is deleted
  • .nx/workspace-data is new project graph cache dir

Related Issue(s)

Fixes #

Copy link

vercel bot commented May 14, 2024

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

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Jun 4, 2024 10:07pm

{ name: 'workspaceData', message: 'Workspace Data' },
],
footer: 'Press <space> to select, <return> to submit.',
indicator(state, choice) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is cool. Let's change the indicator in other places.

But when I reset, I don't want to be bothered by a prompt. I just want things reset.

We can keep the granularity flags but let's get rid of the prompt.

Clears all the cached Nx artifacts and metadata about the workspace and shuts down the Nx Daemon:

```shell
nx reset --all
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove the --all flag

Clears the Nx Cache directory. This will remove all local cache entries for tasks, but will not affect the remote cache:

```shell
nx reset --cache
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we make this --only-cache and --only-daemon

@@ -1,11 +1,11 @@
---
title: 'reset - CLI command'
description: 'Clears all the cached Nx artifacts and metadata about the workspace and shuts down the Nx Daemon.'
description: 'Clears cached Nx artifacts and metadata about the workspace and shuts down the Nx onlyDaemon.'
Copy link
Collaborator

Choose a reason for hiding this comment

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

This was unintentionally replaced. Please change it back.

Comment on lines 22 to 30
```shell
nx reset
```

Clears all the cached Nx artifacts and metadata about the workspace and shuts down the Nx Daemon:

```shell
nx reset
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

These are the same.


Type: `boolean`

Clears the Nx onlyCache directory. This will remove all local onlyCache entries for tasks, but will not affect the remote onlyCache.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This wording is off.


Type: `boolean`

Stops the Nx Daemon to reset its internal state.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This could be phrased better.. what about...

Stops the Nx Daemon, it will be restarted fresh when the next Nx command is run.

"19-2-0-move-graph-cache-directory": {
"cli": "nx",
"version": "19.2.0-beta.2",
"description": "Updates the default graph cache directory to .nx/workspace-data",
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
"description": "Updates the default graph cache directory to .nx/workspace-data",
"description": "Updates the default workspace data directory to .nx/workspace-data",

"cli": "nx",
"version": "19.2.0-beta.2",
"description": "Updates the default graph cache directory to .nx/workspace-data",
"implementation": "./src/migrations/update-19-2-0/move-graph-cache-directory"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change the name.

@AgentEnder AgentEnder merged commit 5e39cb0 into master Jun 4, 2024
6 checks passed
@AgentEnder AgentEnder deleted the feat/smol-reset branch June 4, 2024 22:55
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 Jun 11, 2024
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.

None yet

2 participants