From 801cc797bbffcfe22a7456da373af80634133976 Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Sun, 1 Nov 2026 21:16:29 +0800 Subject: [PATCH 1/2] Fix release Python setup package index 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> --- .pipelines/release.yml | 2 ++ eng/ci/test_ci.py | 17 +++++++++++++++++ eng/release/README.md | 9 +++++++++ 3 files changed, 28 insertions(+) diff --git a/.pipelines/release.yml b/.pipelines/release.yml index c4acd3b2..d45b0114 100644 --- a/.pipelines/release.yml +++ b/.pipelines/release.yml @@ -462,6 +462,8 @@ extends: displayName: Setup Python 3.12 inputs: versionSpec: '3.12' + env: + PIP_INDEX_URL: https://packagefeedproxy.microsoft.io/pypi/simple/ - task: PowerShell@2 displayName: Verify complete Python release set diff --git a/eng/ci/test_ci.py b/eng/ci/test_ci.py index c01e2495..03c93eab 100644 --- a/eng/ci/test_ci.py +++ b/eng/ci/test_ci.py @@ -409,6 +409,23 @@ def test_gate_truth_tables_execute_the_real_gate(self): self.assertEqual(result.returncode, 0, result.stdout + result.stderr) +class ReleasePipelineTests(unittest.TestCase): + def test_python_setup_uses_approved_package_index(self): + pipeline = yaml.safe_load( + (ROOT / ".pipelines" / "release.yml").read_text(encoding="utf-8") + ) + collect = next(stage for stage in pipeline["extends"]["parameters"]["stages"] + if stage.get("stage") == "Collect_Python") + job = next(job for job in collect["jobs"] if job["job"] == "collect_python") + setup = [step for step in job["steps"] if step.get("task") == "UsePythonVersion@0"] + self.assertEqual(len(setup), 1) + self.assertEqual(setup[0]["inputs"]["versionSpec"], "3.12") + self.assertEqual( + setup[0].get("env", {}).get("PIP_INDEX_URL"), + "https://packagefeedproxy.microsoft.io/pypi/simple/", + ) + + class NativeImportGateTests(unittest.TestCase): def test_prebuilt_python_gate_uses_node_and_installed_no_hooks_extension(self): steps = JOBS["e2e-runtime"]["steps"] diff --git a/eng/release/README.md b/eng/release/README.md index dbb4a63e..0282f538 100644 --- a/eng/release/README.md +++ b/eng/release/README.md @@ -46,3 +46,12 @@ supplied `-RepositoryRoot` is still honored. The release job's 1ES SBOM validation remains enabled. Local configuration tests check the staging and publication paths; hosted 1ES execution is needed to verify SBOM generation and validation. + +## Python setup + +In `.pipelines/release.yml`, `Collect_Python` sets the approved package mirror +through task-scoped `PIP_INDEX_URL` on `UsePythonVersion@0`. This configures the +pip upgrade performed by the downloaded Python installer on a cold tool cache. +The `--index-url` on the later wheel-verification command cannot configure the +earlier setup task. `eng/ci/test_ci.py` checks the task's mirror configuration +without installing Python or running a release. From d88f2c19e4376b42207d7f8bd16e0c593f4f5a4f Mon Sep 17 00:00:00 2001 From: "Leilei Zhang (from Dev Box)" Date: Sun, 1 Nov 2026 21:34:14 +0800 Subject: [PATCH 2/2] Upgrade release ESRP tasks to the Node20 runner 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> --- .pipelines/release.yml | 6 +++--- eng/ci/test_ci.py | 19 +++++++++++++++++++ eng/release/README.md | 9 +++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/.pipelines/release.yml b/.pipelines/release.yml index d45b0114..c3fc625d 100644 --- a/.pipelines/release.yml +++ b/.pipelines/release.yml @@ -519,7 +519,7 @@ extends: Write-Host "Packages:" Get-ChildItem $(Pipeline.Workspace)/npm-packages/ - - task: EsrpRelease@10 + - task: EsrpRelease@11 displayName: Publish to NPM via ESRP inputs: ConnectedServiceName: ${{ parameters.signingIdentity.serviceName }} @@ -578,7 +578,7 @@ extends: } $wheels | Copy-Item -Destination $destination - - task: EsrpRelease@10 + - task: EsrpRelease@11 displayName: Publish dynwinrt to PyPI via ESRP inputs: ConnectedServiceName: ${{ parameters.signingIdentity.serviceName }} @@ -629,7 +629,7 @@ extends: } $wheels | Copy-Item -Destination $destination - - task: EsrpRelease@10 + - task: EsrpRelease@11 displayName: Publish dynwinrt-codegen to PyPI via ESRP inputs: ConnectedServiceName: ${{ parameters.signingIdentity.serviceName }} diff --git a/eng/ci/test_ci.py b/eng/ci/test_ci.py index 03c93eab..af5ae522 100644 --- a/eng/ci/test_ci.py +++ b/eng/ci/test_ci.py @@ -425,6 +425,25 @@ def test_python_setup_uses_approved_package_index(self): "https://packagefeedproxy.microsoft.io/pypi/simple/", ) + def test_esrp_publishers_use_node20_task_version(self): + pipeline = yaml.safe_load( + (ROOT / ".pipelines" / "release.yml").read_text(encoding="utf-8") + ) + publishers = [] + for entry in pipeline["extends"]["parameters"]["stages"]: + stages = ([entry] if "stage" in entry else + [stage for conditional in entry.values() for stage in conditional]) + for stage in stages: + for job in stage["jobs"]: + for step in job["steps"]: + if step.get("task", "").startswith("EsrpRelease@"): + publishers.append((job["job"], step["task"])) + self.assertCountEqual(publishers, [ + ("publish_npm", "EsrpRelease@11"), + ("publish_python_runtime", "EsrpRelease@11"), + ("publish_python_codegen", "EsrpRelease@11"), + ]) + class NativeImportGateTests(unittest.TestCase): def test_prebuilt_python_gate_uses_node_and_installed_no_hooks_extension(self): diff --git a/eng/release/README.md b/eng/release/README.md index 0282f538..a0362631 100644 --- a/eng/release/README.md +++ b/eng/release/README.md @@ -55,3 +55,12 @@ pip upgrade performed by the downloaded Python installer on a cold tool cache. The `--index-url` on the later wheel-verification command cannot configure the earlier setup task. `eng/ci/test_ci.py` checks the task's mirror configuration without installing Python or running a release. + +## ESRP task runner + +All npm and PyPI publishers use `EsrpRelease@11`, whose installed task uses the +`Node20_1` handler. The `@10` task uses Node16 and is blocked before execution by +the agent's end-of-life Node policy. The upgrade preserves the existing task +inputs and does not change that policy or the Node version used by shipped +packages. `eng/ci/test_ci.py` checks all three publisher task versions without +invoking ESRP.