-
Notifications
You must be signed in to change notification settings - Fork 693
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
Map SourceBranchName from sourcelink to RepositoryBranch for NuGet pack #5923
Map SourceBranchName from sourcelink to RepositoryBranch for NuGet pack #5923
Conversation
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.
This is pretty much exactly what I was hoping to see 👍
I'm going to wait to publish this until the SourceLink PR lands in case things change, specifically of interest are:
Edit: Published to get eyes / feedback on this; it's still a chance that I'll need to update this if the SourceLink PR change's its property name. |
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.
Just a question about the potential risk here.
For the NuGet shepherd, let's wait for a review from @tmat before merging. |
Is there a potential for private info leak if we publish the branch name by default? For Repository URL we require the project to explicitly set NuGet.Client/src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.targets Lines 292 to 293 in 60974f1
Branch name might potentially include code names, etc. |
Good point - the commit sha is unique enough to not worry, but the branch could be behind the existing |
Happy to re-use the existing flag, mostly was bringing up the possibility of a new flag for completeness. |
Would pack even set the repository details if the repository url was never provided? |
Edit: This comment is incorrect; see below. |
Perfect, that works for me. That's also the pattern we've used for the SDK Container source control information linkages. |
Sounds good. Do we have a test? |
Should also add a note to the documentation: https://github.com/dotnet/sourcelink/blob/669979bf371a587c908f732499df0ed883cd5d6c/docs/README.md?plain=1#L44 |
We don't have a test covering this part, and when I add one I'm not seeing the same behavior I see from the command line. I'm looking into it, but let's hold off on merging until we understand the difference. Edit: OK I at least understand the difference. NuGet Package Explorer doesn't show the raw nuspec XML and seems to hide the |
…yUrl This is a follow up PR based on NuGet/NuGet.Client#5923. Update the README to specify that publishing `$(SourceBranchName)` into `$(RepositoryBranch)' is also controlled by the `$(PublishRepositoryUrl)` property.
Available @ dotnet/sourcelink#1252 |
…yUrl (#1252) This is a follow up PR based on NuGet/NuGet.Client#5923. Update the README to specify that publishing `$(SourceBranchName)` into `$(RepositoryBranch)' is also controlled by the `$(PublishRepositoryUrl)` property.
Ok, we've got sourcelink merged and flowing to the dotnet/sdk again, so I think this is good to review+merge! |
Bug
Fixes: NuGet/Home#13625
Description
This is a companion PR for dotnet/sourcelink#1248. Once that change lands and sourcelink is emitting the source branch name, this PR consumes that value and sets it to
RepositoryBranch
as part of NuGet pack.PR Checklist