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(core): readRawWorkspaceJson should keep workspace cache up to date #12528

Merged
merged 3 commits into from
Oct 11, 2022

Conversation

meeroslav
Copy link
Contributor

@meeroslav meeroslav commented Oct 11, 2022

Current Behavior

Running migrations that use workspace configuration (using readRawWorkspaceJson) on the clean repo (with no files changed) returns no projects.

Expected Behavior

Workspace configuration (using readRawWorkspaceJson) from devkit should return all projects regardless of the state of the git.

Related Issue(s)

Fixes #

@meeroslav meeroslav self-assigned this Oct 11, 2022
@vercel
Copy link

vercel bot commented Oct 11, 2022

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

Name Status Preview Updated
nx-dev ✅ Ready (Inspect) Visit Preview Oct 11, 2022 at 8:49PM (UTC)

Comment on lines 480 to 486
// if (!staticFSWorkspace) {
const staticFSWorkspace = buildWorkspaceConfigurationFromGlobs(
nxJson,
[...globForProjectFiles(tree.root, nxJson)],
(file) => readJson(tree, file)
);
// }
Copy link
Member

Choose a reason for hiding this comment

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

We can't just remove this imho, this function gets called frequently when a generator calls readProjectConfiguration and the glob op is .5 second each call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I revert that bunch of tests fails.

Could this mean that those tests were faulty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem occurs because the workspace gets cached between test runs.
So depending on the order of invocation projects.size has a different value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this discussion was resolved, merging it in

@meeroslav meeroslav merged commit ad79453 into nrwl:master Oct 11, 2022
@meeroslav meeroslav deleted the fix-read-raw-workspace branch October 11, 2022 22:16
FrozenPandaz pushed a commit that referenced this pull request Oct 14, 2022
@github-actions
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 Mar 17, 2023
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.

2 participants