Skip to content

fix(core): update getTouchedProjectsFromLockFile to handle deleted/moved projects correctly #31361

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

Conversation

laneysmith
Copy link
Contributor

@laneysmith laneysmith commented May 27, 2025

Current Behavior

This fixes a case that was not handled in #31091.

Currently, for pnpm projects with 'projectsAffectedByDependencyUpdates': 'auto', when a project is deleted from the workspace or moved to a different directory, it is added to the getTouchedProjectsFromLockFile list as undefined. This results in the following error when you run commands that calculate affected projects:

Error: Invalid project name is detected: "undefined"
    at addAffectedNodes ...

Expected Behavior

getTouchedProjectsFromLockFile should only return project names for existing projects.
Because the changedProjectPaths entry for deleted/moved projects will not map to a project in the projectGraphNodes object, we should filter them out of the getProjectsNamesFromPaths result.

Related Issue(s)

None that I'm aware of.


I spent some time trying to debug the failing nx release version plans › should pick new versions based on version plans using programmatic api e2e test and am not seeing how my changes could have caused the TypeError: yargs.version is not a function failure. 😕 I'd appreciate some help debugging that one! 🙏
Update: it eventually passed after rebase with no changes on my end. 🤷

Copy link

vercel bot commented May 27, 2025

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

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview May 30, 2025 7:23pm

@laneysmith laneysmith changed the title fix(core): update getTouchedProjectsFromLockFile to handle deleted pr… fix(core): update getTouchedProjectsFromLockFile to handle deleted/move projects correctly May 27, 2025
Copy link
Contributor

nx-cloud bot commented May 27, 2025

View your CI Pipeline Execution ↗ for commit 38f50c6.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 41m 24s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 16s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 5s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 4s View ↗
nx documentation ✅ Succeeded 1m View ↗

☁️ Nx Cloud last updated this comment at 2025-05-30 19:56:23 UTC

@laneysmith laneysmith changed the title fix(core): update getTouchedProjectsFromLockFile to handle deleted/move projects correctly fix(core): update getTouchedProjectsFromLockFile to handle deleted/moved projects correctly May 27, 2025
@laneysmith laneysmith force-pushed the laneys/fix-pnpm-projects-affected-by-dependency-updates branch 4 times, most recently from d8a205d to 7297f82 Compare May 27, 2025 23:05
@laneysmith laneysmith marked this pull request as ready for review May 28, 2025 01:14
@laneysmith laneysmith requested a review from a team as a code owner May 28, 2025 01:14
@laneysmith laneysmith requested a review from MaxKless May 28, 2025 01:14
@laneysmith laneysmith force-pushed the laneys/fix-pnpm-projects-affected-by-dependency-updates branch from 7297f82 to 38f50c6 Compare May 30, 2025 19:07
@AgentEnder AgentEnder merged commit 88c5196 into nrwl:master Jun 2, 2025
7 checks passed
FrozenPandaz pushed a commit that referenced this pull request Jun 3, 2025
…ved projects correctly (#31361)

(cherry picked from commit 88c5196)
Copy link

github-actions bot commented Jun 8, 2025

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

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy