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

fix(misc): ensure plugins are not creating workspace context while creating nodes #26253

Merged
merged 9 commits into from
May 31, 2024

Conversation

AgentEnder
Copy link
Member

…eating nodes

Current Behavior

Some plugins utilize globWithWorkspaceContext to perform a glob search during createNodes. This works fine without plugin isolation, and would still "work" with it, but when plugins are isolated they don't share a workspace context. Combine this with the daemon and we have issues.

  • Isolated plugin's workspace context is not updated by file updates, meaning glob searches can return deleted files
  • The workspace context has to be created multiple times, potentially resulting in slow FS times as the trees are traversed.

Expected Behavior

If the daemon is enabled, its workspace context is utilized when performing glob searches

Related Issue(s)

Fixes #

@AgentEnder AgentEnder requested review from a team, FrozenPandaz, xiongemi and Coly010 as code owners May 29, 2024 22:23
@AgentEnder AgentEnder requested a review from isaacplmann May 29, 2024 22:23
Copy link

vercel bot commented May 29, 2024

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

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview May 31, 2024 10:08pm

@@ -25,6 +26,8 @@ describe('@nx/jest/plugin', () => {
configFiles: [],
};

setWorkspaceRoot(tempFs.tempDir);
Copy link
Member

Choose a reason for hiding this comment

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

nit: is this needed? AFAICT, we already do this in the TempFs constructor: https://github.com/nrwl/nx/blob/master/packages/nx/src/internal-testing-utils/temp-fs.ts#L30-L32.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, this came from the throw 💩 at the wall and see what sticks debugging portion of development 😅.

I've confirmed its not needed, and removed.

});

it('should run successfully', async () => {
await expect(filterGenerator(tree, options)).resolves.not.toThrowError();
await filterGenerator(tree, options);
expect(true).toBe(true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove please

scripts/unit-test-setup.js Show resolved Hide resolved
@AgentEnder AgentEnder merged commit 6f22300 into master May 31, 2024
6 checks passed
@AgentEnder AgentEnder deleted the fix/daemon-glob branch May 31, 2024 22:54
Copy link

github-actions bot commented Jun 7, 2024

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

3 participants