Skip to content

Fix release Python setup and ESRP task runner compatibility - #236

Merged
leileizhang (lei9444) merged 2 commits into
mainfrom
lei9444-release-python-setup-fix
Nov 16, 2026
Merged

leileizhang (lei9444) merged 2 commits into
mainfrom
lei9444-release-python-setup-fix

Conversation

@lei9444

@lei9444 leileizhang (lei9444) commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix two release-task startup failures. When Python 3.12 is not cached, the downloaded installer upgrades pip against the blocked default package index; the mirror on the later wheel-verification command cannot configure that earlier setup. Set task-scoped PIP_INDEX_URL on UsePythonVersion@0 so its installer inherits the approved mirror.

Upgrade all three npm/PyPI publishers from EsrpRelease@10 to @11. The installed 10.0.2 task uses Node16, which the agent's end-of-life policy blocks before execution; 11.0.0 uses Node20_1 with compatible existing inputs. Keep all task inputs, approvals, stage dependencies, artifact handling and agent policies unchanged. This changes the ESRP task runner, not the Node version used by shipped packages. Add focused configuration regressions and document both requirements.

Reproduction

Prerequisites:

An Azure Pipelines Windows agent without Python 3.12 cached, where GitHub Python downloads and the approved mirror are reachable but the default pip index is blocked, with no inherited pip mirror configuration. For ESRP, the existing release artifacts and service connection must be configured, and the agent must enforce AGENT_RESTRICT_EOL_NODE_VERSIONS with the installed Node16-based EsrpRelease@10 task.

Steps:

  1. Run this isolated Python setup step on the cold-cache agent:
steps:
  - task: UsePythonVersion@0
    displayName: Setup Python 3.12
    inputs:
      versionSpec: '3.12'
  1. Once Python setup succeeds, run the existing Publish to NPM via ESRP step from .pipelines/release.yml with EsrpRelease@10 and its existing release inputs on the EOL-restricted agent. The same handler incompatibility applies to both PyPI publishers.

Actual behavior:

Python installs, but its pip upgrade fails while querying /simple/pip/; the outer task reports a Python download/setup failure. Sanitized error excerpt:

ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))
ERROR: No matching distribution found for pip

ESRP then fails before its task code executes, preventing npm publication and skipping downstream PyPI publication. Sanitized error excerpt:

No compatible Node.js version available ... Handler type: Node16HandlerData ... blocked by EOL policy

After the fix:

The Python task passes PIP_INDEX_URL: https://packagefeedproxy.microsoft.io/pypi/simple/ to the installer's pip subprocess. All three ESRP publishers select the installed @11 task's Node20_1 handler instead of the blocked Node16 handler, without relaxing the agent policy.

Validation

python -m unittest discover -s eng\ci -p test_ci.py -k ReleasePipelineTests -v passed. The regressions first failed against the missing setup mirror and the old ESRP publisher versions respectively. The hosted Python installer and ESRP publishing were not run; local configuration checks do not prove hosted release completion.

leileizhang (lei9444) and others added 2 commits November 1, 2026 21:16
Configure the approved pip mirror on UsePythonVersion so uncached Python bootstrap uses it before wheel verification. Add a configuration regression and document the task-scoped setting.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use EsrpRelease@11 for npm and both PyPI publishers to avoid the Node16 EOL handler block without changing existing inputs or agent policy. Add a regression for every publisher and document the task runner requirement.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@lei9444 leileizhang (lei9444) changed the title Fix release Python setup to use the approved package mirror Fix release Python setup and ESRP task runner compatibility Nov 1, 2026
@lei9444
leileizhang (lei9444) merged commit 7af6b0e into main Nov 16, 2026
15 checks passed
@lei9444
leileizhang (lei9444) deleted the lei9444-release-python-setup-fix branch November 16, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants