From d9d04a8cb0762dde6f1d2ec8811af8aaeea7c519 Mon Sep 17 00:00:00 2001 From: Bill Schnurr Date: Fri, 30 Oct 2026 10:30:10 -0700 Subject: [PATCH 01/12] Use shared English localization action and pull-only release imports Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/localization.yml | 32 ++++++++ .gitignore | 6 +- README.md | 12 +++ build/azure-devdiv-pipeline.pre-release.yml | 74 ++++++----------- build/azure-devdiv-pipeline.stable.yml | 90 ++++++--------------- 5 files changed, 100 insertions(+), 114 deletions(-) create mode 100644 .github/workflows/localization.yml diff --git a/.github/workflows/localization.yml b/.github/workflows/localization.yml new file mode 100644 index 000000000..9b176fc9d --- /dev/null +++ b/.github/workflows/localization.yml @@ -0,0 +1,32 @@ +name: Localization + +on: + workflow_dispatch: + push: + branches: + - main + paths: + - package.json + - package.nls.json + - src/**/*.ts + - .nvmrc + - .github/workflows/localization.yml + +permissions: + contents: read + +concurrency: + group: localization-${{ github.ref }} + cancel-in-progress: false + +jobs: + localization: + if: github.repository == 'microsoft/vscode-python-environments' + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: microsoft/vscode-common-python-lsp/.github/actions/localization@d1877b84bb10ff7caa6bd12ab4e75498ba760790 + with: + app-id: ${{ vars.PYTHON_LOCALIZATION_APP_ID }} + private-key: ${{ secrets.PYTHON_LOCALIZATION_PRIVATE_KEY }} + node-version: '22.21.1' diff --git a/.gitignore b/.gitignore index dddeeba2e..aba557387 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,8 @@ src/test/integration/test-workspace/**/pyenvs-*/ ai-artifacts/* # Code health analysis snapshots (generated, uploaded as artifacts) -analysis-snapshot.json \ No newline at end of file +analysis-snapshot.json + +# Localization is generated from the dev handback during releases. +/package.nls.*.json +/l10n/ diff --git a/README.md b/README.md index 286288de0..46571f1e5 100644 --- a/README.md +++ b/README.md @@ -382,3 +382,15 @@ This project may contain trademarks or logos for projects, products, or services [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies. + +### Localization + +The **Localization** GitHub workflow submits English strings using the [shared composite action and Python tooling](https://github.com/microsoft/vscode-common-python-lsp#shared-localization-automation). Stable and pre-release DevDiv pipelines independently retrieve translations through Pylance-Eng's `pullLocalization: true`; releases never submit English or create translation-update PRs. + +Both paths use `microsoft/vscode-python-extensions-loc`, branch **`dev`**, with canonical extension ID **`ms-python.vscode-python-envs`**. English XLF is stored in `src/en/ms-python.vscode-python-envs` and handbacks in `out/ms-python.vscode-python-envs`. The action and Azure tooling checkout are pinned to the same reviewed revision. + +Configure the `PYTHON_LOCALIZATION_APP_ID` Actions variable and `PYTHON_LOCALIZATION_PRIVATE_KEY` secret here, or grant access to organization-level credentials. The app needs Contents write access only to the localization drop; the caller's repository token stays read-only. The shared action uses the Microsoft npm proxy and pinned localization CLI. Authorize the literal `Github-Pylance` service connection for both Azure repository resources and release pipelines. + +Keep English `package.nls.json` tracked. Root `package.nls..json` and `l10n/` runtime files are generated, git-ignored release outputs. VSCE must include generated locale files despite Git ignores. Local builds are English-only unless translations are imported explicitly. + +Translation is asynchronous. All 14 supported locales must be present, and every required real-language table must contain translation evidence. Individual untranslated strings are allowed. Missing, incomplete, or wholly untranslated handbacks fail before packaging, without falling back to stale translations. Do not publish while onboarding or real translated output is pending. diff --git a/build/azure-devdiv-pipeline.pre-release.yml b/build/azure-devdiv-pipeline.pre-release.yml index 1976fdea5..b37d5fa7e 100644 --- a/build/azure-devdiv-pipeline.pre-release.yml +++ b/build/azure-devdiv-pipeline.pre-release.yml @@ -12,15 +12,20 @@ schedules: resources: repositories: - - repository: MicroBuildTemplate - type: git - name: 1ESPipelineTemplates/MicroBuildTemplate - ref: refs/tags/release - - repository: templates type: git name: DevDiv/Pylance-Eng - ref: refs/heads/main + ref: refs/heads/users/bschnurr/localization-wrapper + - repository: translations + type: github + name: microsoft/vscode-python-extensions-loc + ref: refs/heads/dev + endpoint: Github-Pylance + - repository: localizationTools + type: github + name: microsoft/vscode-common-python-lsp + ref: d1877b84bb10ff7caa6bd12ab4e75498ba760790 + endpoint: Github-Pylance variables: - name: TeamName @@ -34,7 +39,7 @@ variables: parameters: - name: publishExtension - displayName: 🚀 Publish Extension + displayName: 🚀 Publish Extension type: boolean default: true @@ -78,46 +83,17 @@ parameters: displayName: Build extension extends: - template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate + template: azure-pipelines/extension/pre-release.yml@templates parameters: - sdl: - sourceAnalysisPool: VSEng-MicroBuildVSStable - codeSignValidation: - enabled: true - sbom: - enabled: false # Disable global SBOM generation; enable it on the signed artifact. - pool: - name: AzurePipelines-EO - os: windows - - customBuildTags: - - ES365AIMigrationTooling - - stages: - - stage: Build - displayName: Build & Package Extension - jobs: - - template: azure-pipelines/extension/templates/jobs/package.yml@templates - parameters: - buildPlatforms: ${{ parameters.buildPlatforms }} - buildSteps: ${{ parameters.buildSteps }} - isPreRelease: true - standardizedVersioning: true - customNPMRegistry: $(AZURE_ARTIFACTS_FEED) - nodeVersion: $(NodeVersion) - - - stage: Publish - displayName: Publish Extension - dependsOn: Build - jobs: - - template: azure-pipelines/extension/templates/jobs/publish-extension.yml@templates - parameters: - buildPlatforms: ${{ parameters.buildPlatforms }} - publishExtension: ${{ parameters.publishExtension }} - preRelease: true - teamName: $(TeamName) - ghCreateTag: true - ghCreateRelease: true - ghReleaseAddChangeLog: true - customNPMRegistry: $(AZURE_ARTIFACTS_FEED) - nodeVersion: $(NodeVersion) + buildPlatforms: ${{ parameters.buildPlatforms }} + buildSteps: ${{ parameters.buildSteps }} + standardizedVersioning: true + customNPMRegistry: $(AZURE_ARTIFACTS_FEED) + nodeVersion: $(NodeVersion) + publishExtension: ${{ parameters.publishExtension }} + teamName: $(TeamName) + ghCreateTag: true + ghCreateRelease: true + ghReleaseAddChangeLog: true + sourceAnalysisPool: VSEng-MicroBuildVSStable + pullLocalization: true diff --git a/build/azure-devdiv-pipeline.stable.yml b/build/azure-devdiv-pipeline.stable.yml index b6df2b882..b2efd6149 100644 --- a/build/azure-devdiv-pipeline.stable.yml +++ b/build/azure-devdiv-pipeline.stable.yml @@ -7,15 +7,20 @@ pr: none resources: repositories: - - repository: MicroBuildTemplate - type: git - name: 1ESPipelineTemplates/MicroBuildTemplate - ref: refs/tags/release - - repository: templates type: git name: DevDiv/Pylance-Eng - ref: refs/heads/main + ref: refs/heads/users/bschnurr/localization-wrapper + - repository: translations + type: github + name: microsoft/vscode-python-extensions-loc + ref: refs/heads/dev + endpoint: Github-Pylance + - repository: localizationTools + type: github + name: microsoft/vscode-common-python-lsp + ref: d1877b84bb10ff7caa6bd12ab4e75498ba760790 + endpoint: Github-Pylance variables: - name: TeamName @@ -29,7 +34,7 @@ variables: parameters: - name: publishExtension - displayName: 🚀 Publish Extension + displayName: 🚀 Publish Extension type: boolean default: true @@ -73,61 +78,18 @@ parameters: displayName: Build extension extends: - template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate + template: azure-pipelines/extension/stable.yml@templates parameters: - sdl: - sourceAnalysisPool: VSEng-MicroBuildVSStable - codeSignValidation: - enabled: true - sbom: - enabled: false # Disable global SBOM generation; enable it on the signed artifact. - pool: - name: AzurePipelines-EO - os: windows - - customBuildTags: - - ES365AIMigrationTooling - - stages: - - stage: Build - displayName: Build & Package Extension - jobs: - - template: azure-pipelines/extension/templates/jobs/package.yml@templates - parameters: - buildPlatforms: ${{ parameters.buildPlatforms }} - buildSteps: ${{ parameters.buildSteps }} - isPreRelease: false - standardizedVersioning: true - customNPMRegistry: $(AZURE_ARTIFACTS_FEED) - nodeVersion: $(NodeVersion) - - - stage: WaitForValidation - displayName: Wait for Validation - dependsOn: Build - jobs: - - job: wait_for_validation - displayName: Wait for manual validation - pool: server - steps: - - task: ManualValidation@0 - timeoutInMinutes: 1440 # task times out in 1 day - inputs: - notifyUsers: 'plseng@microsoft.com' - instructions: 'please test the latest draft release then publish it.' - onTimeout: reject - - - stage: Publish - displayName: Publish Extension - dependsOn: WaitForValidation - jobs: - - template: azure-pipelines/extension/templates/jobs/publish-extension.yml@templates - parameters: - buildPlatforms: ${{ parameters.buildPlatforms }} - publishExtension: ${{ parameters.publishExtension }} - preRelease: false - teamName: $(TeamName) - ghCreateTag: true - ghCreateRelease: true - ghReleaseAddChangeLog: true - customNPMRegistry: $(AZURE_ARTIFACTS_FEED) - nodeVersion: $(NodeVersion) + buildPlatforms: ${{ parameters.buildPlatforms }} + buildSteps: ${{ parameters.buildSteps }} + standardizedVersioning: true + customNPMRegistry: $(AZURE_ARTIFACTS_FEED) + nodeVersion: $(NodeVersion) + publishExtension: ${{ parameters.publishExtension }} + teamName: $(TeamName) + ghCreateTag: true + ghCreateRelease: true + ghReleaseAddChangeLog: true + validationNotifyUsers: plseng@microsoft.com + sourceAnalysisPool: VSEng-MicroBuildVSStable + pullLocalization: true From 95245a6e9bf65d649fe7c30f5afdffeac7e5160c Mon Sep 17 00:00:00 2001 From: Bill Schnurr Date: Tue, 3 Nov 2026 10:37:47 -0700 Subject: [PATCH 02/12] Restore UTF-8 release parameter display names Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- build/azure-devdiv-pipeline.pre-release.yml | 2 +- build/azure-devdiv-pipeline.stable.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/azure-devdiv-pipeline.pre-release.yml b/build/azure-devdiv-pipeline.pre-release.yml index b37d5fa7e..02f3f59f1 100644 --- a/build/azure-devdiv-pipeline.pre-release.yml +++ b/build/azure-devdiv-pipeline.pre-release.yml @@ -39,7 +39,7 @@ variables: parameters: - name: publishExtension - displayName: 🚀 Publish Extension + displayName: 🚀 Publish Extension type: boolean default: true diff --git a/build/azure-devdiv-pipeline.stable.yml b/build/azure-devdiv-pipeline.stable.yml index b2efd6149..2939b1b72 100644 --- a/build/azure-devdiv-pipeline.stable.yml +++ b/build/azure-devdiv-pipeline.stable.yml @@ -34,7 +34,7 @@ variables: parameters: - name: publishExtension - displayName: 🚀 Publish Extension + displayName: 🚀 Publish Extension type: boolean default: true From 5e192fc07ba72cc5ff2ba40a086a40db38549e6f Mon Sep 17 00:00:00 2001 From: Bill Schnurr Date: Tue, 3 Nov 2026 11:50:36 -0700 Subject: [PATCH 03/12] Fix global selection routing and retain Windows test diagnostics Keep the selecting manager separate from the fallback environment owner when clearing explicit global selections. Capture non-Linux E2E and integration host logs to diagnose remaining failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d6166fde-f261-4e66-abe4-3ef5c1313713 --- .github/workflows/pr-check.yml | 24 ++++++++++++++++++++++++ src/features/envManagers.ts | 21 +++++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index b4d3ad8e1..697db75f9 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -306,8 +306,20 @@ jobs: - name: Run E2E Tests (non-Linux) if: runner.os != 'Linux' + id: e2e-non-linux + env: + VSCODE_TEST_DIAGNOSTICS_DIR: ${{ runner.temp }}/vscode-test-diagnostics run: npm run e2e-test + - name: Upload E2E failure diagnostics (non-Linux) + if: ${{ failure() && steps.e2e-non-linux.outcome == 'failure' }} + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: e2e-${{ matrix.os }}-${{ matrix.python-version }}-${{ github.run_attempt }} + path: ${{ runner.temp }}/vscode-test-diagnostics + if-no-files-found: error + retention-days: 7 + integration-tests: name: Integration Tests runs-on: ${{ matrix.os }} @@ -409,8 +421,20 @@ jobs: - name: Run Integration Tests (non-Linux) if: runner.os != 'Linux' + id: integration-non-linux + env: + VSCODE_TEST_DIAGNOSTICS_DIR: ${{ runner.temp }}/vscode-test-diagnostics run: npm run integration-test + - name: Upload integration failure diagnostics (non-Linux) + if: ${{ failure() && steps.integration-non-linux.outcome == 'failure' }} + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: integration-${{ matrix.os }}-${{ matrix.python-version }}-${{ github.run_attempt }} + path: ${{ runner.temp }}/vscode-test-diagnostics + if-no-files-found: error + retention-days: 7 + integration-tests-multiroot: name: Integration Tests (Multi-Root) runs-on: ${{ matrix.os }} diff --git a/src/features/envManagers.ts b/src/features/envManagers.ts index c6bda1afb..6e36f2e9b 100644 --- a/src/features/envManagers.ts +++ b/src/features/envManagers.ts @@ -206,6 +206,7 @@ export class PythonEnvironmentManagers implements EnvironmentManagers { * Only mutated by setEnvironment() / setEnvironments() / refreshEnvironment(). */ private readonly _activeSelection = new Map(); + private _globalSelectionManagerId: string | undefined; /** * The last explicit selection for each scope, keyed like `_activeSelection`: the manager that stores * it, and whether the user made it. Explicit selections are user selections and environments chosen @@ -1130,16 +1131,25 @@ export class PythonEnvironmentManagers implements EnvironmentManagers { ): 'recorded' | 'cleared' | 'kept' | 'unchanged' { if (environment && explicit && manager.id !== INLINE_SCRIPT_MANAGER_ID) { this._explicitSelections.set(key, { managerId: manager.id, userSelected }); + if (key === 'global') { + this._globalSelectionManagerId = manager.id; + } return 'recorded'; } const current = this._explicitSelections.get(key); if (!current) { + if (key === 'global') { + this._globalSelectionManagerId = manager.id; + } return 'unchanged'; } if (!userSelected && current.userSelected) { return 'kept'; } this._explicitSelections.delete(key); + if (key === 'global') { + this._globalSelectionManagerId = getDefaultEnvManagerSetting(this.pm, undefined); + } return 'cleared'; } @@ -1239,8 +1249,15 @@ export class PythonEnvironmentManagers implements EnvironmentManagers { ? this._environmentManagers.get(cachedEnv.envId.managerId) : undefined; - if (context === undefined && cachedManager) { - return cachedManager; + if (context === undefined) { + // A manager may return another manager's fallback environment; route through + // the manager that selected it, not the owner of the announced descriptor. + const globalManager = this._globalSelectionManagerId + ? this._environmentManagers.get(this._globalSelectionManagerId) + : cachedManager; + if (globalManager) { + return globalManager; + } } const defaultEnvManagerId = getDefaultEnvManagerSetting(this.pm, context); From 385c9c6a0cac2e30fffc179f5fa8969bb445c28e Mon Sep 17 00:00:00 2001 From: Bill Schnurr Date: Tue, 3 Nov 2026 12:30:20 -0700 Subject: [PATCH 04/12] Cover global refresh after clearing an explicit interpreter Verify that a later configured-manager refresh publishes and reads its new environment rather than routing through the stale fallback owner. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d6166fde-f261-4e66-abe4-3ef5c1313713 --- src/test/features/envManagers.unit.test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/test/features/envManagers.unit.test.ts b/src/test/features/envManagers.unit.test.ts index a41e4e6d1..9f4c391eb 100644 --- a/src/test/features/envManagers.unit.test.ts +++ b/src/test/features/envManagers.unit.test.ts @@ -680,6 +680,24 @@ suite('PythonEnvironmentManagers - selection stored by a non-default manager', ( assert.strictEqual(envManagers.getLastKnownEnvironment(undefined)?.envId.id, newestGlobal.envId.id); }); + test('global refresh follows the configured manager after an explicit selection is cleared', async () => { + await envManagers.setEnvironments('global', configured, false, { explicit: true }); + await envManagers.setEnvironments('global', configured, false); + await flush(); + const changeEvents: DidChangeEnvironmentEventArgs[] = []; + envManagers.onDidChangeActiveEnvironment((e) => changeEvents.push(e)); + venvGet.resolves(localVenv); + + await envManagers.refreshEnvironment(undefined); + await flush(); + + assert.strictEqual((await envManagers.getEnvironment(undefined))?.envId.id, localVenv.envId.id); + assert.deepStrictEqual( + changeEvents.map((e) => [e.old?.envId.id, e.new?.envId.id]), + [[newestGlobal.envId.id, localVenv.envId.id]], + ); + }); + test('clearing an explicit project selection publishes the environment that reads now return', async () => { await envManagers.setEnvironment(projectUri, configured, false, { explicit: true }); await flush(); From d3330064ad4f64e2120bcdf242c968c0a2f0e7ad Mon Sep 17 00:00:00 2001 From: Bill Schnurr Date: Wed, 4 Nov 2026 11:49:09 -0700 Subject: [PATCH 05/12] Use merged Pylance-Eng main for localization releases Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- build/azure-devdiv-pipeline.pre-release.yml | 2 +- build/azure-devdiv-pipeline.stable.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/azure-devdiv-pipeline.pre-release.yml b/build/azure-devdiv-pipeline.pre-release.yml index 02f3f59f1..8f5246ea8 100644 --- a/build/azure-devdiv-pipeline.pre-release.yml +++ b/build/azure-devdiv-pipeline.pre-release.yml @@ -15,7 +15,7 @@ resources: - repository: templates type: git name: DevDiv/Pylance-Eng - ref: refs/heads/users/bschnurr/localization-wrapper + ref: refs/heads/main - repository: translations type: github name: microsoft/vscode-python-extensions-loc diff --git a/build/azure-devdiv-pipeline.stable.yml b/build/azure-devdiv-pipeline.stable.yml index 2939b1b72..1d02ff03b 100644 --- a/build/azure-devdiv-pipeline.stable.yml +++ b/build/azure-devdiv-pipeline.stable.yml @@ -10,7 +10,7 @@ resources: - repository: templates type: git name: DevDiv/Pylance-Eng - ref: refs/heads/users/bschnurr/localization-wrapper + ref: refs/heads/main - repository: translations type: github name: microsoft/vscode-python-extensions-loc From 32c59feb41309fad5393b275d42446eb2634c9be Mon Sep 17 00:00:00 2001 From: Bill Schnurr Date: Wed, 4 Nov 2026 12:06:44 -0700 Subject: [PATCH 06/12] Explain temporary localization dev branch reference Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- build/azure-devdiv-pipeline.pre-release.yml | 1 + build/azure-devdiv-pipeline.stable.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/build/azure-devdiv-pipeline.pre-release.yml b/build/azure-devdiv-pipeline.pre-release.yml index 8f5246ea8..d9f096ecc 100644 --- a/build/azure-devdiv-pipeline.pre-release.yml +++ b/build/azure-devdiv-pipeline.pre-release.yml @@ -19,6 +19,7 @@ resources: - repository: translations type: github name: microsoft/vscode-python-extensions-loc + # Temporarily use dev while the localization force-push issue is resolved. ref: refs/heads/dev endpoint: Github-Pylance - repository: localizationTools diff --git a/build/azure-devdiv-pipeline.stable.yml b/build/azure-devdiv-pipeline.stable.yml index 1d02ff03b..9d74cc3c6 100644 --- a/build/azure-devdiv-pipeline.stable.yml +++ b/build/azure-devdiv-pipeline.stable.yml @@ -14,6 +14,7 @@ resources: - repository: translations type: github name: microsoft/vscode-python-extensions-loc + # Temporarily use dev while the localization force-push issue is resolved. ref: refs/heads/dev endpoint: Github-Pylance - repository: localizationTools From b936289ca59943e80d50eda013e18fa4c633af2b Mon Sep 17 00:00:00 2001 From: Bill Schnurr Date: Thu, 5 Nov 2026 13:51:35 -0700 Subject: [PATCH 07/12] Use shared localization tooling with English fallback Pin submission and release imports to the same reviewed shared revision. Untranslated handbacks no longer block packaging; required locale tables and structural checks remain. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/localization.yml | 2 +- README.md | 2 +- build/azure-devdiv-pipeline.pre-release.yml | 2 +- build/azure-devdiv-pipeline.stable.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/localization.yml b/.github/workflows/localization.yml index 9b176fc9d..cc425be38 100644 --- a/.github/workflows/localization.yml +++ b/.github/workflows/localization.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 20 steps: - - uses: microsoft/vscode-common-python-lsp/.github/actions/localization@d1877b84bb10ff7caa6bd12ab4e75498ba760790 + - uses: microsoft/vscode-common-python-lsp/.github/actions/localization@6b4a3573e7e7a9fe1e468e129544432278aec2d6 with: app-id: ${{ vars.PYTHON_LOCALIZATION_APP_ID }} private-key: ${{ secrets.PYTHON_LOCALIZATION_PRIVATE_KEY }} diff --git a/README.md b/README.md index 46571f1e5..62b4124a2 100644 --- a/README.md +++ b/README.md @@ -393,4 +393,4 @@ Configure the `PYTHON_LOCALIZATION_APP_ID` Actions variable and `PYTHON_LOCALIZA Keep English `package.nls.json` tracked. Root `package.nls..json` and `l10n/` runtime files are generated, git-ignored release outputs. VSCE must include generated locale files despite Git ignores. Local builds are English-only unless translations are imported explicitly. -Translation is asynchronous. All 14 supported locales must be present, and every required real-language table must contain translation evidence. Individual untranslated strings are allowed. Missing, incomplete, or wholly untranslated handbacks fail before packaging, without falling back to stale translations. Do not publish while onboarding or real translated output is pending. +Translation is asynchronous. Nonempty manifest and runtime tables must be present for all 14 supported locales. Untranslated strings, including wholly untranslated tables, are allowed; users see English until translations arrive. Missing, empty, malformed, or incomplete handbacks still fail before packaging, without falling back to stale translations. diff --git a/build/azure-devdiv-pipeline.pre-release.yml b/build/azure-devdiv-pipeline.pre-release.yml index d9f096ecc..a13485b37 100644 --- a/build/azure-devdiv-pipeline.pre-release.yml +++ b/build/azure-devdiv-pipeline.pre-release.yml @@ -25,7 +25,7 @@ resources: - repository: localizationTools type: github name: microsoft/vscode-common-python-lsp - ref: d1877b84bb10ff7caa6bd12ab4e75498ba760790 + ref: 6b4a3573e7e7a9fe1e468e129544432278aec2d6 endpoint: Github-Pylance variables: diff --git a/build/azure-devdiv-pipeline.stable.yml b/build/azure-devdiv-pipeline.stable.yml index 9d74cc3c6..b1daa3ce5 100644 --- a/build/azure-devdiv-pipeline.stable.yml +++ b/build/azure-devdiv-pipeline.stable.yml @@ -20,7 +20,7 @@ resources: - repository: localizationTools type: github name: microsoft/vscode-common-python-lsp - ref: d1877b84bb10ff7caa6bd12ab4e75498ba760790 + ref: 6b4a3573e7e7a9fe1e468e129544432278aec2d6 endpoint: Github-Pylance variables: From d05f18e499a9d8747364a181d7fafff921cf9c39 Mon Sep 17 00:00:00 2001 From: Bill Schnurr Date: Mon, 9 Nov 2026 15:26:36 -0700 Subject: [PATCH 08/12] Use GitHub Pylance engineering pipeline templates Switch both release resources to microsoft/pylance-eng through Github-Pylance while preserving release settings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 2 +- build/azure-devdiv-pipeline.pre-release.yml | 5 +++-- build/azure-devdiv-pipeline.stable.yml | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 62b4124a2..841fe718a 100644 --- a/README.md +++ b/README.md @@ -389,7 +389,7 @@ The **Localization** GitHub workflow submits English strings using the [shared c Both paths use `microsoft/vscode-python-extensions-loc`, branch **`dev`**, with canonical extension ID **`ms-python.vscode-python-envs`**. English XLF is stored in `src/en/ms-python.vscode-python-envs` and handbacks in `out/ms-python.vscode-python-envs`. The action and Azure tooling checkout are pinned to the same reviewed revision. -Configure the `PYTHON_LOCALIZATION_APP_ID` Actions variable and `PYTHON_LOCALIZATION_PRIVATE_KEY` secret here, or grant access to organization-level credentials. The app needs Contents write access only to the localization drop; the caller's repository token stays read-only. The shared action uses the Microsoft npm proxy and pinned localization CLI. Authorize the literal `Github-Pylance` service connection for both Azure repository resources and release pipelines. +Configure the `PYTHON_LOCALIZATION_APP_ID` Actions variable and `PYTHON_LOCALIZATION_PRIVATE_KEY` secret here, or grant access to organization-level credentials. The app needs Contents write access only to the localization drop; the caller's repository token stays read-only. The shared action uses the Microsoft npm proxy and pinned localization CLI. Authorize the literal `Github-Pylance` service connection for the [pipeline templates](https://github.com/microsoft/pylance-eng), translation, and shared-tooling repository resources in both release pipelines. Keep English `package.nls.json` tracked. Root `package.nls..json` and `l10n/` runtime files are generated, git-ignored release outputs. VSCE must include generated locale files despite Git ignores. Local builds are English-only unless translations are imported explicitly. diff --git a/build/azure-devdiv-pipeline.pre-release.yml b/build/azure-devdiv-pipeline.pre-release.yml index a13485b37..df5b706f8 100644 --- a/build/azure-devdiv-pipeline.pre-release.yml +++ b/build/azure-devdiv-pipeline.pre-release.yml @@ -13,9 +13,10 @@ schedules: resources: repositories: - repository: templates - type: git - name: DevDiv/Pylance-Eng + type: github + name: microsoft/pylance-eng ref: refs/heads/main + endpoint: Github-Pylance - repository: translations type: github name: microsoft/vscode-python-extensions-loc diff --git a/build/azure-devdiv-pipeline.stable.yml b/build/azure-devdiv-pipeline.stable.yml index b1daa3ce5..ef4851d94 100644 --- a/build/azure-devdiv-pipeline.stable.yml +++ b/build/azure-devdiv-pipeline.stable.yml @@ -8,9 +8,10 @@ pr: none resources: repositories: - repository: templates - type: git - name: DevDiv/Pylance-Eng + type: github + name: microsoft/pylance-eng ref: refs/heads/main + endpoint: Github-Pylance - repository: translations type: github name: microsoft/vscode-python-extensions-loc From b6fa7d5bed5b2c13c0704c9b666fe4efdfc510ac Mon Sep 17 00:00:00 2001 From: Bill Schnurr Date: Mon, 9 Nov 2026 16:43:43 -0700 Subject: [PATCH 09/12] Use explicit selection record for global manager routing Remove duplicate global manager state and read the selected manager directly from the existing explicit-selection record. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/features/envManagers.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/features/envManagers.ts b/src/features/envManagers.ts index 6979d3341..2c5687cfc 100644 --- a/src/features/envManagers.ts +++ b/src/features/envManagers.ts @@ -206,7 +206,6 @@ export class PythonEnvironmentManagers implements EnvironmentManagers { * Only mutated by setEnvironment() / setEnvironments() / refreshEnvironment(). */ private readonly _activeSelection = new Map(); - private _globalSelectionManagerId: string | undefined; /** * The last explicit selection for each scope, keyed like `_activeSelection`: the manager that stores * it, and whether the user made it. Explicit selections are user selections and environments chosen @@ -1131,25 +1130,16 @@ export class PythonEnvironmentManagers implements EnvironmentManagers { ): 'recorded' | 'cleared' | 'kept' | 'unchanged' { if (environment && explicit && manager.id !== INLINE_SCRIPT_MANAGER_ID) { this._explicitSelections.set(key, { managerId: manager.id, userSelected }); - if (key === 'global') { - this._globalSelectionManagerId = manager.id; - } return 'recorded'; } const current = this._explicitSelections.get(key); if (!current) { - if (key === 'global') { - this._globalSelectionManagerId = manager.id; - } return 'unchanged'; } if (!userSelected && current.userSelected) { return 'kept'; } this._explicitSelections.delete(key); - if (key === 'global') { - this._globalSelectionManagerId = getDefaultEnvManagerSetting(this.pm, undefined); - } return 'cleared'; } @@ -1249,12 +1239,11 @@ export class PythonEnvironmentManagers implements EnvironmentManagers { ? this._environmentManagers.get(cachedEnv.envId.managerId) : undefined; - if (context === undefined && this._explicitSelections.has('global')) { + const globalSelection = context === undefined ? this._explicitSelections.get('global') : undefined; + if (globalSelection) { // A manager may return another manager's fallback environment; route through // the manager that selected it, not the owner of the announced descriptor. - const globalManager = this._globalSelectionManagerId - ? this._environmentManagers.get(this._globalSelectionManagerId) - : cachedManager; + const globalManager = this._environmentManagers.get(globalSelection.managerId); if (globalManager) { return globalManager; } From 4f61431efded15f1f01accfc34b872273b69dad6 Mon Sep 17 00:00:00 2001 From: Bill Schnurr Date: Mon, 9 Nov 2026 17:02:49 -0700 Subject: [PATCH 10/12] Clarify explicit global selection routing Explain the global-only override, selecting-manager identity, and configured/cached fallback behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/features/envManagers.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/features/envManagers.ts b/src/features/envManagers.ts index 858b141ce..696c1ae78 100644 --- a/src/features/envManagers.ts +++ b/src/features/envManagers.ts @@ -1262,10 +1262,12 @@ export class PythonEnvironmentManagers implements EnvironmentManagers { ? this._environmentManagers.get(cachedEnv.envId.managerId) : undefined; + // Only an explicit global selection overrides the configured default here; project/file + // routing is unchanged. Use its selecting manager, not the cached descriptor's owner: + // a manager may return another manager's fallback environment. Without an explicit record + // or a registered selecting manager, fall through to configured/cached routing below. const globalSelection = context === undefined ? this._explicitSelections.get('global') : undefined; if (globalSelection) { - // A manager may return another manager's fallback environment; route through - // the manager that selected it, not the owner of the announced descriptor. const globalManager = this._environmentManagers.get(globalSelection.managerId); if (globalManager) { return globalManager; From a996a22267b26463cf5cf8ae1bdcfae0ba4c4afb Mon Sep 17 00:00:00 2001 From: Bill Schnurr Date: Mon, 9 Nov 2026 17:46:03 -0700 Subject: [PATCH 11/12] Keep environment routing changes out of localization rollout Restore the runtime routing implementation and its tests to main, removing the added global-refresh regression test. Keep localization and pipeline template changes intact. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/features/envManagers.ts | 12 ++---------- src/test/features/envManagers.unit.test.ts | 18 ------------------ 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/src/features/envManagers.ts b/src/features/envManagers.ts index 696c1ae78..1eace126e 100644 --- a/src/features/envManagers.ts +++ b/src/features/envManagers.ts @@ -1262,16 +1262,8 @@ export class PythonEnvironmentManagers implements EnvironmentManagers { ? this._environmentManagers.get(cachedEnv.envId.managerId) : undefined; - // Only an explicit global selection overrides the configured default here; project/file - // routing is unchanged. Use its selecting manager, not the cached descriptor's owner: - // a manager may return another manager's fallback environment. Without an explicit record - // or a registered selecting manager, fall through to configured/cached routing below. - const globalSelection = context === undefined ? this._explicitSelections.get('global') : undefined; - if (globalSelection) { - const globalManager = this._environmentManagers.get(globalSelection.managerId); - if (globalManager) { - return globalManager; - } + if (context === undefined && cachedManager && this._explicitSelections.has('global')) { + return cachedManager; } const defaultEnvManagerId = getDefaultEnvManagerSetting(this.pm, context); diff --git a/src/test/features/envManagers.unit.test.ts b/src/test/features/envManagers.unit.test.ts index 482ecbd01..a478d890a 100644 --- a/src/test/features/envManagers.unit.test.ts +++ b/src/test/features/envManagers.unit.test.ts @@ -680,24 +680,6 @@ suite('PythonEnvironmentManagers - selection stored by a non-default manager', ( assert.strictEqual(envManagers.getLastKnownEnvironment(undefined)?.envId.id, newestGlobal.envId.id); }); - test('global refresh follows the configured manager after an explicit selection is cleared', async () => { - await envManagers.setEnvironments('global', configured, false, { explicit: true }); - await envManagers.setEnvironments('global', configured, false); - await flush(); - const changeEvents: DidChangeEnvironmentEventArgs[] = []; - envManagers.onDidChangeActiveEnvironment((e) => changeEvents.push(e)); - venvGet.resolves(localVenv); - - await envManagers.refreshEnvironment(undefined); - await flush(); - - assert.strictEqual((await envManagers.getEnvironment(undefined))?.envId.id, localVenv.envId.id); - assert.deepStrictEqual( - changeEvents.map((e) => [e.old?.envId.id, e.new?.envId.id]), - [[newestGlobal.envId.id, localVenv.envId.id]], - ); - }); - test('clearing an explicit project selection publishes the environment that reads now return', async () => { await envManagers.setEnvironment(projectUri, configured, false, { explicit: true }); await flush(); From f8e829ae0568f9de7dd84d65424442ad108c419e Mon Sep 17 00:00:00 2001 From: Bill Schnurr Date: Mon, 9 Nov 2026 17:51:31 -0700 Subject: [PATCH 12/12] Remove unrelated PR test diagnostics from localization rollout Restore pr-check.yml to main. The non-Linux diagnostic upload instrumentation was left over from earlier test debugging and is not required for localization. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/pr-check.yml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 2b99ac2ca..91d872173 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -304,20 +304,8 @@ jobs: - name: Run E2E Tests (non-Linux) if: runner.os != 'Linux' - id: e2e-non-linux - env: - VSCODE_TEST_DIAGNOSTICS_DIR: ${{ runner.temp }}/vscode-test-diagnostics run: npm run e2e-test - - name: Upload E2E failure diagnostics (non-Linux) - if: ${{ failure() && steps.e2e-non-linux.outcome == 'failure' }} - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - with: - name: e2e-${{ matrix.os }}-${{ matrix.python-version }}-${{ github.run_attempt }} - path: ${{ runner.temp }}/vscode-test-diagnostics - if-no-files-found: error - retention-days: 7 - integration-tests: name: Integration Tests runs-on: ${{ matrix.os }} @@ -419,20 +407,8 @@ jobs: - name: Run Integration Tests (non-Linux) if: runner.os != 'Linux' - id: integration-non-linux - env: - VSCODE_TEST_DIAGNOSTICS_DIR: ${{ runner.temp }}/vscode-test-diagnostics run: npm run integration-test - - name: Upload integration failure diagnostics (non-Linux) - if: ${{ failure() && steps.integration-non-linux.outcome == 'failure' }} - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - with: - name: integration-${{ matrix.os }}-${{ matrix.python-version }}-${{ github.run_attempt }} - path: ${{ runner.temp }}/vscode-test-diagnostics - if-no-files-found: error - retention-days: 7 - integration-tests-multiroot: name: Integration Tests (Multi-Root) runs-on: ${{ matrix.os }}