Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 5, 2025

Context

Docs-only PRs fail the Code Coverage CI job because tests are skipped (no coverage artifacts generated), but the job unconditionally attempts to download and publish those artifacts.

Changes Made

Modified .vsts-dotnet-ci.yml CodeCoverage job to respect the onlyDocChanged flag:

  • Added dependency on IfOnlyDocumentionChanged job to access the flag
  • Added onlyDocChanged variable to job variables
  • Conditioned all artifact downloads on eq(variables.onlyDocChanged, 0)
  • Conditioned coverage processing and publishing on eq(variables.onlyDocChanged, 0)

This aligns with how other jobs (BootstrapMSBuildOnFullFrameworkWindows, CoreBootstrappedOnLinux, etc.) already handle docs-only PRs.

Testing

Pipeline configuration change - will be validated on next PR run. When onlyDocChanged = 1, all coverage tasks skip; when onlyDocChanged = 0, coverage runs normally.

Notes

Pre-existing typos in job/variable names (Documention, Varibale) intentionally preserved for consistency across the pipeline.

Original prompt

This section details on the original issue you should resolve

<issue_title>docs only PRs fail code coverage CI check</issue_title>
<issue_description>#12805
#12857

Code Coverage failed
[3 errors / 0 warnings](https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1217301)

Annotations
 [Check failure on line 9 in Build log](https://github.com/dotnet/msbuild/pull/12857/files#annotation_42398343450) 

@azure-pipelines
azure-pipelines
/ msbuild-pr (Code Coverage)
Build log #L9

Publishing build artifacts failed with an error: Not found PathtoPublish: D:\a\1\s\artifacts\CoverageResults\merged.coverage
 [Check failure on line 11 in Build log](https://github.com/dotnet/msbuild/pull/12857/files#annotation_42398343487) 

@azure-pipelines
azure-pipelines
/ msbuild-pr (Code Coverage)
Build log #L11

Artifact LinuxCoreCoverage was not found for build 1217301.
 [Check failure on line 9 in Build log](https://github.com/dotnet/msbuild/pull/12857/files#annotation_42398343497) 

@azure-pipelines
azure-pipelines
/ msbuild-pr (Code Coverage)
Build log #L9

Publishing build artifacts failed with an error: Not found PathtoPublish: D:\a\1\s\artifacts\CoverageResults\merged.cobertura.xml

This is probably because testing is skipped on docs only PRs, in that case code coverage should also be skipped</issue_description>

<agent_instructions>fix this issue, note that the CI pipeline definition is called .vsts-dotnet-ci.yml</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@dotnet-policy-service
Copy link
Contributor

Hello @@copilot, I noticed that you’re changing an .swr file or any file under src/Package/MSBuild.VSSetup.. Please make sure to validate this change by an experimental VS insertion. This is accomplished by pushing to an exp/* branch, which requires write permissions to this repo.

Copilot AI changed the title [WIP] Fix code coverage CI check failures in docs only PRs Skip code coverage tasks for docs-only PRs Dec 5, 2025
Copilot AI requested a review from JanProvaznik December 5, 2025 09:58
Copilot finished work on behalf of JanProvaznik December 5, 2025 09:58
@JanProvaznik JanProvaznik marked this pull request as ready for review December 5, 2025 10:03
Copilot AI review requested due to automatic review settings December 5, 2025 10:03
@JanProvaznik JanProvaznik requested a review from a team as a code owner December 5, 2025 10:03
@JanProvaznik JanProvaznik enabled auto-merge (squash) December 5, 2025 10:03
Copilot finished reviewing on behalf of JanProvaznik December 5, 2025 10:05
Copy link
Contributor

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 fixes a CI pipeline issue where docs-only PRs fail the Code Coverage job. The job was attempting to download and publish coverage artifacts that don't exist when tests are skipped for documentation-only changes.

Key Changes:

  • Modified the CodeCoverage job to respect the onlyDocChanged flag that indicates whether only documentation files were modified
  • Added conditional execution to artifact downloads, coverage processing, and publishing tasks to skip them when onlyDocChanged = 1
  • Preserved existing misspellings (Documention, Varibale) in job/variable names for consistency with the rest of the pipeline

@JanProvaznik JanProvaznik merged commit 2b3cc4d into main Dec 5, 2025
16 checks passed
@JanProvaznik JanProvaznik deleted the copilot/fix-code-coverage-errors branch December 5, 2025 10:58
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.

docs only PRs fail code coverage CI check

3 participants