Skip to content

fix(nx-mcp): workspace tools shouldn't be available if cwd is not an nx workspace #2540

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

Merged
merged 2 commits into from
Jun 2, 2025

Conversation

MaxKless
Copy link
Collaborator

@MaxKless MaxKless commented May 31, 2025

falling back to the cwd as the workspace path is great but it should check for an nx workspace. Otherwise we will have a lot of nonfunctional tools.

Copy link

nx-cloud bot commented May 31, 2025

View your CI Pipeline Execution ↗ for commit 3a6dca1.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e-ci,ty... ✅ Succeeded 2m 59s View ↗
nx-cloud record -- yarn nx-cloud conformance:check ✅ Succeeded 3s View ↗
nx-cloud record -- yarn nx sync:check ✅ Succeeded 3s View ↗
nx-cloud record -- ./gradlew :intellij:ktfmtCheck ✅ Succeeded 5s View ↗
nx-cloud record -- ./gradlew projectReportAll ✅ Succeeded 3m 24s View ↗
nx affected --targets=build,test,e2e-ci --confi... ✅ Succeeded 15m 50s View ↗

☁️ Nx Cloud last updated this comment at 2025-06-02 09:27:20 UTC

rmSync(join(e2eCwd, workspaceName), { recursive: true, force: true });
});

it('should not have workspace tools when pointing to non-existent path', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

The test description mentions a "non-existent path" but the test is actually checking a different directory path (/this/path/does/not/exist) than the one created in the setup (at join(e2eCwd, workspaceName)). This makes the test description accurate, but it might be clearer to rename this test suite from "with non-existent path" to something like "with command pointing to non-existent path" to better reflect that the test is validating behavior when the CLI is invoked with a path that doesn't exist, rather than testing from within a non-existent directory.

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

@MaxKless MaxKless merged commit 3bb8ac2 into master Jun 2, 2025
6 checks passed
@MaxKless MaxKless deleted the mcp-cwd-non-nx branch June 2, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants