Skip to content

Official Build Cleanup#4123

Open
benrr101 wants to merge 19 commits intomainfrom
dev/russellben/official-build-cleanup
Open

Official Build Cleanup#4123
benrr101 wants to merge 19 commits intomainfrom
dev/russellben/official-build-cleanup

Conversation

@benrr101
Copy link
Copy Markdown
Contributor

Description

Since I'm taking the lead on pipeline ownership and have been tasked to be bold, I'm introducing a collection of cleanup work to keep our official/non-official pipelines following pipeline guidance.

Biggest changes:

  • Parameterize everything - We want everything to come from the top and not have to guess where it is defined
  • Replace $(xyz) with ${{ [parameters|variables].xyz }} - Unless they're well-known variables, we want 1) to have compile-time validation of the pipeline and 2) to know where the variable/parameter comes from
  • Use modern variable libraries - The new ones follow good naming conventions, and will be updated going forward
  • Calculate package/assembly versions in a shared location
  • Clean up unused parameters/variables, etc.

🤖

Used to verify that pipeline changes were effective before submitting for commit. May have utilized in a few instances to do menial tasks.

Testing

Check the following builds to verify results:
https://sqlclientdrivers.visualstudio.com/ADO.Net/_build/results?buildId=145613&view=results

@benrr101 benrr101 added this to the 7.1.0-preview1 milestone Mar 31, 2026
@benrr101 benrr101 requested a review from a team as a code owner March 31, 2026 23:10
@benrr101 benrr101 added the Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems. label Mar 31, 2026
Copilot AI review requested due to automatic review settings March 31, 2026 23:10
@github-project-automation github-project-automation bot moved this to To triage in SqlClient Board Mar 31, 2026
Copy link
Copy Markdown
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

Cleans up and modernizes the SqlClient OneBranch official/non-official pipeline definitions by centralizing version/artifact variables, threading parameters explicitly through templates, and reducing reliance on macro-expanded variables to improve compile-time validation and readability.

Changes:

  • Centralize package versions/artifact names into a shared package-variables.yml template and thread them through build/release stages.
  • Refactor OneBranch build/release templates/jobs to use explicit parameters (signing, symbols, versions) and updated stage/job naming (SqlClient vs MDS).
  • Simplify solution maintenance for eng/pipelines/ by adding a non-buildable Pipelines.csproj that glob-includes pipeline files.

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/Microsoft.Data.SqlClient.slnx Replaces explicit pipeline file entries with a single non-build project to surface eng/pipelines in the IDE.
eng/pipelines/Pipelines.csproj Adds a “files-only” SDK project to include all eng/pipelines/** files in the solution without building.
eng/pipelines/onebranch/variables/sqlclient-validation-variables.yml Removes legacy validation variable template (validation now parameterized within the job).
eng/pipelines/onebranch/variables/package-variables.yml Introduces centralized package artifact/version/file-version variables (preview vs GA).
eng/pipelines/onebranch/variables/onebranch-variables.yml Switches to modern variable groups for signing/symbols and keeps core OneBranch template variables.
eng/pipelines/onebranch/variables/common-variables.yml Trims legacy variable groups/versions and adds well-known paths like PACK_INPUT/PACK_OUTPUT.
eng/pipelines/onebranch/steps/roslyn-analyzers-sqlclient-step.yml Renames/retargets Roslyn analyzer step to SqlClient naming and parameters.
eng/pipelines/onebranch/steps/roslyn-analyzers-csproj-step.yml Refactors Roslyn analyzer step to take a build target + arguments with clearer display names.
eng/pipelines/onebranch/steps/pack-sqlclient-step.yml Renames/retargets pack step for SqlClient (Build2.proj Pack).
eng/pipelines/onebranch/steps/pack-csproj-step.yml Simplifies pack step to always use Release configuration and modernizes quoting/args.
eng/pipelines/onebranch/steps/copy-apiscan-files-sqlclient-step.yml Adds a SqlClient-specific APIScan file copy step for dll/pdb outputs.
eng/pipelines/onebranch/steps/build-sqlclient-step.yml Renames/retargets Build2.proj build step to SqlClient parameter naming.
eng/pipelines/onebranch/steps/build-csproj-step.yml Simplifies csproj build step to always use Release and updates output labeling.
eng/pipelines/onebranch/stages/release-stages.yml Threads artifact names/versions as parameters and renames AKV parameter casing.
eng/pipelines/onebranch/stages/build-stages.yml Threads signing/symbols/package parameters through all build stages; renames validation stage.
eng/pipelines/onebranch/sqlclient-official.yml Updates official pipeline to consume new variable templates and parameterized stages/jobs.
eng/pipelines/onebranch/sqlclient-non-official.yml Updates non-official pipeline similarly (including new version/signing/symbol groups).
eng/pipelines/onebranch/jobs/validate-signed-package-job.yml Refactors package validation to be parameter-driven and adds additional checks/structure.
eng/pipelines/onebranch/jobs/publish-nuget-package-job.yml Uses $(PACK_OUTPUT) for OneBranch artifact output directory.
eng/pipelines/onebranch/jobs/build-signed-sqlclient-package-job.yml Renames job/template usage from MDS to SqlClient and wires new step/template names.
eng/pipelines/onebranch/jobs/build-signed-csproj-package-job.yml Parameterizes signing/symbols inputs and standardizes build/pack behavior and artifact paths.
Comments suppressed due to low confidence (1)

eng/pipelines/onebranch/stages/release-stages.yml:33

  • debug is declared as a parameter here but it is never referenced anywhere in this template. Either wire it into the release job/stage (e.g., to enable extra logging) or remove it to avoid a no-op queue-time option.
  # ── General parameters ─────────────────────────────────────────────────

  # True to enable debug information and steps.
  - name: debug
    type: boolean

# $(Build.BuildNumber) has the format XXX.YY. Additionally, each version part must be a positive
# 16-bit integer less than 65535. Simply concatenating both parts of $(Build.BuildNumber) could
# produce values larger than 65534, so we must omit the second part entirely. Unfortunately, this
# may result in multiple subsequent pipline builds using the same C# assembly versions. The
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "pipline" should be "pipeline".

Suggested change
# may result in multiple subsequent pipline builds using the same C# assembly versions. The
# may result in multiple subsequent pipeline builds using the same C# assembly versions. The

Copilot uses AI. Check for mistakes.
#################################################################################

# This file is only included in MDS OneBranch Official pipelines.
# This file is only included in SqlClient OneBranch Official pipelines.
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file header says this template is only included in SqlClient OneBranch official pipelines, but it is also included by the non-official pipeline (sqlclient-non-official.yml). Please update the comment to avoid misleading future edits.

Suggested change
# This file is only included in SqlClient OneBranch Official pipelines.
# This file is included by SqlClient OneBranch pipelines (official and non-official).

Copilot uses AI. Check for mistakes.
Comment on lines 25 to 28
# True if this is a preview build, which uses the preview version numbers from
# common-variables.yml.
- name: isPreview
type: boolean
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The isPreview parameter comment still says preview versions come from common-variables.yml, but version selection now appears to be centralized in variables/package-variables.yml. Please update the comment so future maintainers look in the correct place.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do you one better - this parameter isn't used in build-stages at all. Let's just get rid of it.

Comment on lines +55 to +65
- name: artifactPath
value: '$(Pipeline.Workspace)\${{ parameters.artifactName }}'

- ${{ if parameters.isPreview }}:
- name: extractedNugetPath
value: $(extractedNugetRootPath).$(mdsPackagePreviewVersion)
- name: mdsPackageVersion
value: $(mdsPackagePreviewVersion)
# Path to the SqlClient NuGet package after installation. This path will only exist once the package
# been installed.
- name: nugetPackageInstallPath
value: '$(Pipeline.Workspace)\nugetPackageInstalls\Microsoft.Data.SqlClient\${{ parameters.expectedPackageVersion }}'

# Root folder where NuGet package will be installed locally
- name: nugetPackageInstallRoot
value: '$(Pipeline.Workspace)\nugetPackageInstalls'
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nugetPackageInstallPath assumes the package will be installed under ...\Microsoft.Data.SqlClient\<version>, but Install-Package -Destination <root> typically creates a folder named Microsoft.Data.SqlClient.<version> directly under <root> (note the dot, not a nested directory). As written, all subsequent Get-ChildItem -Path $nugetPackageInstallPath ... calls are likely to point at a non-existent directory. Consider either deriving the install path from the actual installed folder (e.g., discover it after install) or aligning the expected path to the installer’s output; also consider pinning Install-Package to expectedPackageVersion to avoid accidentally installing a different version if multiple are present in the artifact folder.

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.44%. Comparing base (60d4b92) to head (b2c5b05).
⚠️ Report is 11 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (60d4b92) and HEAD (b2c5b05). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (60d4b92) HEAD (b2c5b05)
CI-SqlClient 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4123      +/-   ##
==========================================
- Coverage   73.22%   66.44%   -6.79%     
==========================================
  Files         280      274       -6     
  Lines       43000    65778   +22778     
==========================================
+ Hits        31486    43703   +12217     
- Misses      11514    22075   +10561     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 66.44% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@paulmedynski paulmedynski self-assigned this Apr 1, 2026
Copy link
Copy Markdown
Contributor

@paulmedynski paulmedynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent changes! We still need to land on a decision for YAML string quoting, but that can be a separate discussion and PR.

# Verify strong name signing #####################################
echo "> 1. Verifying strong name signing of DLLs ..."

# @TODO: This path seems brittle to VS upgrades, can we make it more flexible?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - see my changes in #4073 that try to locate symchk.exe.

- build_dependent
- mds_package_validation
- ${{ if parameters.releaseAKVProvider }}:
- sqlclient_package_validation
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes will conflict with #4073. I will bring these changes into that PR once this one merges.

recursive folder trees of non-compilable files, with the only solution to be manually adding
each file as a linked file in the solution. This is a terrible situation because it means each
time a file is added or removed from this folder, it must be manually updated in the solution.
It is also the case that most engineers forget to do this step, and it comes down to more
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some developers (me) have never found a use for the curated "solution" view, and instead just use the filesystem tree view. Maybe we could adopt that approach and avoid this hackery?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh... I think that deviates from the norm too much. It's expected that dotnet projects have solution files. You're more than welcome to not use the solution, but we should provide a working solution for vs diehards.

@mdaigle mdaigle moved this from To triage to In review in SqlClient Board Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems.

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

5 participants