-
Notifications
You must be signed in to change notification settings - Fork 695
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
Set CPM metadata during preview restore when installing a package in Visual Studio #4642
Conversation
0dee0fc
to
e344062
Compare
FYI @tmeschter this is the change needed to get VS to actually install the package with CPM enabled. Technically you can build this branch and deploy it to your local experimental instance if you want to also play around with changes on your end. If you're interested in trying that and have problems, let me know. |
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 think we're missing one scenario.
It might be a good idea to add cross tool no-op tests for these scenarios. NuGet.Client/test/EndToEnd/tests/NetCoreProjectTest.ps1 Lines 165 to 187 in 0da9fda
|
I think I need to open a new item to add some end-to-end tests for CPM. The scenario to test here would be to install a new package and check if a restore immediately after no-ops. But there isn't any existing end-to-end tests that configure CPM as far as I can tell. Are you okay with me adding some stuff like this later? I did test the scenario manually and the restore no-ops. |
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.
The immediate change looks fine.
We might need to update the package spec of the parents if they are in the same context to prevent random failures at update time.
I filed NuGet/Home#11912 for a future effort to see if we can include other affected projects in the install/update package so that after changes are committed, restore is a no-op. @nkolev92 This is ready for final review |
I've also filed an issue to work on end-to-end tests for CPM: NuGet/Home#11913 |
@NuGet/nuget-client please review if you want, otherwise I'll merge this afternoon. |
Bug
Fixes: NuGet/Home#11828
Regression? Last working version:
Description
This code is used to modify the in-memory representation of the package spec and is modified to do a preview restore before committing changes via project system. The code needs to set the
VersionCentrallyManaged
property if central package management is enabled otherwise the restore fails since it thinks the user set the version in a project.PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation