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(Turborepo): Handle new packages in lockfile comparisons #8127
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
8 Ignored Deployments
|
🟢 Turbopack Benchmark CI successful 🟢Thanks |
🟢 CI successful 🟢Thanks |
Now build and verify that only the new package is in scope | ||
Note that we need --skip-infer because we've now installed a local | ||
turbo in this repo | ||
Note that we need to disable path conversion because on windows, git bash considers | ||
'//' to be an escape sequence translating to '/'. | ||
$ MSYS_NO_PATHCONV=1 ${TURBO} --skip-infer build -F '[HEAD]' -F '!//' --dry=json | jq '.packages' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this env var is just for the -F '!//
flag on CLI, can you set it globally with this explanation?
It's very likely that this will come up again, especially as we do more work with root packages (e.g. tracing deps through root package.json)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it, and it appears we are relying on this behavior in other parts of our scripts. It might be possible to set it up properly, but I think that's beyond the scope of this particular PR.
Description
When comparing lockfiles between revisions to identify what packages have been affected, we treated missing packages in the previous lockfile (added in the new lockfile) as errors, and fell back to considering all packages as affected. This change adds a boolean to determine what the behavior should be when we can't find a package that we expect. When building the package graph, it continues to be an error, as well as when tracing the dependencies of a package we've already found in the lockfile. However, for the first round of packages that we look for in a previous lockfile, we ignore missing packages. This allows us to more gracefully handle comparisons between commits that add new packages.
Testing Instructions
Added an integration test inspired by the repro from the linked issue.
Fixes #8125