Skip to content

FIX: Preserve Python-specific release dependencies - #832

Open
gargsaumya wants to merge 6 commits into
mainfrom
saumya/fix-release-dependency-markers
Open

gargsaumya wants to merge 6 commits into
mainfrom
saumya/fix-release-dependency-markers

Conversation

@gargsaumya

@gargsaumya gargsaumya commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Work Item / Issue Reference

AB#47861


Summary

Preserves Python-version environment markers when release dependency locks are refreshed, preventing the Python 3.10-only asyncio backport from being selected on Python 3.11 and newer.

Changes:

  • Compiles Linux, macOS, and Windows release locks with universal marker preservation.
  • Leaves the ODBC lock generation path unchanged.
  • Regenerates affected locks without upgrading existing package versions and retains SHA256 hashes only.
  • Adds focused regression tests for universal generation and the asyncio backport marker.
  • Preserves Gaurav's fix to skip profiler contracts when repository-only profiler tools are absent from isolated wheel tests.
  • Supplies the narrow set of repository-side mssql-odbc runner contract files to isolated Linux wheel tests and reports runner stdout/stderr if the status artifact is absent.
  • Excludes source-only release-lock/workflow contracts from both manylinux and musllinux installed-wheel suites, with a source-checkout contract guarding both selections.

Validation

  • Release dependency contract module: 3 passed, including the exact asyncio backport regression.
  • Linux pipeline contract tests: 5 passed; the complete runner/pipeline module was 5 passed, 5 skipped on Windows because runner execution requires Linux.
  • Reproduced the isolated fixture failure before the fix; after the fix, pipeline-equivalent collection excluded the repository contract module while an installed-wheel sentinel passed.
  • Targeted dependency-lock and runner contract tests: 12 passed on Linux in the prior follow-up.
  • Isolated Linux wheel-test fixture simulation: 10 passed, 1 profiler module skipped as intended in the prior follow-up.
  • Budget-exhaustion runner test repeated 50 times on Linux in the prior follow-up: 50 passed.
  • Black (line length 100), whitespace, and YAML parse checks: passed.
  • Lock regeneration with repository-pinned uv 0.12.6 repeated byte-for-byte: passed.
  • Production-like pip dry runs with require-hashes on Windows Python 3.10 through 3.14: passed.
  • Confirmed Python 3.10 selects the backport and Python 3.11 through 3.14 do not.
  • Simulated macOS and manylinux x64 resolution on Python 3.10 through 3.14: passed; the ADO native build matrix remains the final validation.

Compile supported multi-version locks in universal mode so environment markers remain intact across scheduled refreshes. Keep ODBC generation unchanged and add focused regression coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 5, 2026 07:07
@github-actions github-actions Bot added the pr-size: medium Moderate update size label Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 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 10.571 ms 10.460 ms -1.0% no signal
SELECT queries 1.102 ms 1.091 ms -1.0% no signal
Row insertion 34.871 ms 34.786 ms -0.8% no signal
Executemany inserts 161.224 ms 160.796 ms -1.0% no signal
Fetch-all queries 120.984 ms 122.055 ms +0.4% no signal
Row-by-row fetching 14.321 ms 14.287 ms +1.1% no signal
Batched row fetching 117.170 ms 117.983 ms -0.1% no signal
Transaction commit and rollback 115.997 ms 116.010 ms +0.1% no signal
Arrow row fetching 94.447 ms 96.402 ms +1.8% no signal
100,000-row insertion 445.381 ms 447.466 ms -0.2% no signal
Row fetching in batches of 100 121.036 ms 122.602 ms +1.2% no signal
Row fetching in batches of 10,000 137.735 ms 127.672 ms -4.2% no signal
Repeated positional queries 34.548 ms 34.414 ms -0.4% no signal
Repeated named-parameter queries 36.912 ms 36.343 ms -3.6% no signal
Legacy 100,000-row insertion 353.173 ms 354.023 ms -1.3% no signal
Insertion with explicit input sizes 490.917 ms 496.298 ms +1.1% no signal
Joined aggregation queries 178.082 ms 183.336 ms +3.8% no signal
Large joined-result fetching 184.617 ms 191.787 ms +3.6% no signal
1.2-million-row fetching 3525.263 ms 3480.431 ms -2.8% no signal
Common table expression queries 5.319 ms 5.343 ms +0.7% no signal
256 KiB VARCHAR(MAX) / fetchall() 1.349 ms 1.376 ms +2.5% no signal
10,000 scalar values / fetchval() (debug disabled) 106.309 ms 106.602 ms -0.0% no signal

Unix / SQL Server 2025

Database task Before After Paired change Result
Connection opening 97.560 ms 96.503 ms -1.1% no signal
SELECT queries 1.047 ms 1.063 ms +1.1% no signal
Row insertion 34.532 ms 34.561 ms -0.4% no signal
Executemany inserts 150.357 ms 151.198 ms +0.8% no signal
Fetch-all queries 120.464 ms 123.125 ms +1.8% no signal
Row-by-row fetching 14.506 ms 14.458 ms +0.3% no signal
Batched row fetching 120.764 ms 117.779 ms -2.5% no signal
Transaction commit and rollback 117.255 ms 115.248 ms -1.4% no signal
Arrow row fetching 93.493 ms 95.277 ms +2.8% no signal
100,000-row insertion 427.952 ms 448.047 ms +5.9% no signal
Row fetching in batches of 100 119.779 ms 126.649 ms +4.4% no signal
Row fetching in batches of 10,000 138.649 ms 129.772 ms -8.4% no signal
Repeated positional queries 33.522 ms 33.950 ms +1.0% no signal
Repeated named-parameter queries 36.392 ms 36.624 ms +0.8% no signal
Legacy 100,000-row insertion 350.879 ms 357.941 ms +1.0% no signal
Insertion with explicit input sizes 485.640 ms 482.053 ms -1.1% no signal
Joined aggregation queries 166.547 ms 160.066 ms -0.4% no signal
Large joined-result fetching 180.534 ms 183.133 ms +1.3% no signal
1.2-million-row fetching 3528.892 ms 3539.988 ms -1.1% no signal
Common table expression queries 5.139 ms 5.126 ms +0.2% no signal
256 KiB VARCHAR(MAX) / fetchall() 1.455 ms 1.494 ms -1.9% no signal
10,000 scalar values / fetchval() (debug disabled) 105.756 ms 107.244 ms +0.9% no signal
Build and measurement details

ADO build 180846

PR head: b5c11999461079f986a746471de5a5951f44c572
Base: 666f3cb6d23981bb23cd182ec273df10a7b2c805
Measured merge: 85e4eed54f937849036e63e3625102f6b4c824be

  • Unix / SQL Server 2022: Python 3.12.3, x86_64, SQL 16.0.4295.3; 5 paired comparisons and 1 warmup.
  • Unix / SQL Server 2025: Python 3.12.3, x86_64, SQL 17.0.5005.3; 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.

Copilot review overview

🟡 Changes recommended

The new regression tests contain a cross-entry false positive and hard-code a dependency version that future lock refreshes may legitimately upgrade.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Preserves conditional dependencies across supported Python versions during release-lock generation.

Changes:

  • Enables universal marker preservation for Linux, macOS, and Windows locks.
  • Regenerates affected dependency locks with environment markers.
  • Adds regression tests for workflow configuration and asyncio backport selection.
File Description
.github/​workflows/​refresh-build-dependencies.yml Enables universal compilation while excluding ODBC.
eng/​requirements-build-linux.txt Adds preserved platform and Python markers.
eng/​requirements-test-linux.txt Preserves conditional test dependencies.
eng/​requirements-build-macos.txt Preserves macOS lock environment markers.
eng/​requirements-build-windows.txt Preserves Windows lock environment markers.
tests/​test_release_build_dependencies.py Adds static regression coverage for lock generation.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/test_release_build_dependencies.py Outdated
Comment thread tests/test_release_build_dependencies.py
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

📊 Code Coverage Report

🔥 Diff Coverage

100%


🎯 Overall Coverage

85%


📈 Total Lines Covered: 9445 out of 11094
📁 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: 62.6%
mssql_python.pybind.logger_bridge.hpp: 70.8%
mssql_python.pybind.connection.connection_pool.cpp: 82.3%
mssql_python.pybind.connection.connection.cpp: 83.1%
mssql_python.logging.py: 86.2%
mssql_python.pooling.py: 90.1%
mssql_python.pybind.fetch_temporal.hpp: 92.1%
mssql_python.cursor.py: 92.5%

🔗 Quick Links

⚙️ Build Summary 📋 Coverage Details

View Azure DevOps Build

Browse Full Coverage Report

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy the narrow set of repository-side runner contract files into isolated Linux wheel test directories, and surface subprocess diagnostics if the status artifact is absent.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 5, 2026 11:54

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.

Copilot review overview

🟡 Changes recommended

Both isolated Linux wheel-test paths omit lock files required by the new regression test, causing FileNotFoundError.

Review effort: Balanced
Findings: 1 High severity · 2 Medium severity

Open (3)

Comment thread OneBranchPipelines/stages/build-linux-single-stage.yml
Keep installed-wheel validation focused on package behavior while release lock and workflow contracts continue to run from a complete source checkout.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 5, 2026 15:35

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 1 High severity · 4 Medium severity · 1 Low severity

Open (6)

Comment thread tests/test_release_build_dependencies.py Outdated
Comment thread tests/test_release_build_dependencies.py Outdated
Comment thread tests/test_038_mssql_odbc_daily_validation.py Outdated
Copilot AI balanced review requested due to automatic review settings October 6, 2026 11:59

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.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 6, 2026 12:03

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-size: medium Moderate update size

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants