[SBRP Usage Report] Add target pack support and scan project.assets.json files for package downloads#47916
Merged
MichaelSimons merged 3 commits intodotnet:mainfrom Mar 31, 2025
Conversation
9a49ca7 to
e89f88d
Compare
3 tasks
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the SBRP Usage Report task by adding support for target packs and scanning project.assets.json files to capture package download information.
- Updates the ReadSbrpPackages method to use a new directory structure.
- Introduces a new TrackPackageReference method to consolidate package reference tracking.
- Modifies package scanning to process DownloadDependencies in addition to traditional library references.
Files not reviewed (1)
- src/SourceBuild/content/eng/Versions.props: Language not supported
Comments suppressed due to low confidence (1)
src/SourceBuild/content/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/WriteSbrpUsageReport.cs:191
- The use of '[]' to initialize referencedTfms is not valid C# syntax. Consider replacing it with 'new HashSet()' to correctly instantiate an empty HashSet.
referencedTfms = [];
mthalman
reviewed
Mar 28, 2025
| } | ||
| } | ||
|
|
||
| private void TrackPackageReference(string lockFilePath, string? name, string? version, IEnumerable<string>? tfms) |
Member
There was a problem hiding this comment.
I'd prefer to have an empty enumerable rather than it be nullable. That should simplify the implementation a bit.
ViktorHofer
approved these changes
Mar 29, 2025
mthalman
approved these changes
Mar 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes dotnet/source-build#4924
Requires dotnet/source-build-assets#1210 which is flowing in with #47917 and a rebootstrap.