Skip to content

FIX: Improve release pipeline reliability and build throughput - #910

Merged
Jahnvi Thakkar (jahnvi480) merged 6 commits into
mainfrom
jahnvi/release-pipeline-failure
Nov 24, 2026
Merged

Jahnvi Thakkar (jahnvi480) merged 6 commits into
mainfrom
jahnvi/release-pipeline-failure

Conversation

@jahnvi480

@jahnvi480 Jahnvi Thakkar (jahnvi480) commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Work Item / Issue Reference

AB#50320


Summary

Port the release-pipeline improvements from ADO PR 9063 as one clean commit, retaining all 41 driver wheels, seven ODBC wheels, existing test coverage, blocking pooling benchmark, signing, and security gates.

  • Split Linux ARM64 builds into two isolated three-version shards per distribution; keep x64 interpreter loops sequential.
  • Stage and verify exact-version Rust runtime wheels early, retry transient downloads, and remove ODBC consolidation from the platform critical path while retaining its compatibility artifact.
  • Cache pip downloads on macOS, Linux, and Windows; overlap macOS SQL setup with dependency installation and universal2 compilation.
  • Use bounded, ownership-aware SQL readiness and cleanup, with opt-in Colima startup retry for release builds.
  • Require manylinux CP949 conversion modules and verify conversion fidelity, fixing the Korean VARCHAR regression caused by missing glibc-gconv-extra.
  • Add regression coverage and optional resource-capped Linux compiler parallelism (default 1; measured trials used 2).

Validation:

  • .\.ado-pipeline-test\.venv\Scripts\python.exe -m pytest --noconftest tests\test_release_pipeline_resilience.py tests\test_release_build_dependencies.py tests\test_037_rs_wheel_download.py -q — passed, 67 tests.
  • .\.ado-pipeline-test\.venv\Scripts\python.exe -m pre_commit run black-check --all-files --hook-stage pre-push — passed.
  • Changed YAML parsed and 25 Bash steps syntax-checked — passed.
  • ADO run 194367 — succeeded for all selected manylinux configurations; Korean regression passed for every Python version on x64 and ARM64.
  • ADO run 194345 — all six macOS configurations and all musllinux configurations passed; this was not a successful full release.
  • All 11 ported files match the validated ADO snapshot. Full runtime pytest was not rerun locally; SQL/native validation evidence is from those ADO jobs. Windows and full-release consolidation remain unverified.

Measured build/test-job improvements versus run 193770: manylinux x64 52.0 → 37.6 min; manylinux ARM64 188.9 → 103.2 min; musllinux ARM64 188.5 → 100.4 min. ARM64 comparisons use the slower parallel shard. These exclude queues, approval gates, and post-build jobs and do not establish full-release speedup or reduced flakiness.

Port validated release pipeline improvements from ADO PR 9063 as one commit. Preserve all wheel configurations, integration checks, signing and security gates; add bounded setup retries, pip caches, ARM64 shards, early runtime staging and required CP949 modules.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 12:10
@github-actions github-actions Bot added the pr-size: large Substantial code update label Nov 23, 2026
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

PR Performance Report

✅ No regression detected

No consistent slowdowns detected across all 2 environments.

0 IMPROVEMENTS 0 SLOWDOWNS 2/2 ENVIRONMENTS

Coverage: 2 of 2 environments completed. Advisory result; does not block merging.

Performance diagnostics

Phase times are inclusive diagnostics and must not be added together. They identify where measured time changed, not why it changed.

No affected phases or call-count changes were recorded.

All database tasks and timings

Unix / SQL Server 2022

Database task Before After Paired change Result
Connection opening 11.072 ms 10.550 ms -3.5% no signal
SELECT queries 1.124 ms 1.005 ms -10.1% no signal
Row insertion 30.597 ms 30.686 ms +0.4% no signal
Executemany inserts 159.846 ms 157.817 ms -0.8% no signal
Fetch-all queries 124.393 ms 122.543 ms -1.2% no signal
Row-by-row fetching 5.032 ms 5.025 ms +1.5% no signal
Batched row fetching 117.334 ms 118.031 ms +0.4% no signal
Transaction commit and rollback 104.558 ms 104.407 ms -0.1% no signal
Arrow row fetching 91.080 ms 92.067 ms +0.1% no signal
100,000-row insertion 377.356 ms 357.916 ms -5.6% no signal
Row fetching in batches of 100 123.640 ms 120.377 ms -2.4% no signal
Row fetching in batches of 10,000 150.026 ms 137.462 ms -11.4% no signal
Repeated positional queries 32.352 ms 32.446 ms +0.0% no signal
Repeated named-parameter queries 32.301 ms 32.620 ms +0.1% no signal
Legacy 100,000-row insertion 269.071 ms 284.193 ms +5.2% no signal
Insertion with explicit input sizes 423.344 ms 413.004 ms +0.6% no signal
Joined aggregation queries 179.641 ms 178.075 ms +0.5% no signal
Large joined-result fetching 197.366 ms 203.088 ms +0.9% no signal
1.2-million-row fetching 3668.375 ms 3617.924 ms -0.4% no signal
Common table expression queries 5.416 ms 5.792 ms +3.5% no signal
256 KiB VARCHAR(MAX) / fetchall() 1.785 ms 1.472 ms -17.6% no signal
10,000 scalar values / fetchval() (debug disabled) 16.844 ms 16.784 ms +0.9% no signal
10,000 output-converted rows / fetchall() 19.363 ms 19.239 ms -3.4% no signal
10,000 output-converted rows / fetchmany(1000) 23.458 ms 24.836 ms +5.9% no signal
10,000 INT/NVARCHAR rows / fetchmany(1) 25.153 ms 24.730 ms -1.7% no signal
10,000 rows x 32 columns / dict(row._mapping) (warm) 32.792 ms 32.491 ms +1.6% no signal

Unix / SQL Server 2025

Database task Before After Paired change Result
Connection opening 81.931 ms 81.614 ms +0.0% no signal
SELECT queries 1.063 ms 1.161 ms +12.0% no signal
Row insertion 30.638 ms 30.508 ms +0.2% no signal
Executemany inserts 151.922 ms 151.439 ms -0.1% no signal
Fetch-all queries 124.104 ms 144.504 ms +2.5% no signal
Row-by-row fetching 5.046 ms 5.074 ms +0.4% no signal
Batched row fetching 119.289 ms 120.668 ms +1.8% no signal
Transaction commit and rollback 106.186 ms 105.705 ms -0.5% no signal
Arrow row fetching 91.525 ms 94.316 ms +3.8% no signal
100,000-row insertion 374.552 ms 356.231 ms -1.1% no signal
Row fetching in batches of 100 122.452 ms 122.482 ms -0.3% no signal
Row fetching in batches of 10,000 145.552 ms 134.469 ms -7.6% no signal
Repeated positional queries 31.722 ms 32.700 ms -0.3% no signal
Repeated named-parameter queries 31.891 ms 32.065 ms +0.1% no signal
Legacy 100,000-row insertion 271.197 ms 269.110 ms +0.3% no signal
Insertion with explicit input sizes 414.337 ms 424.316 ms +0.7% no signal
Joined aggregation queries 163.883 ms 163.637 ms -0.3% no signal
Large joined-result fetching 209.216 ms 207.421 ms +0.6% no signal
1.2-million-row fetching 3662.499 ms 3608.920 ms -1.7% no signal
Common table expression queries 5.265 ms 5.380 ms +2.7% no signal
256 KiB VARCHAR(MAX) / fetchall() 2.045 ms 2.134 ms +4.4% no signal
10,000 scalar values / fetchval() (debug disabled) 16.917 ms 16.955 ms +1.9% no signal
10,000 output-converted rows / fetchall() 19.150 ms 19.870 ms +4.4% no signal
10,000 output-converted rows / fetchmany(1000) 23.462 ms 24.107 ms +1.5% no signal
10,000 INT/NVARCHAR rows / fetchmany(1) 24.586 ms 24.510 ms -0.3% no signal
10,000 rows x 32 columns / dict(row._mapping) (warm) 32.216 ms 32.594 ms +1.2% no signal
Build and measurement details

ADO build 194643

PR head: 5ff16351776e8b3baf005659336476bf780aca68
Base: ae1a6bb78161552cd31dd9deeb1c26111630ce76
Measured merge: 977be38ff282f1658bcd8fd4891ad008e41c81bb

  • Unix / SQL Server 2022: Python 3.12.3, x86_64, SQL 16.0.4325.4; 5 paired comparisons and 1 warmup.
  • Unix / SQL Server 2025: Python 3.12.3, x86_64, SQL 17.0.5065.9; 5 paired comparisons and 1 warmup.

A consistent change requires more than 20% median paired movement, at least 1 ms between the median runtimes, and at least 80% of pairs exceeding the relative threshold in the same direction. A slowdown without enough pair agreement is reported as inconsistent.

The displayed change is the median of paired before-and-after ratios. It is not recalculated from the two displayed median runtimes.

Both revisions use profiling-enabled builds on the same agent and database, with alternating order and discarded warmups. Results are diagnostic and do not represent production-wheel latency.

Raw samples and logs are attached to the ADO run as profiler-* artifacts.

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.

🟡 Changes recommended

Shard-qualified stage names break the Conda production-publication gate because the provenance verifier still expects unsharded identities, while truncated wheel downloads can also bypass retries.

2 open issues
What changed in this PR

This PR improves release-build throughput and resilience across the driver’s packaging pipelines while preserving the 41-driver-wheel and seven-ODBC-wheel matrix.

Changes:

  • Shards Linux ARM64 builds, adds pip caching, and overlaps macOS SQL setup with compilation.
  • Stages Rust runtime wheels early, retries transient downloads, and verifies staged artifacts offline.
  • Adds bounded SQL setup and cleanup, CP949 conversion checks, and regression coverage.
File Description
tests/​test_release_pipeline_resilience.py Adds pipeline, caching, SQL lifecycle, and conversion regression checks.
tests/​test_037_rs_wheel_download.py Tests download retries, cleanup, and offline verification.
OneBranchPipelines/​stages/​build-windows-single-stage.yml Adds pip caching and configurable ODBC artifact selection.
OneBranchPipelines/​stages/​build-odbc-all-stage.yml Requires exactly seven ODBC wheels.
OneBranchPipelines/​stages/​build-macos-single-stage.yml Overlaps build and SQL setup; adds caching and cleanup.
OneBranchPipelines/​stages/​build-linux-single-stage.yml Supports shards, bounded compiler parallelism, caching, and CP949 checks.
OneBranchPipelines/​jobs/​consolidate-artifacts-job.yml Reuses and verifies early-staged Rust runtime wheels.
OneBranchPipelines/​build-release-package-pipeline.yml Coordinates ARM64 shards and early artifact producers.
eng/​scripts/​start_colima.py Adds a bounded Colima startup helper with daemon verification.
eng/​scripts/​setup_sql_container.py Adds opt-in Colima startup retry.
eng/​scripts/​download_mssql_python_rs_wheels.py Adds transient retries, temporary staging, and offline verification.

Review effort: Balanced

Recognize shard-qualified Linux producer jobs while preserving legacy provenance and mandatory per-job security evidence. Retry real HTTP responses truncated before Content-Length without retrying complete invalid wheels.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 12:19

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.

🔵 Needs a closer look

The verifier ignores an explicit --index-url, causing valid wheels staged from that index to fail --verify-only because the receipt is compared against the runtime’s default index.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Medium severity Honor --index-url when verifying staged wheels

eng/​scripts/​download_mssql_python_rs_wheels.py:216

--verify-only ignores the existing --index-url option. Staging valid wheels with an explicit HTTPS index and then verifying them with the same option fails with “Staged runtime selection does not match the effective runtime”, because the verifier compares the receipt against the default index from resolve_runtime(). Please pass the explicit index into verify_staged_wheels() and compare against that effective index, falling back to the runtime default only when none was supplied.

1 resolved since last review

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

📊 Code Coverage Report

🔥 Diff Coverage

100%


🎯 Overall Coverage

86%


📈 Total Lines Covered: 12188 out of 14141
📁 Project: mssql-python


Diff Coverage

Diff: main...HEAD, staged and unstaged changes

No lines with coverage information in this diff.


📋 Files Needing Attention

📉 Files with overall lowest coverage (click to expand)
mssql_python.pybind.performance_counter.hpp: 0.7%
mssql_python.pybind.logger_bridge.cpp: 57.9%
mssql_python.pybind.ddbc_bindings.h: 64.8%
mssql_python.pybind.logger_bridge.hpp: 70.8%
mssql_python._native_fetch.py: 77.7%
mssql_python.pybind.ddbc_bindings.cpp: 81.1%
mssql_python.__init__.py: 81.2%
mssql_python.pybind.row_mapping_cache.hpp: 81.5%
mssql_python.pybind.connection.connection_pool.cpp: 82.5%
mssql_python.pybind.connection.connection.cpp: 82.9%

🔗 Quick Links

⚙️ Build Summary 📋 Coverage Details

View Azure DevOps Build

Browse Full Coverage Report

Copilot AI balanced review requested due to automatic review settings November 23, 2026 13:41

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.

🟡 Changes recommended

--verify-only ignores --index-url, incorrectly rejecting unchanged wheels downloaded from an explicit HTTPS mirror; verification must honor the selected index, normalize trailing slashes, and gain round-trip test coverage.

2 open issues

Review effort: Balanced

Forward --index-url to staged-wheel verification and compare equivalent trailing-slash forms. Cover mirror round trips through both the helper and CLI without network access.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 04:52

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.

🔵 Needs a closer look

Cross-platform release dependency and artifact-handoff changes lack Windows and end-to-end validation, requiring maintainer confirmation of the full release run, consolidation, signing, and security gates.

1 open issue
1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 24, 2026 05:48

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.

🔵 Needs a closer look

Release-critical dependency and artifact-flow changes lack end-to-end release verification, leaving Windows, final consolidation, and preservation of signing/security gates unconfirmed.

1 open issue

Review effort: Balanced

@jahnvi480
Jahnvi Thakkar (jahnvi480) merged commit f5a0383 into main Nov 24, 2026
54 checks passed
Jahnvi Thakkar (jahnvi480) added a commit that referenced this pull request Nov 27, 2026
### Work Item / Issue Reference
<!--
IMPORTANT: Please follow the PR template guidelines below.
For mssql-python maintainers: Insert your ADO Work Item ID below
For external contributors: Insert Github Issue number below
Only one reference is required - either GitHub issue OR ADO Work Item.
-->

<!-- mssql-python maintainers: ADO Work Item -->
>
[AB#50319](https://sqlclientdrivers.visualstudio.com/c6d89619-62de-46a0-8b46-70b92a84d85e/_workitems/edit/50319)

<!-- External contributors: GitHub Issue -->

-------------------------------------------------------------------
### Summary
<!-- Insert your summary of changes below. Minimum 10 characters
required. -->

Prepare mssql-python 1.19.0. Bump the package version in
`mssql_python/__init__.py` and `setup.py`, and replace the previous
release highlights in `PyPI_Description.md`.

#### Enhancements

- Optional connection retry policy for transient failures during
connection initialization (#751).
- Table-valued parameter definitions and synchronous execution through
the default ODBC provider (#789).
- Optional SQLSTATE and native error number attributes on DB-API
exceptions (#909, #913).
- Best-effort synchronous cursor cancellation with operation-scoped
requests and checked recovery (#911, #915).
- POSIX native binary hardening (#810).

#### Bug Fixes

- Lossless `executemany` inference for Unicode, Decimal, mixed-type
batches, and embedded/trailing NULs (#907).
- Numeric binding for auto-detected money-range Decimal batches (#752).
- Restore Korean VARCHAR conversion fidelity in manylinux packages
(#910).

#### Release status and gates

- ADO-GitHub synchronization completed into ADO `main` via [ADO PR
!9120](https://sqlclientdrivers.visualstudio.com/mssql-python/_git/mssql-python/pullrequest/9120).
- Ready for reviewer approval. The equivalent ADO release PR follows
approval of this GitHub PR.
- Do not merge this release PR until the required PyPI and Conda
publication and verification gates are complete.
- Release builds, publication, and release qualification remain
outstanding; marking this PR ready for review does not authorize
publication or merging.

#### Validation

- `.\.venv\Scripts\python.exe -m pre_commit run black-check --all-files
--hook-stage pre-push` - passed.
- `git diff --check` - passed.
- Source-only checks verified matching `1.19.0` version declarations,
one current "What's new" section, and the agreed description scope.
- Native build and runtime pytest were not run for this
version/description-only change; release qualification remains required.

<!--
### PR Title Guide

> For feature requests
FEAT: (short-description)

> For non-feature requests like test case updates, config updates ,
dependency updates etc
CHORE: (short-description)

> For Fix requests
FIX: (short-description)

> For doc update requests
DOC: (short-description)

> For Formatting, indentation, or styling update
STYLE: (short-description)

> For Refactor, without any feature changes
REFACTOR: (short-description)

> For performance improvements
PERF: (short-description)

> For AI tooling, agents, skills, prompts, or AI-assisted development
workflows
AI: (short-description)

> For release related changes, without any feature changes
RELEASE: #<RELEASE_VERSION> (short-description)

### Contribution Guidelines

External contributors:
- Create a GitHub issue first:
https://github.com/microsoft/mssql-python/issues/new
- Link the GitHub issue in the "GitHub Issue" section above
- Follow the PR title format and provide a meaningful summary

mssql-python maintainers:
- Create an ADO Work Item following internal processes
- Link the ADO Work Item in the "ADO Work Item" section above
- Follow the PR title format and provide a meaningful summary
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-size: large Substantial code update

4 participants