-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
dotnet tool install skip unlisted version #28951
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
This is great! I'd love to see a test validating the behavior though - I think that would require getting known packages with the expected unlisted/listed statuses added to the internal feeds. Scheduling-wise, @marcpopMSFT this rides the line between a fix and an feature - I think it's what users expect out of NuGet so I'd be happy to see this in 7.0.2xx rather than waiting for 8.0.1xx (which is what main is targeted for). |
Thanks for the feedback! Could you point me to where these internal feeds are located? Is there an example test that is using this internal feed you are talking about? |
The feeds I mention are defined in the nuget.config in the root of the repo, so if you had sample packages that you wanted to use for a test, we could coordinate to get those versions downloaded to an appropriate feed (we have to communicate with an internal team for this), and then your test would be good to go. @dotnet/domestic-cat is this an acceptable plan? |
I did create this package |
@baronfel sounds like I can't test it by myself. Would it be reasonable to get this PR in and file another issue for the testing part? |
ping? I'm affected by issue #24037 and would prefer this reviewed/merged instead of having to write a workaround. |
Thanks for the ping, @knocte - I dropped the ball on this one. Need to get a listed and unlisted package to test with into MS internal feeds, but we can't just take random packages. I'll pick this up again and work with the internal team to get tool packages created and pushed. |
@JiaqiWang18 is there source for |
@JiaqiWang18 ping? |
@baronfel Yes, I do have the source code. |
ping? :) |
Investigating |
Why was author information not preserved? |
Not sure what you mean. GH still considers jiaqiwang18 the author of this PR. It lists Annie as the merger as someone from the team has to merge. BTW, we chatted offline and investigated ways to test this using our internal AzDO feeds but were not able to do so and decided it wasn't worth investigating further for a regression test. |
Right, but that's just GH, I'm referring to git.
Normally when a PR is merged, there are 2 commits: the one from the merger and the real commit of the PR. In this case it has been squashed to one, but when you select this option in GH, it normally preserves author information (the one you extract with git tools, such as git log), why didn't it preserve it this way? I guess you used another tool to merge. I don't think this is an acceptable policy. |
Interesting. That seems like a bug in GH or maybe just unintended behavior of which option @JL03-Yue chose in the dropdown menu (GH includes three options when merging). |
I expect this was merged with 'Create a merge commit'. All the original commits - with correct author information - are there in the actual history: As an aside - does the sdk repo have a general policy on which option to use? In runtime, we actually only allow squash and merge as we find that makes for simpler / easier to understand history. |
SDK has to use the merge commit option for the inter-branch codeflow as otherwise it gets confused about commits that were modified/reverted so I've left the default as that. You're right though that squash and merge is better for history most of the time. |
I think this change caused an issue I saw whilst building net8 rc1 base images in my companies build infrastructure. A workaround is to specify the version flag, e.g. |
@pokdeep please file a separate issue with the details and we'll take a look. |
Fixes #24037
Use the
NugetToolSearchApiRequest
to get the latest listed package version indotnet tool install <PACKAGE_ID>
when--version
is not supplied.Manual Testing
Created a test tool
jackywang118.botsay
with two versions where the most recent version2.0.0
is unlisted.Run
dotnet tool install jackywang118.botsay
, version1.0.0
should be installedA request to https://azuresearch-usnc.nuget.org/query?q=jackywang118.botsay&packageType=dotnettool&semVerLevel=2.0.0 is made to get the most recent listed package version