New version of Publish Code Coverage Results task
We’ve introduced a new V2 version of the publish code coverage results task (known as PCCR) in Azure Pipelines recently. The main benefit of the V2 task is the support for more formats of the code coverage results and therefore more programming languages than the V1 task, which was limited to Cobertura and JaCoCo formats only. You can see more details for the V2 task in our public documentation.
The V2 task was made compatible with the build quality check task (known as BQC) in version 2.231.0. Any customer using build quality check can safely migrate from the V1 task to the V2 task version 2.231.0 or later.
While we don’t have any immediate plans for deprecating the V1 task, we will stop improving the V1 task and continue to address only critical issues. All our efforts to add new features will be directed towards the V2 task. Now we are adding support for two additional code coverage result formats (.coverage and .covx) to the V2 task. These new formats will be supported in version 2.233.0 that will be made available to anyone on Azure DevOps Service in February 2024. Therefore, we highly recommend our customers to stop using the V1 task and to migrate to the V2 task. Use of the V2 task will ensure you can use an extended list of file formats and programming languages and will be able to leverage new ones as they get added in the future.
The V2 task is available to anyone on Azure DevOps Service or Azure DevOps Server 2022 and later.
Phase I – User opt-in
Users of either Azure DevOps Service or Azure DevOps Server 2022 and later should migrate all their publish code coverage results V1 tasks to the V2 task. The V2 task provides additional features against the V1 task while maintaining all the features of the V1.
Users are encouraged to replace their V1 tasks with the V2 tasks.
Phase II – Warning
Late February 2024, we will start to warn users who are using, or will try to use, the publish code coverage results V1 task. Specifically, we’ll do the following:
- Add warning to the pipeline log file if that pipeline runs the publish code coverage results V1 task.
- Show a warning to pipeline authors when adding the publish code coverage results V1 task.
The warning in both cases will have the link to this blog post and will state:
“New V2 version of task publishing code coverage results is available to all our customers now. We highly recommend to stop using the V1 version and migrate to V2 version (https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/publish-code-coverage-results-v2). For more details see https://devblogs.microsoft.com/devops/new-pccr-task.”
Q: I’m using Azure DevOps Server version earlier than 2022. Does this apply to me too?
A: No, it does not. Nonetheless, when upgrading to Azure DevOps Server 2022 and later or migrating to Azure DevOps Service, you should consider using the more feature rich V2 version of the publish code coverage results task.
Q: I’m using Azure DevOps Server version 2022. What will happen to me?
A: In a future version of the Azure DevOps Server, we will also remove the V1 version of the publish code coverage results task. There will be a transitioning period where the V1 version will still run. During the transition period you’ll need to move from the V1 version to the V2 version, as when the transition period ends the V1 version will be removed and any pipeline containing that task will fail.
Q: What do I need to add to the YAML pipeline definition to use the V2 task?
A: For details on configuration see the documentation for the V2 task here ( https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/publish-code-coverage-results-v2) .
Q: Will there be any automatic conversion from V1 to V2 tasks done or will there be any script provided to handle the migration?
A: No, there will be neither automatic conversion of the pipelines to run V2 task instead of V1 nor any script provided to do such conversion.