Skip to content
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

[SBRP Usage Report] Add target pack support and scan project.assets.json files for package downloads #47916

Merged
merged 3 commits into from
Mar 31, 2025

Conversation

MichaelSimons
Copy link
Member

@MichaelSimons MichaelSimons commented Mar 26, 2025

Fixes dotnet/source-build#4924

Requires dotnet/source-build-reference-packages#1210 which is flowing in with #47917 and a rebootstrap.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Request triage from a team member labels Mar 26, 2025
@MichaelSimons MichaelSimons marked this pull request as ready for review March 28, 2025 20:44
@Copilot Copilot bot review requested due to automatic review settings March 28, 2025 20:44
@MichaelSimons MichaelSimons requested review from a team as code owners March 28, 2025 20:44
@MichaelSimons MichaelSimons removed the request for review from a team March 28, 2025 20:44
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 = [];

}
}

private void TrackPackageReference(string lockFilePath, string? name, string? version, IEnumerable<string>? tfms)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to have an empty enumerable rather than it be nullable. That should simplify the implementation a bit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with 5290ff0.

@MichaelSimons MichaelSimons requested a review from mthalman March 28, 2025 21:48
@MichaelSimons MichaelSimons merged commit 532dc9d into dotnet:main Mar 31, 2025
39 checks passed
@MichaelSimons MichaelSimons deleted the sbrp-report-downloads branch March 31, 2025 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update SBRP usage report to scan for package downloads
3 participants