Repository navigation
Split SBRP license scanning into separate sub-scans - #6009
Merged
mthalman merged 6 commits intoApr 15, 2026
Merged
Conversation
Split the source-build-reference-packages license scan into separate pipeline jobs - one per subdirectory under src/source-build-reference-packages/src/ plus a root scan with --ignore src for non-src content. This avoids the scancode timeout caused by processing too many files in a single run (dotnet/source-build#5470). Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR splits the source-build-reference-packages license scan into multiple smaller scans to avoid scancode timeouts by scanning per-subdirectory jobs plus a root scan with ignores.
Changes:
- Update license-scan test harness to support per-scan-target baselines and optional scan ignore patterns.
- Update the AzDO pipeline template to generate a matrix with additional sub-scan jobs and pass ignore patterns into the test run.
- Adjust an existing license baseline JSON to reflect the new scan root/path layout.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/Microsoft.DotNet.SourceBuild.Tests/assets/LicenseScanTests/Licenses.source-build-reference-packages.externalPackages.json | Updates expected paths in the baseline to match the new sub-scan root. |
| test/Microsoft.DotNet.SourceBuild.Tests/Microsoft.DotNet.SourceBuild.Tests.csproj | Passes optional ignore patterns into runtime config for tests. |
| test/Microsoft.DotNet.SourceBuild.Tests/LicenseScanTests.cs | Adds scan-target naming logic and merges default + pipeline-provided ignore patterns; scopes exclusions per scan. |
| test/Microsoft.DotNet.SourceBuild.Tests/Config.cs | Adds configuration access for ignore patterns. |
| eng/pipelines/templates/stages/vmr-license-scan.yml | Builds a matrix that splits source-build-reference-packages into root + per-subdirectory scan jobs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Derive repoName from _relativeScanPath instead of the absolute path to avoid matching an earlier src/ segment in the filesystem hierarchy. - Build scancode ignore patterns dynamically from subdirectory names instead of ignoring 'src' wholesale, so files directly under src/ (e.g. SourceBuildAssemblyMetdata.cs) are still scanned by the root job. Co-authored-by: Copilot <[email protected]>
The semicolons in the SourceBuildTestsLicenseScanIgnorePatterns value were interpreted by bash as command separators since the script block uses YAML folded scalar (single line). Switch to comma as the delimiter in both the pipeline and C# code. Co-authored-by: Copilot <[email protected]>
MSBuild interprets commas in /p: values as property separators. Quote the entire argument so the comma-delimited list is treated as a single property value. Co-authored-by: Copilot <[email protected]>
Commas are special to MSBuild even when quoted on the command line. Switch to space-delimited patterns which are safe for bash, MSBuild, and JSON. The quoted argument ensures bash treats the space-separated list as a single value. Co-authored-by: Copilot <[email protected]>
ellahathaway
approved these changes
Apr 15, 2026
|
|
||
| # Repos whose src/ subdirectories should be scanned as separate jobs. | ||
| # The repo root is also scanned with --ignore to skip subdirectories covered by sub-scans. | ||
| splitRepos="source-build-reference-packages" |
Contributor
There was a problem hiding this comment.
This is will need to be updated once #6044 is merged. We'd also need to update the json filename in assets, for this repo.
Or, maybe I could just pull this PR into my PR instead, and make additional changes in there.
mthalman
added a commit
to mthalman/dotnet
that referenced
this pull request
Apr 15, 2026
Apply the matrix sub-scanning logic from PR dotnet#6009 to the existing vmr-license-scan.yml pipeline on release/9.0.1xx. On main, this file lived at eng/pipelines/templates/stages/vmr-license-scan.yml (which doesn't exist on this branch). Co-authored-by: Copilot <[email protected]>
This was referenced Apr 15, 2026
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.
Split the source-build-reference-packages license scan into separate pipeline jobs - one per subdirectory under src/source-build-reference-packages/src/ plus a root scan with --ignore src for non-src content. This avoids the scancode timeout caused by processing too many files in a single run (dotnet/source-build#5470).
Fixes dotnet/source-build#5470