From 7c05f8357cff8771517b0cdb92784d71461e10f4 Mon Sep 17 00:00:00 2001 From: Saransh Sharma Date: Tue, 13 Jan 2026 13:47:51 -0800 Subject: [PATCH 1/3] Port #3828 to release/6.0 --- .../common/templates/jobs/ci-code-coverage-job.yml | 1 - eng/pipelines/dotnet-sqlclient-ci-core.yml | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/common/templates/jobs/ci-code-coverage-job.yml b/eng/pipelines/common/templates/jobs/ci-code-coverage-job.yml index 76a9b07939..170a4d52a2 100644 --- a/eng/pipelines/common/templates/jobs/ci-code-coverage-job.yml +++ b/eng/pipelines/common/templates/jobs/ci-code-coverage-job.yml @@ -33,7 +33,6 @@ parameters: # True to upload code coverage results to CodeCov. - name: upload type: boolean - default: true jobs: - job: CodeCoverage diff --git a/eng/pipelines/dotnet-sqlclient-ci-core.yml b/eng/pipelines/dotnet-sqlclient-ci-core.yml index 7fac4ad14a..05dfaad1ba 100644 --- a/eng/pipelines/dotnet-sqlclient-ci-core.yml +++ b/eng/pipelines/dotnet-sqlclient-ci-core.yml @@ -99,6 +99,14 @@ stages: image: ADO-MMS22-CodeCov pool: ${{ parameters.defaultPoolName }} targetFrameworks: ${{ parameters.codeCovTargetFrameworks }} + # This is a Pipeline Variable defined in the Azure DevOps UI. It + # must be defined with a true/false value for all pipelines that + # specify a build type of 'Project'. + # + # You can find Pipeline Variables by visiting the main page of the + # pipeline and choosing Edit -> Variables. + # + upload: ${{ eq(variables.ci_var_uploadTestResult, 'true') }} # test stages configurations # self hosted SQL Server on Windows From 691bc1119d8a600420018839c69282d3867661b5 Mon Sep 17 00:00:00 2001 From: Saransh Sharma Date: Wed, 14 Jan 2026 10:30:24 -0800 Subject: [PATCH 2/3] Fix codecoverage issue --- eng/pipelines/dotnet-sqlclient-ci-core.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/dotnet-sqlclient-ci-core.yml b/eng/pipelines/dotnet-sqlclient-ci-core.yml index 05dfaad1ba..ba9c125808 100644 --- a/eng/pipelines/dotnet-sqlclient-ci-core.yml +++ b/eng/pipelines/dotnet-sqlclient-ci-core.yml @@ -106,7 +106,7 @@ stages: # You can find Pipeline Variables by visiting the main page of the # pipeline and choosing Edit -> Variables. # - upload: ${{ eq(variables.ci_var_uploadTestResult, 'true') }} + upload: $( eq(variables.ci_var_uploadTestResult, 'true') ) # test stages configurations # self hosted SQL Server on Windows From 9614f17dcd9594b1583d110a1bf0e9d4b0450787 Mon Sep 17 00:00:00 2001 From: Saransh Sharma Date: Wed, 14 Jan 2026 12:33:35 -0800 Subject: [PATCH 3/3] Update codecov result upload --- eng/pipelines/dotnet-sqlclient-ci-core.yml | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/eng/pipelines/dotnet-sqlclient-ci-core.yml b/eng/pipelines/dotnet-sqlclient-ci-core.yml index ba9c125808..a4c9ecf118 100644 --- a/eng/pipelines/dotnet-sqlclient-ci-core.yml +++ b/eng/pipelines/dotnet-sqlclient-ci-core.yml @@ -99,14 +99,25 @@ stages: image: ADO-MMS22-CodeCov pool: ${{ parameters.defaultPoolName }} targetFrameworks: ${{ parameters.codeCovTargetFrameworks }} - # This is a Pipeline Variable defined in the Azure DevOps UI. It - # must be defined with a true/false value for all pipelines that - # specify a build type of 'Project'. + # We only want to upload coverage results to CodeCov from certain + # pipelines. We use the pipeline name (Build.DefinitionName) to + # choose. This is a predefined variable that is available at + # template expansion time, so we can use it to supply a true boolean + # value to the upload parameter. # - # You can find Pipeline Variables by visiting the main page of the - # pipeline and choosing Edit -> Variables. + # https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#build-variables-devops-services # - upload: $( eq(variables.ci_var_uploadTestResult, 'true') ) + # We're choosing to upload from these pipelines only: + # + # - PR-SqlClient-Project + # - CI-SqlClient + # + # Other pipelines that share this template and use a Project + # buildType don't add much, if any, value to the coverage reports. + # They have not been configured with suitable CodeCov credentials to + # perform the upload. + # + upload: ${{ or(eq(variables['Build.DefinitionName'], 'PR-SqlClient-Project'), eq(variables['Build.DefinitionName'], 'CI-SqlClient')) }} # test stages configurations # self hosted SQL Server on Windows