Skip to content

Add license scan diff investigation skill - #9454

Merged
mthalman merged 4 commits into
dotnet:mainfrom
mthalman:mthalman-license-scan-agent-skill
Sep 18, 2026
Merged

mthalman merged 4 commits into
dotnet:mainfrom
mthalman:mthalman-license-scan-agent-skill

Conversation

@mthalman

Copy link
Copy Markdown
Member

Problem

Source-build license baseline updates require manual investigation to determine whether each ScanCode finding represents an allowed free and open-source license, a false positive, non-applicable metadata, an intentional baseline entry, or content that must be remediated.

The generated baseline records what ScanCode detected but does not make that classification. Investigations also need to correlate baseline changes with raw CI evidence, apply the same filtering semantics as the source-build test, and verify that proposed allowed-license or exclusion changes fully resolve each finding.

Description

Add a repository-scoped skill for investigating source-build license scan diffs and generated baseline-update pull requests.

Add a shared LicenseScanUtilities project so the source-build test and analyzer use the same ScanCode contracts, expression decomposition, exclusion parsing, path normalization, and glob-matching behavior. Keep TestUtilities independent.

@mthalman
mthalman requested review from lbussell and a lite review from Copilot September 17, 2026 14:02
@mthalman
mthalman requested review from a team as code owners September 17, 2026 14:02
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new analyzer script has a couple of correctness/operability issues (silent duplicate path overwrites and potentially unbounded output size) that should be fixed before merging.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR adds a repository-scoped skill and accompanying tooling to make source-build license scan baseline/exclusion diffs deterministic to analyze, by introducing shared models/policy utilities and a file-based analyzer app that correlates baseline deltas with raw ScanCode evidence.

Changes:

  • Add a new .github/skills/license-scan-diff-investigation skill describing a repeatable investigation workflow and a dotnet run --file analyzer script.
  • Introduce test/LicenseScanUtilities with shared ScanCode/baseline JSON models and policy helpers (expression splitting, exclusion parsing, glob/path normalization).
  • Update LicenseScanTests to use the shared baseline model and expression-splitting helper.
File summaries
File Description
test/Microsoft.DotNet.SourceBuild.Tests/Microsoft.DotNet.SourceBuild.Tests.csproj References the new shared LicenseScanUtilities project from source-build tests.
test/Microsoft.DotNet.SourceBuild.Tests/LicenseScanTests.cs Switches to shared ScanCode/baseline contracts and shared expression splitting logic.
test/LicenseScanUtilities/LicenseScanUtilities.csproj New shared utilities project (TFM-aligned with bundled test framework) and globbing dependency.
test/LicenseScanUtilities/ScanCodeModels.cs Adds shared JSON models for baseline (LicenseScanDocument) and raw ScanCode results (ScanCodeDocument).
test/LicenseScanUtilities/LicenseScanPolicy.cs Adds shared parsing/matching helpers for expressions, exclusions, and path normalization.
.github/skills/license-scan-diff-investigation/SKILL.md New repository-scoped skill documentation defining the investigation workflow and safety rules.
.github/skills/license-scan-diff-investigation/scripts/LicenseScanAnalyzer.cs New file-based analyzer app for comparing baseline/exclusion/allowed-license deltas and attaching ScanCode evidence.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@mthalman
mthalman requested a review from lbussell September 17, 2026 20:34
@mthalman
mthalman merged commit 12b51dc into dotnet:main Sep 18, 2026
11 checks passed
@mthalman
mthalman deleted the mthalman-license-scan-agent-skill branch September 18, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants