-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Use NuGet.config for restore during package testing #53837
Conversation
Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer Issue DetailsFixes #53810
|
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.
LGTM assuming that's the right location and the file will be considered during restore.
https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-transport/nuget/v3/index.json; | ||
$(LocalPackagesPath) | ||
</RestoreSources> | ||
<RestoreAdditionalProjectSources>$(LocalPackagesPath)</RestoreAdditionalProjectSources> |
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.
nit: why not replace the LocalPackagesPath property with RestoreAdditionalProjectSources?
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 LocalPackagesPath
is easier to remember when running package tests locally?
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.
That property isn't supposed to be passed in by the user. It's already passed in and by default points to the artifacts packages dir:
<TestRestoreCommand>$(TestRestoreCommand) /p:LocalPackagesPath=$(ArtifactsPackagesDir)</TestRestoreCommand> |
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.
Good point. For some reason I thought it was for local testing, I forgot we generated the test restore command.
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.
Specifying known properties as global properties can make them effectively readonly in the evaluation, which could break other props/targets which were trying to append to them. This was the case with RestoreSources previously. I'm inclined to keep these seperate since it's not the intent of this to specify all additional restore sources, only one that we want to add.
@@ -45,6 +45,9 @@ | |||
<TestSupportFiles Include="$(LibrariesProjectRoot)shims\netfxreference.props"> | |||
<DestinationFolder>$(TestToolsDir)</DestinationFolder> | |||
</TestSupportFiles> | |||
<TestSupportFiles Include="$(RepoRoot)NuGet.config"> | |||
<DestinationFolder>$(TestSupportDir)</DestinationFolder> |
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.
Are you expecting this to be picked up by the test project as well or just by test.msbuild? The former would not see this file.
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.
There appears to be no directory in common with Helix payload structure and local structure. If this is changed to $(TestDir)
it produces the correct layout locally but that's not present in helix :/. I guess we only need it to be present in Helix since that's the only place where it wouldn't find it in directory root. (since artifacts is below).
I'm debating just removing nuget.config entirely. We actually don't need to hit any feeds except nuget.org. The only place we need an additional feed is
runtime/src/libraries/pkg/test/packageSettings/System.IO.Ports/workaroundDowngrade.targets
Line 4 in 54fdd26
<PackageReference Include="runtime.native.System.IO.Ports" Version="$(runtimenativeSystemIOPortsVersion)" NoWarn="NU1605" /> |
Thoughts?
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.
Why not just put the NuGet.config into a central location and point to it during the restore? There is a switch available for that. I'm changing the layout slightly with #53439 so I would recommend to wait for that to go in (which hopefully will in 1-2h).
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.
Any thoughts on this NuGet.config being more than we need for package restore in testing?
We actually don't need to hit any feeds except nuget.org
In fact, we probably don't want our packages depending on things from the internal feeds.
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.
Any thoughts on this NuGet.config being more than we need for package restore in testing?
Nope I think that's fine. We follow the same approach in the installer tests in the runtime repo (they copy the NuGet.config over and add to it).
In fact, we probably don't want our packages depending on things from the internal feeds.
That's right, but we don't reference any internal feeds from our NuGet.config.
Actually, if you remove Helix this PR is no longer needed, since NuGet.config will already be used. Closing this one. |
Oh you were couple seconds faster than me commenting :D |
I had just reached your PR in my notifications inbox :) |
Fixes #53810