Skip to content

Add sqlclient-ci-managed-instance CI pipeline - #4482

Draft
paulmedynski wants to merge 2 commits into
mainfrom
dev/paul/sqlclient-ci-managed-instance
Draft

Add sqlclient-ci-managed-instance CI pipeline#4482
paulmedynski wants to merge 2 commits into
mainfrom
dev/paul/sqlclient-ci-managed-instance

Conversation

@paulmedynski

@paulmedynski paulmedynski commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a new CI pipeline that runs the SqlClient Unit, Functional, and Manual test suites against an Azure SQL Managed Instance, in Package reference mode, based on the exported Classic Test-SqlClient-Managed-Instance pipeline.

Engineering process / CI changes:

  • New pipeline trio under eng/pipelines/ci/managed-instance/ (-pipeline, -stage, -job):
    • Triggered by successful runs of the sqlclient-ci-package pipeline (same pattern as sqlclient-ci-stress); no PR/commit/schedule triggers.
    • Registered in the ADO.Net (internal) project only, since it depends on the Managed-Instance-pool and the ADO Test Configuration Properties variable group (MI connection strings), neither of which exist in the Public project.
    • Runs on Windows (both native and managed SNI) and Linux. Test projects are built in ReferenceType=Package against the exact package versions downloaded from sqlclient-ci-package.
    • Lets build.proj use its defaults for TFM selection (all host-OS TFMs) and test set (all manual tests, matching the Classic pipeline), so Always Encrypted (Set=AE) coverage is preserved.
  • Shared step template eng/pipelines/common/steps/download-driver-packages-step.yml that downloads the SqlClient-Driver-Packages artifact, stages it into the local NuGet feed, and resolves the driver package versions. The sqlclient-ci-stress job is refactored to reuse it (removing duplicated inline logic).
  • update-config-file-step.yml: adds an IsManagedInstance parameter so the test config can opt into Managed-Instance-specific behavior.

No product code or public API changes — this is CI/pipeline-only.

Note: This pipeline targets main. Porting to release/7.0 and release/6.1 will be done separately, since those branches predate the sqlclient-ci-package single-artifact model and will instead use scheduled, build-from-source variants.

Testing

  • sqlclient-ci-managed-instance: 20901

Add a package-triggered CI pipeline that runs the SqlClient Unit,
Functional, and Manual test suites against an Azure SQL Managed Instance
in Package reference mode, based on the exported Classic
Test-SqlClient-Managed-Instance pipeline.

- New pipeline trio under eng/pipelines/ci/managed-instance/ (pipeline,
  stage, job).  Triggered by successful sqlclient-ci-package runs (like
  sqlclient-ci-stress) and registered in the ADO.Net project only, since
  it depends on the Managed-Instance-pool and the "ADO Test Configuration
  Properties" variable group.  Runs on Windows (native + managed SNI) and
  Linux, letting build.proj default to all host-OS TFMs and all manual
  test sets.
- Extract the driver-package download + version resolution into a shared
  eng/pipelines/common/steps/download-driver-packages-step.yml and
  refactor the stress job to use it.
- Add an IsManagedInstance parameter to update-config-file-step.yml.
Copilot AI review requested due to automatic review settings July 28, 2026 19:22
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Jul 28, 2026
@paulmedynski paulmedynski added this to the 7.1.0-preview3 milestone Jul 28, 2026
@paulmedynski paulmedynski added the Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems. label Jul 28, 2026
@paulmedynski paulmedynski moved this from To triage to In progress in SqlClient Board Jul 28, 2026
The Linux job in the stage does not pass useManagedSNI (it is only
relevant to UseManagedSNIOnWindows), so the job parameter needs a
default to satisfy pipeline validation.

Copilot AI left a comment

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.

Pull request overview

Adds a new Azure DevOps CI pipeline to run SqlClient Unit/Functional/Manual tests against an Azure SQL Managed Instance in Package reference mode, triggered by sqlclient-ci-package, and refactors package-download/version-resolution logic into a shared template to reduce duplication.

Changes:

  • Introduces a new managed-instance pipeline trio under eng/pipelines/ci/managed-instance/ (pipeline + stage + job templates).
  • Adds a shared download-driver-packages-step.yml template and updates the existing stress CI job to reuse it.
  • Extends update-config-file-step.yml with an IsManagedInstance switch to enable MI-specific test behavior.

Reviewed changes

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

Show a summary per file
File Description
eng/pipelines/common/templates/steps/update-config-file-step.yml Adds IsManagedInstance parameter and writes it into generated test config.
eng/pipelines/common/steps/download-driver-packages-step.yml New reusable step to download driver package artifacts and resolve package versions into pipeline variables.
eng/pipelines/ci/stress/sqlclient-ci-stress-job.yml Refactors to use the new shared download/resolve template and consumes the new version variable name.
eng/pipelines/ci/managed-instance/sqlclient-ci-managed-instance-stage.yml New stage that fans out MI test jobs across Windows (native/managed SNI) and Linux.
eng/pipelines/ci/managed-instance/sqlclient-ci-managed-instance-pipeline.yml New pipeline definition triggered by sqlclient-ci-package runs.
eng/pipelines/ci/managed-instance/sqlclient-ci-managed-instance-job.yml New job template that sets up MI test config and runs the test suites across the requested TFMs.

Comment on lines +93 to +97
operatingSystem: Linux
# No .NET Framework runtimes on Linux.
netFrameworkTestRuntimes: []
netTestRuntimes: ${{ parameters.netTestRuntimes }}
vmImage: ADO-UB22-SQL22
Comment on lines +126 to +130
parameters:
debug: ${{ parameters.debug }}
# The Managed Instance connection strings carry their own credentials, so no local SA
# password is used here; pass an empty string for the required saPassword parameter.
saPassword: ''
# Pipeline parameters, visible in the Azure DevOps UI.
parameters:

# The build configuration to use when building the; defaults to Release.
Copilot AI review requested due to automatic review settings July 28, 2026 19:29

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (3)

eng/pipelines/common/steps/download-driver-packages-step.yml:109

  • After updating Resolve-PackageVersion to operate on the artifact directory, this call site should pass $artifactDir (the downloaded artifact contents) instead of $feed to avoid being affected by any pre-existing packages in the local feed.
        foreach ($p in $packages) {
            $version = Resolve-PackageVersion $feed $p.Pattern $p.Name
            Write-Host "Resolved $($p.Name) version: $version"
            Write-Host "##vso[task.setvariable variable=$($p.Variable)]$version"

eng/pipelines/ci/managed-instance/sqlclient-ci-managed-instance-pipeline.yml:45

  • Minor grammar issue in the parameter comment ("building the;") makes the pipeline description harder to read in the UI.
  # The build configuration to use when building the; defaults to Release.

eng/pipelines/common/steps/download-driver-packages-step.yml:74

  • Resolve-PackageVersion searches in the destination feed directory, which may already contain older .nupkg files on self-hosted agents. That can cause non-deterministic version selection via Select-Object -First 1 and pass the wrong versions to downstream steps. Resolve versions from the just-downloaded artifact directory and fail if there isn’t exactly one match.

This issue also appears on line 106 of the same file.

        # Resolve the version of a single package from its .nupkg filename in the feed.
        function Resolve-PackageVersion($feed, $pattern, $name) {
            $pkg = Get-ChildItem "$feed/*.nupkg" | Where-Object { $_.Name -match $pattern } | Select-Object -First 1
            if (-not $pkg) { throw "$name package not found in $feed" }
            return [regex]::Match($pkg.Name, $pattern).Groups[1].Value
        }

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.67%. Comparing base (c9d6efe) to head (c4bd154).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4482      +/-   ##
==========================================
- Coverage   64.65%   62.67%   -1.98%     
==========================================
  Files         288      283       -5     
  Lines       44011    66930   +22919     
==========================================
+ Hits        28455    41948   +13493     
- Misses      15556    24982    +9426     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 62.67% <ø> (?)

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

☔ View full report in Codecov by Harness.
📢 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.

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 progress

Development

Successfully merging this pull request may close these issues.

2 participants