You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The existing .NET coverage threshold protects core assemblies in aggregate, but it does not tell authors whether the executable lines they changed are at least as well tested as the implementation overall.
Description & Review Guide
What are the major changes? Add a repository skill for running the .NET unit suite, merging Cobertura reports, and comparing changed executable C# lines with all tracked implementation lines measured by the same run. Use the same PowerShell comparison in a PR-only job fed by the existing Linux coverage artifact.
What is the impact of these changes? The job reports percentages and uncovered locations without affecting the existing required check. Missing coverage for a changed source file is reported as inconclusive rather than as a pass.
What do you want reviewers to focus on? The comparison denominator, path and line matching, and the separation between the advisory result and the existing coverage gate.
Verified the comparison with pwsh -NoProfile -File against Git/Cobertura fixtures and an actual CI coverage artifact. git diff --check passed. actionlint .github/workflows/dotnet-build-and-test.yml reported only the same two findings as main, for existing GitHub Actions features.
dotnet test --solution $solution -f net11.0 -c Release -p:CopilotSkipCliDownload=true --coverage --coverage-output-format cobertura --coverage-settings (Join-Path $PWD 'tests/coverage.runsettings') --results-directory $results --ignore-exit-code 8 passed against the filtered unit solution: 11,850 passed, 84 skipped, and none failed. dotnet tool exec dotnet-reportgenerator-globaltool@5.6.1 -- "-reports:$results/**/*.cobertura.xml" "-targetdir:$merged" '-reporttypes:Cobertura' merged all 34 reports. The comparison reported no changed implementation lines for this PR, as expected.
Related Issue
Related to #3391. This is an advisory changed-line check, not the required whole-solution regression gate described in that issue, so it leaves the issue open.
AI Assistance
No material AI assistance was used.
This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.
AI assistance details: Comparison script, workflow, repository skill, test fixtures, and PR description.
Contribution Checklist
The code builds clean without any errors or warnings
All unit tests pass, and I have added new tests where possible
This PR links to an agreed issue with no competing open PR, or the Related Issue section documents a trivial-change or repository-automation exception.
This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and the title prefix in sync automatically.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The advisory is skipped when dotnet-test fails, preventing changed-line coverage comparisons even when usable coverage artifacts have already been uploaded.
Adds advisory changed-line coverage reporting for .NET, complementing the existing coverage gate without implementing the blocking regression gate proposed in #3391.
Changes:
Compares changed executable C# lines with global coverage from the same report.
Adds a non-blocking PR job using the existing Linux coverage artifact.
Documents local coverage generation and result handling.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
PowerShell 7.3 can leave failed Git calls unhandled, causing an unavailable base ref to produce a misleading no-changes result; the script and documentation need a PowerShell 7.4 minimum.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Require PowerShell 7.4 for native-command error handling
In PowerShell 7.3, native-command error handling is experimental, so setting $PSNativeCommandUseErrorActionPreference does not stop failed Git calls unless the feature is enabled. An unavailable base ref can therefore produce a misleading “No added or modified .NET implementation lines” result instead of failing. Require PowerShell 7.4, where this feature is stable, and update the minimum version in .github/skills/dotnet-change-coverage/SKILL.md:15 to match.
Addressed the PowerShell compatibility finding in 7c8a286. The script and skill now require PowerShell 7.4 or later. I verified that an invalid base ref fails with a nonzero exit code and does not report a no-change result.
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
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.
Motivation & Context
The existing .NET coverage threshold protects core assemblies in aggregate, but it does not tell authors whether the executable lines they changed are at least as well tested as the implementation overall.
Description & Review Guide
Verified the comparison with
pwsh -NoProfile -Fileagainst Git/Cobertura fixtures and an actual CI coverage artifact.git diff --checkpassed.actionlint .github/workflows/dotnet-build-and-test.ymlreported only the same two findings asmain, for existing GitHub Actions features.dotnet test --solution $solution -f net11.0 -c Release -p:CopilotSkipCliDownload=true --coverage --coverage-output-format cobertura --coverage-settings (Join-Path $PWD 'tests/coverage.runsettings') --results-directory $results --ignore-exit-code 8passed against the filtered unit solution: 11,850 passed, 84 skipped, and none failed.dotnet tool exec dotnet-reportgenerator-globaltool@5.6.1 -- "-reports:$results/**/*.cobertura.xml" "-targetdir:$merged" '-reporttypes:Cobertura'merged all 34 reports. The comparison reported no changed implementation lines for this PR, as expected.Related Issue
Related to #3391. This is an advisory changed-line check, not the required whole-solution regression gate described in that issue, so it leaves the issue open.
AI Assistance
AI assistance details: Comparison script, workflow, repository skill, test fixtures, and PR description.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and the title prefix in sync automatically.