Repository navigation
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4d46afcf-3229-49c2-83ca-e59c727e3fe8
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4d46afcf-3229-49c2-83ca-e59c727e3fe8
There was a problem hiding this comment.
🟡 Changes recommended
Coverage filtering can suppress relevant findings by missing projects that link changed source files and omitting shared tooling and build paths from the full-comment fallback.
2 open issues
What changed in this PR
This PR focuses coverage-bot comments on projects relevant to a pull request while preserving repository-wide validation and the complete saved coverage report.
Changes:
- Filters comments by changed-file ownership and direct source references from changed tests, with shared-change fallbacks.
- Adds coverage-script tests and CI result publishing, deferring test failure until after other build steps.
- Fetches the PR merge commit’s parent for changed-file comparisons.
| File | Description |
|---|---|
| eng/scripts/ValidateProjectCoverage.Tests.ps1 | Tests filtering, full-report preservation, and shallow-checkout comparisons. |
| eng/scripts/ValidateProjectCoverage.ps1 | Separates filtered comments from repository-wide coverage reporting. |
| eng/pipelines/templates/VerifyCoverageReport.yml | Supplies the comparison revision for public PR builds. |
| eng/pipelines/templates/BuildAndTest.yml | Runs pinned Pester tests and publishes results with failure checks. |
| azure-pipelines.yml | Increases coverage checkout depth to include the parent commit. |
| azure-pipelines-unofficial.yml | Increases coverage checkout depth to include the parent commit. |
| azure-pipelines-public.yml | Increases coverage checkout depth to include the parent commit. |
Review effort: Balanced
| $owners = @($projects | Where-Object { | ||
| $fullPath.StartsWith($_.DirectoryName + [System.IO.Path]::DirectorySeparatorChar, [System.StringComparison]::Ordinal) | ||
| } | Sort-Object { $_.DirectoryName.Length } -Descending) |
There was a problem hiding this comment.
I don't think doing this is worth it, especially since it requires attempting to interpret MSBuild wildcards.
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1671414&view=codecoverage-tab |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4d46afcf-3229-49c2-83ca-e59c727e3fe8
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1673141&view=codecoverage-tab |

Why
The coverage bot currently reports findings for every project in the repository on each PR and each push, including coverage shortfalls and threshold-increase suggestions in projects the PR did not touch. This buries relevant feedback in unrelated findings and can make existing coverage gaps look like regressions introduced by the PR.
Filter the GitHub comment to PR-relevant projects so authors can focus on actionable feedback, while keeping repository-wide validation and the complete Azure DevOps coverage report unchanged.
Changes
If you think running script tests on CI or even having script tests in the first place is unnecessary, I can remove those.
Validation
Note
This PR was generated with GitHub Copilot.
Microsoft Reviewers: Open in CodeFlow