Skip to content

Use shared localization submission and pull-only release imports - #1971

Open
Bill Schnurr (bschnurr) wants to merge 9 commits into
mainfrom
users/bschnurr/shared-localization
Open

Bill Schnurr (bschnurr) wants to merge 9 commits into
mainfrom
users/bschnurr/shared-localization

Conversation

@bschnurr

Copy link
Copy Markdown
Member

Summary

  • Use the shared Python localization core and composite action rather than copying helper scripts into this extension.
  • Keep GitHub English submission separate from pull-only DevDiv stable/pre-release imports.
  • Use drop branch dev and canonical extension ID ms-python.vscode-python-envs; remove tracked generated locale snapshots where present and keep generated files in VSIX selection.
  • Preserve existing runtime metadata, extraction sources, feeds, platform matrices, and version/validation behavior.
  • Validate readiness independently in every required real-language manifest/runtime table; allow individual untranslated entries and reject missing/wholly untranslated tables before packaging.

Shared dependencies

The GitHub action and Azure tooling checkout are pinned to d1877b84bb10ff7caa6bd12ab4e75498ba760790. Azure templates temporarily reference the shared feature branch for verification; switch to Pylance-Eng main after the dependency merges, before merging this caller.

Verification

Executable guards read the actual YAML and preserve existing triggers, build steps, publication defaults, validation contacts, version flags, and matrices. Both release YAMLs expanded with publishing explicitly disabled (environments used the enabled validation definition because its native definitions are disabled). Actual English export used the pinned CLI through the internal feed. Changed YAML/JSON formatting and whitespace checks passed.

Required setup and release blockers

Canonical English/output directories are absent from drop dev. Both native DevDiv release definitions are disabled; the exact YAML was expanded through the enabled isort validation definition without enabling them.

No repository-level PYTHON_LOCALIZATION_APP_ID variable or PYTHON_LOCALIZATION_PRIVATE_KEY secret is currently visible here. Organization-level access could not be verified with current permissions. Configure or expose them through the owners; do not copy credentials between repositories. Authorize Github-Pylance for both release resources/pipelines.

Keep this PR draft while dependencies/setup/handbacks are pending. No merge or publication is requested.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bschnurr Bill Schnurr (bschnurr) added the debt Code quality issues label Oct 30, 2026
@bschnurr

Copy link
Copy Markdown
Member Author

Current CI blocker: Smoke Tests (windows-latest, 3.15) fails in the before-all hook because environment discovery does not complete within 45000ms. This PR does not change the runtime discovery implementation or smoke-test workflow. The failure has not been reproduced on the base branch, so it is not being classified as confirmed pre-existing. Left unresolved and outside the localization change; keep this PR draft pending CI investigation as well as its documented localization onboarding and disabled release definitions.

Eduardo Villalpando Mello (edvilme) pushed a commit to microsoft/vscode-python-ci that referenced this pull request Oct 30, 2026
…lation checkout support

## Shared pull-only release localization
This PR replaces the unused unmerged Azure English extraction/submission machinery with an opt-in pullLocalization interface on both public release wrappers. It invokes the same Python core as the public GitHub composite action in microsoft/vscode-common-python-lsp#125 rather than maintaining a second importer.

- Consumers declare translations (private drop dev) and localizationTools (reviewed immutable common-LSP SHA), with literal Github-Pylance endpoints.
- Source stays at workspace/s; tools and translations are sibling checkouts outside extension source.
- Run the shared importer after caller build/pre-built overlays and before final VSIX packaging.
- Keep the default self SDL scan, explicitly include executable tooling, and exclude translation data. Additional caller exclusions remain supported; sourceAnalysisPool preserves original caller pools.
- Derive canonical IDs and optional runtime metadata. Require all locales and per-table real-language translation evidence before copying; allow individual untranslated strings.
- No release-side English extraction, app write-token acquisition, Git pushes, or translation-update PRs. Existing signing/setup PowerShell is intentionally unchanged.
- Preserve opt-out callers, platform/version parameters, stable manual validation, and publication gates. Azure expansion can persist checkout credentials; no claim is made otherwise.

## Verification and rollout
Actual YAML-reading guards and shared Python/Git fixtures passed. Both release entry points for seven enabled repositories expanded successfully with publishing explicitly disabled. Both environments definitions are disabled; their exact YAML also expanded through the enabled isort definition without enabling or modifying those definitions. All expanded platform jobs preserve import order, source paths, SDL scanning, and publication gates. Shared core CI and the actual isort GitHub submission action passed.

Shared dependency: microsoft/vscode-common-python-lsp#125
Pilot: microsoft/vscode-isort#777
Sibling draft PRs:
- debugger: microsoft/vscode-python-debugger#1134
- environments: microsoft/vscode-python-environments#1971
- pylint: microsoft/vscode-pylint#915
- flake8: microsoft/vscode-flake8#609
- autopep8 (including runtime l10n): microsoft/vscode-autopep8#415
- mypy: microsoft/vscode-mypy#651
- black-formatter: microsoft/vscode-black-formatter#833

Keep this PR and callers draft pending dependencies, credential setup, and real handbacks. Current drop blocks isort (English-only), environments (missing canonical output), and flake8/mypy/black (missing runtime tables). Debugger, pylint, and autopep8 passed actual manifest/runtime imports from current drop. Autopep8 runtime ...
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
@bschnurr

Bill Schnurr (bschnurr) commented Nov 3, 2026 •

Copy link
Copy Markdown
Member Author

Fixed and pushed in 5e192fc and 385c9c6. Global interpreter routing now retains the selecting manager instead of inferring it from a fallback environment owner; regression coverage verifies that clearing an explicit selection follows the configured manager on subsequent refreshes. Added non-Linux E2E/integration failure diagnostics using the existing test-host hooks, without weakening assertions or adding automatic test retries. Validation: full local unit suite, 72 targeted manager tests including the new regression, TypeScript compilation, webpack, ESLint, actionlint, actual-YAML diagnostic checks and the existing Python-matrix guard. Real Windows discovery and controlled stdlib/UV venv removal probes passed. Final revision 385c9c6: all 53 jobs in the pull-request workflow passed (https://github.com/microsoft/vscode-python-environments/actions/runs/41703916165); the duplicate push workflow also passed (https://github.com/microsoft/vscode-python-environments/actions/runs/41703906838). Reran only jobs that failed before executing tests because of Marketplace HTTP 503 or VS Code download timeouts. The original Windows discovery/removal failures did not recur. The test-file policy check now passes. No failed checks remain; the separate external VS Code PR Check is still pending.

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
@bschnurr
Bill Schnurr (bschnurr) marked this pull request as ready for review November 4, 2026 17:48
@rchiodo

Rich Chiodo (rchiodo) commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🔒 Automated review in progress — Rich Chiodo (@rchiodo) is auto-reviewing this PR.

@rchiodo

Copy link
Copy Markdown
Contributor

Result: ⚠️ partially-verified

Verification details

Verification: Automated verification is best effort. The PR author remains responsible for testing.

Summary: Test compilation and all 30 targeted environment-manager tests passed, including the PR’s new regression test. Offline dependency preparation succeeded; local YAML contract checks and generated-localization file selection through VSCE also passed. Initial discovery encountered missing dependencies and absent container Git metadata, not a demonstrated PR defect. Shared localization execution, real handback readiness, Azure template expansion, and non-Linux diagnostic collection remain unverified. **Reviewer dependency follow-up (nonblocking):** Suggest a separate PR adding `mocha ^10.8.2`, `typescript ^5.1.3` to the official reviewer dependency declarations, using `package.json` as the dependency/version evidence. Do not automatically create that PR. This is reviewer environment maintenance, not a required change to the reviewed PR.

Test runs: 5 passed, 1 failed, 2 not run

  • ⚠️ Not run | Shared localization submission, release import and readiness validation
  • ⚠️ Not run | Non-Linux E2E and integration failure diagnostics
  • ❌ Failed | unrelated to this PR | Dependency and test discovery | git status --short; git log -3 --oneline; printf '\nEnvironment\n'; printenv AUTOMATION_SANDBOX_PROFILE; uname -s; node --version; npm --version; printf '\nDependency and test discovery\n'; node -e "const fs=require('fs'); const p=require('./package.json'); console.log(JSON.stringify({scripts:p.scripts,devDependencies:p.devDependencies,dependencies:p.dependencies},null,2)); for(const f of ['node_modules','node_modules/mocha/bin/mocha.js','node_modules/typescript/bin/tsc','out/test/features/envManagers.unit.test.js']) console.log(f,fs.existsSync(f));"; git diff --stat HEAD~1 HEAD; git ls-files 'localization' 'unit.test' 'test.py'
  • ✅ Passed | Compile TypeScript tests | npm run compile-tests
  • ✅ Passed | Environment manager unit tests | node ./node_modules/mocha/bin/mocha.js --no-config --require source-map-support/register --require ./out/test/unittests.js --ui tdd --timeout 180000 out/test/features/envManagers.unit.test.js
  • ✅ Passed | Offline dependency preparation | npm ci --offline
  • ✅ Passed | Local localization and diagnostics YAML contracts | node <<'JS'
    const assert = require('node:assert/strict');
    const fs = require('node:fs');
    const yaml = require('js-yaml');
    const read = p => yaml.load(fs.readFileSync(p, 'utf8'));
    const workflow = read('.github/workflows/localization.yml');
    assert.deepEqual(workflow.permissions, {contents:'read'});
    assert.deepEqual(workflow.on.push.branches, ['main']);
    assert.equal(workflow.concurrency['cancel-in-progress'], false);
    assert.equal(workflow.jobs.localization.if, "github.repository == 'microsoft/vscode-python-environments'");
    const action = workflow.jobs.localization.steps[0];
    const pin = 'd1877b84bb10ff7caa6bd12ab4e75498ba760790';
    assert.equal(action.uses, microsoft/vscode-common-python-lsp/.github/actions/localization@${pin});
    assert.equal(action.with['app-id'], '${{ vars.PYTHON_LOCALIZATION_APP_ID }}');
    assert.equal(action.with['private-key'], '${{ secrets.PYTHON_LOCALIZATION_PRIVATE_KEY }}');
    for (const quality of ['stable', 'pre-release']) {
    const pipeline = read(build/azure-devdiv-pipeline.${quality}.yml);
    const repos = Object.fromEntries(pipeline.resources.repositories.map(r => [r.repository, r]));
    assert.equal(repos.translations.name, 'microsoft/vscode-python-extensions-loc');
    assert.equal(repos.translations.ref, 'refs/heads/dev');
    assert.equal(repos.translations.endpoint, 'Github-Pylance');
    assert.equal(repos.localizationTools.name, 'microsoft/vscode-common-python-lsp');
    assert.equal(repos.localizationTools.ref, pin);
    assert.equal(repos.localizationTools.endpoint, 'Github-Pylance');
    assert.equal(pipeline.extends.template, azure-pipelines/extension/${quality}.yml@templates);
    assert.equal(pipeline.extends.parameters.pullLocalization, true);
    assert.equal(pipeline.extends.parameters.standardizedVersioning, true);
    assert.equal(pipeline.parameters.find(p => p.name === 'publishExtension').default, true);
    assert.deepEqual(pipeline.parameters.find(p => p.name === 'buildPlatforms').default.map(p => p.vsceTarget), ['web','linux-arm64','linux-armhf','linux-x64','alpine-arm64','alpine-x64','darwin-arm64','darwin-x64','win32-arm64','win32-x64']);
    assert.deepEqual(pipeline.parameters.find(p => p.name === 'buildSteps').default.map(s => s.script), ['npm ci','python ./build/update_package_json.py', quality === 'stable' ? 'python ./build/update_ext_version.py --release --for-publishing' : 'python ./build/update_ext_version.py --for-publishing','npm run package']);
    if (quality === 'stable') {
    assert.equal(pipeline.extends.parameters.validationNotifyUsers, 'plseng@microsoft.com');
    assert.deepEqual(pipeline.trigger.branches.include, ['release/*']);
    } else {
    assert.equal(pipeline.trigger, 'none');
    assert.equal(pipeline.schedules[0].cron, '0 10 * * 1-5');
    }
    console.log(PASS ${quality}: pinned pull-only caller wiring, version flags, build steps, publication default and 10 targets);
    }
    const pr = read('.github/workflows/pr-check.yml');
    for (const [job, id] of [['e2e-tests','e2e-non-linux'], ['integration-tests','integration-non-linux']]) {
    const steps = pr.jobs[job].steps;
    const run = steps.find(s => s.id === id);
    assert.equal(run.if, "runner.os != 'Linux'");
    assert.equal(run.env.VSCODE_TEST_DIAGNOSTICS_DIR, '${{ runner.temp }}/vscode-test-diagnostics');
    const upload = steps.find(s => s.if === '${{ failure() && steps.' + id + ".outcome == 'failure' }}");
    assert.ok(upload);
    assert.equal(upload.with.path, run.env.VSCODE_TEST_DIAGNOSTICS_DIR);
    assert.equal(upload.with['retention-days'], 7);
    assert.equal(upload.with['if-no-files-found'], 'error');
    console.log(PASS ${job}: non-Linux diagnostic capture and failure-only upload wiring);
    }
    console.log('PASS English submission workflow pin and read-only caller token');
    console.log('LIMITATION: parsed local YAML only; external actions/templates and live services were not executed.');
    JS
  • ✅ Passed | VSCE generated localization file selection | node <<'JS'
    const fs = require('node:fs');
    const assert = require('node:assert/strict');
    const {execFileSync} = require('node:child_process');
    const manifest = 'package.nls.de.json';
    const runtime = 'l10n/bundle.l10n.de.json';
    assert.ok(!fs.existsSync(manifest) && !fs.existsSync(runtime), 'fixture paths must not overwrite existing translations');
    const hadDir = fs.existsSync('l10n');
    try {
    fs.mkdirSync('l10n', {recursive:true});
    fs.writeFileSync(manifest, JSON.stringify({description:'Deutsche Testübersetzung'}));
    fs.writeFileSync(runtime, JSON.stringify({'Test string':'Testzeichenfolge'}));
    const files = execFileSync(process.execPath, ['./node_modules/@vscode/vsce/vsce', 'ls', '--no-dependencies'], {encoding:'utf8'}).split(/\r?\n/);
    assert.ok(files.includes(manifest), 'generated manifest must be selected by VSCE');
    assert.ok(files.includes(runtime), 'generated runtime table must be selected by VSCE');
    assert.ok(files.includes('package.nls.json'), 'English manifest must remain selected');
    console.log('PASS VSCE selects package.nls.json, generated package.nls.de.json and l10n/bundle.l10n.de.json despite localization ignore patterns');
    console.log('LIMITATION: fixture file selection only; no translated drop import or VSIX publication performed.');
    } finally {
    fs.rmSync(manifest, {force:true});
    fs.rmSync(runtime, {force:true});
    if (!hadDir) fs.rmdirSync('l10n');
    }
    JS
⚠️ Shared localization submission, release import and readiness validation diagnostic output
Only caller YAML was checked locally. The referenced shared action and Azure templates were not executed or expanded, and no real 14-locale handback was imported. External resources and services are unavailable in the network-isolated verification container.
⚠️ Non-Linux E2E and integration failure diagnostics diagnostic output
Discovery reported Linux. Both changed diagnostic-enabled test steps require runner.os != 'Linux'; Windows/macOS collection and artifact upload were not exercised. Their YAML wiring passed a separate static check.
❌ Dependency and test discovery diagnostic output
AUTOMATION_SANDBOX_PROFILE=typescript
Linux
Node v22.21.1; npm 10.9.4
package.json declares mocha ^10.8.2 and typescript ^5.1.3.
node_modules false
node_modules/mocha/bin/mocha.js false
node_modules/typescript/bin/tsc false
out/test/features/envManagers.unit.test.js false
fatal: not a git repository (or any parent up to mount point /)
[container exit=128]
Dependency gap subsequently resolved with npm ci --offline; compilation and targeted tests then passed. Git metadata remained unavailable.

@rchiodo Rich Chiodo (rchiodo) 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.

Approved via Review Center.

@rchiodo Rich Chiodo (rchiodo) added the review-auto:approved Automated review: no blocking findings (approval posted). label Nov 4, 2026

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.

Approved via Review Center.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bschnurr

Copy link
Copy Markdown
Member Author

Investigated the failing Windows/Python 3.15 E2E job:

  • Can trigger environment refresh fails with RpcTimeoutError: Request 'refresh' timed out after 30000ms.
  • Discovers at least one environment then exceeds its 90000ms test timeout.
  • Uploaded Python Environments diagnostics show PET server refreshes repeatedly hitting their 30-second limit and restarting. The JSON CLI fallback eventually succeeds after approximately 48 seconds; logs show slow Conda discovery under C:\Miniconda, including missing package metadata and fallback probing.
  • The remaining 11 E2E matrix jobs passed, including Windows/Python 3.10, 3.12, and 3.14.
  • Both src/managers/common/nativePythonFinder.ts and src/test/e2e/environmentDiscovery.e2e.test.ts match current main. This failure is in runtime discovery, not localization extraction/import. A baseline run on the same runner image has not been performed, so this is not being labeled conclusively pre-existing or a harmless flake.

No tests were skipped, timeouts increased, or production discovery behavior changed. The underlying reason for slow Conda discovery still needs investigation; this is separate from the PR's current merge conflicts.

@bschnurr

Copy link
Copy Markdown
Member Author

The isolated Windows/Python 3.15 E2E rerun passed: https://github.com/microsoft/vscode-python-environments/actions/runs/41893763980/job/126925681445 . Run attempt 2 completed successfully with no code changes, skipped tests, or timeout increases. The original PET/Conda discovery timeout did not reproduce on this attempt; this supports an intermittent failure but does not establish that the underlying slowdown is fixed. Merge conflicts/approval remain separate requirements.

@bschnurr
Bill Schnurr (bschnurr) enabled auto-merge (squash) November 5, 2026 00:12
@rchiodo

Rich Chiodo (rchiodo) commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Reviewed commit: b936289ca59943e80d50eda013e18fa4c633af2b

Result: ⚠️ partially-verified

Verification details

Verification: Automated verification is best effort. The PR author remains responsible for testing.

Summary: In the Linux container, compilation succeeded and all 30 environment-manager tests—including the added regression—and 3 diagnostics tests passed. Additional probes passed for cross-owner fallback routing, localization/release configuration, and VSCE selection of generated locale files. Missing Node dependencies were restored successfully using `npm ci --offline`; no executed test failed. External localization submission/import, readiness validation, Azure template expansion, and non-Linux diagnostic uploads remain unverified. **Reviewer dependency follow-up (nonblocking):** Suggest a separate PR adding `@vscode/vsce ^3.9.2`, `mocha ^10.8.2`, `sinon ^19.0.2`, `typescript ^5.1.3` to the official reviewer dependency declarations, using `package.json` as the dependency/version evidence. Do not automatically create that PR. This is reviewer environment maintenance, not a required change to the reviewed PR.

Test runs: 5 passed, 1 skipped, 2 not run

  • ⚠️ Not run | External localization and Azure release execution
  • ⏩ Skipped | Non-Linux E2E and integration failure-artifact uploads
  • ⚠️ Not run | Dependency and test discovery | printf 'PROFILE=%s\n' "$AUTOMATION_SANDBOX_PROFILE"; uname -s; node --version; npm --version; python --version; git log -4 --oneline; git status --short; git branch -a; node - <<'JS'
    const fs = require('fs');
    const p = require('./package.json');
    console.log('scripts:', JSON.stringify(p.scripts));
    for (const name of ['typescript','mocha','sinon','@vscode/vsce']) {
    try { console.log(name, require.resolve(name)); } catch (e) { console.log('MISSING', name, (p.devDependencies || {})[name]); }
    }
    console.log('node_modules:', fs.existsSync('node_modules'));
    console.log('compiled envManagers tests:', fs.existsSync('out/test/features/envManagers.unit.test.js'));
    JS
  • ✅ Passed | Environment-manager unit tests and test compilation | npm run compile-tests && node ./node_modules/mocha/bin/mocha.js --no-config --require source-map-support/register --require ./out/test/unittests.js --ui tdd --timeout 180000 out/test/features/envManagers.unit.test.js
  • ✅ Passed | Test-runner diagnostics unit tests | node ./node_modules/mocha/bin/mocha.js --no-config --require source-map-support/register --require ./out/test/unittests.js --ui tdd --timeout 180000 out/test/diagnostics.unit.test.js
  • ✅ Passed | Offline dependency bootstrap | npm ci --offline
  • ✅ Passed | Localization caller configuration and generated VSCE file selection | node - <<'JS'
    const assert = require('node:assert/strict');
    const fs = require('node:fs');
    const { spawnSync } = require('node:child_process');
    const yaml = require('js-yaml');
    const load = p => yaml.load(fs.readFileSync(p, 'utf8'));
    const workflow = load('.github/workflows/localization.yml');
    const action = workflow.jobs.localization.steps[0];
    const pin = action.uses.split('@')[1];
    assert.match(pin, /^[a-f0-9]{40}$/);
    assert.deepEqual(workflow.permissions, { contents: 'read' });
    assert.equal(workflow.concurrency['cancel-in-progress'], false);
    assert.deepEqual(workflow.on.push.branches, ['main']);
    assert.deepEqual(workflow.on.push.paths, ['package.json', 'package.nls.json', 'src/**/*.ts', '.nvmrc', '.github/workflows/localization.yml']);
    assert.equal(workflow.jobs.localization.if, "github.repository == 'microsoft/vscode-python-environments'");
    assert.equal(action.with['node-version'], '22.21.1');
    for (const quality of ['stable', 'pre-release']) {
    const release = load(build/azure-devdiv-pipeline.${quality}.yml);
    const resources = Object.fromEntries(release.resources.repositories.map(r => [r.repository, r]));
    assert.equal(resources.localizationTools.ref, pin);
    assert.equal(resources.translations.name, 'microsoft/vscode-python-extensions-loc');
    assert.equal(resources.translations.ref, 'refs/heads/dev');
    for (const name of ['translations', 'localizationTools']) assert.equal(resources[name].endpoint, 'Github-Pylance');
    assert.equal(release.extends.template, azure-pipelines/extension/${quality}.yml@templates);
    const p = release.extends.parameters;
    assert.equal(p.pullLocalization, true);
    for (const flag of ['standardizedVersioning', 'ghCreateTag', 'ghCreateRelease', 'ghReleaseAddChangeLog']) assert.equal(p[flag], true);
    assert.equal(release.parameters.find(p => p.name === 'publishExtension').default, true);
    assert.equal(release.parameters.find(p => p.name === 'buildPlatforms').default.length, 10);
    const scripts = release.parameters.find(p => p.name === 'buildSteps').default.map(s => s.script);
    assert.deepEqual(scripts, ['npm ci', 'python ./build/update_package_json.py', python ./build/update_ext_version.py ${quality === &#x27;stable&#x27; ? &#x27;--release &#x27; : &#x27;&#x27;}--for-publishing, 'npm run package']);
    if (quality === 'stable') assert.equal(p.validationNotifyUsers, 'plseng@microsoft.com');
    console.log(PASS ${quality}: pull-only caller, matching pin, release defaults and build steps);
    }
    const pr = load('.github/workflows/pr-check.yml');
    for (const [job, id] of [['e2e-tests', 'e2e-non-linux'], ['integration-tests', 'integration-non-linux']]) {
    const steps = pr.jobs[job].steps;
    const run = steps.find(s => s.id === id);
    assert.equal(run.if, "runner.os != 'Linux'");
    assert.equal(run.env.VSCODE_TEST_DIAGNOSTICS_DIR, '${{ runner.temp }}/vscode-test-diagnostics');
    const upload = steps.find(s => s.if === \${{ failure() &amp;&amp; steps.${id}.outcome == &#x27;failure&#x27; }});
    assert.ok(upload);
    assert.equal(upload.with.path, run.env.VSCODE_TEST_DIAGNOSTICS_DIR);
    assert.equal(upload.with['retention-days'], 7);
    assert.equal(upload.with['if-no-files-found'], 'error');
    }
    assert.equal(require('./package.json').publisher + '.' + require('./package.json').name, 'ms-python.vscode-python-envs');
    const files = ['package.nls.de.json', 'l10n/bundle.l10n.de.json'];
    assert.ok(files.every(p => !fs.existsSync(p)), 'probe must not overwrite locale files');
    const hadL10n = fs.existsSync('l10n');
    try {
    fs.mkdirSync('l10n', { recursive: true });
    for (const p of files) fs.writeFileSync(p, '{"probe":"Pruefung"}\n');
    const result = spawnSync(process.execPath, ['node_modules/@vscode/vsce/vsce', 'ls', '--no-dependencies'], { encoding: 'utf8', timeout: 30000 });
    assert.equal(result.status, 0, result.stderr);
    for (const p of files) assert.ok(result.stdout.split(/\r?\n/).includes(p), VSCE omitted ${p});
    console.log('PASS VSCE includes generated manifest and runtime locale files');
    } finally {
    for (const p of files) fs.rmSync(p, { force: true });
    if (!hadL10n) fs.rmdirSync('l10n');
    }
    console.log('PASS GitHub submission and non-Linux diagnostic upload configuration');
    JS
  • ✅ Passed | Selected-manager fallback, unavailability, and recovery matrix | node - <<'JS'
    require('./out/test/unittests.js');
    const assert = require('node:assert/strict');
    const sinon = require('sinon');
    const { Uri } = require('vscode');
    const frame = require('./out/common/utils/frameUtils');
    const workspace = require('./out/common/workspace.apis');
    const { PythonEnvironmentManagers } = require('./out/features/envManagers');
    const sandbox = sinon.createSandbox();
    let managers;
    (async () => {
    const system = 'ms-python.python:system';
    const venv = 'ms-python.python:venv';
    sandbox.stub(frame, 'getCallingExtension').returns('ms-python.python');
    sandbox.stub(workspace, 'getConfiguration').returns({ get: (key, fallback) => key === 'defaultEnvManager' ? venv : key === 'pythonProjects' ? [] : fallback, has: () => false, inspect: () => undefined, update: async () => {} });
    managers = new PythonEnvironmentManagers({ getProjects: () => [], get: () => undefined });
    const makeEnv = (id, managerId) => ({ envId: { id, managerId }, name: id, displayName: id, version: '3.13.0', displayPath: '/tmp/' + id, environmentPath: Uri.file('/tmp/' + id), sysPrefix: '/tmp', execInfo: { run: { executable: '/tmp/' + id } } });
    const selected = makeEnv('selected', system);
    const fallback = makeEnv('fallback', venv);
    const systemGet = sandbox.stub().resolves(selected);
    const venvGet = sandbox.stub().resolves(makeEnv('configured', venv));
    for (const [name, get] of [['system', systemGet], ['venv', venvGet]]) {
    managers.registerEnvironmentManager({ name, displayName: name, preferredPackageManagerId: 'ms-python.python:pip', get, set: async () => {}, resolve: async () => undefined, refresh: async () => {}, getEnvironments: async () => [], onDidChangeEnvironments: () => ({ dispose() {} }), onDidChangeEnvironment: () => ({ dispose() {} }) }, { extensionId: 'ms-python.python' });
    }
    const flush = () => new Promise(resolve => setImmediate(resolve));
    await managers.setEnvironments('global', selected, false, { explicit: true });
    await flush();
    const events = [];
    managers.onDidChangeActiveEnvironment(e => events.push([e.old?.envId.id, e.new?.envId.id]));
    let previous = selected;
    for (const next of [fallback, undefined, selected]) {
    systemGet.resolves(next);
    await managers.refreshEnvironment(undefined);
    await flush();
    assert.equal(managers.getEnvironmentManager(undefined).id, system);
    assert.equal((await managers.getEnvironment(undefined))?.envId.id, next?.envId.id);
    assert.equal(managers.getLastKnownEnvironment(undefined)?.envId.id, next?.envId.id);
    assert.deepEqual(events.at(-1), [previous?.envId.id, next?.envId.id]);
    previous = next;
    console.log('PASS selected-manager routing, readback, cache and event for', next?.envId.id ?? 'undefined');
    }
    assert.equal(events.length, 3);
    assert.equal(venvGet.callCount, 0);
    console.log('PASS full fallback/unavailable/recovery matrix; configured manager never queried');
    })().catch(error => { console.error(error); process.exitCode = 1; }).finally(() => { managers?.dispose(); sandbox.restore(); });
    JS
⚠️ External localization and Azure release execution diagnostic output
The shared localization action/tooling and Azure templates are external repository resources, not executable test inputs in this workspace. Credential-free offline verification could not submit English, retrieve real handbacks, exercise readiness rejection, or expand Azure templates. Author-reported remote validation was not independently reproduced.
⏩ Non-Linux E2E and integration failure-artifact uploads diagnostic output
Actual environment: Linux (`uname -s`). Changed launch steps require `runner.os != 'Linux'`; Windows/macOS GitHub artifact uploads were not exercised. Their YAML wiring and the underlying diagnostics helper were checked separately.
⚠️ Dependency and test discovery diagnostic output
[container exit=0]
PROFILE=typescript
Linux
v22.21.1
10.9.4
Python 3.13.18
Git metadata was unavailable in the container.
MISSING typescript ^5.1.3
MISSING mocha ^10.8.2
MISSING sinon ^19.0.2
MISSING @vscode/vsce ^3.9.2
node_modules: false
compiled envManagers tests: false
Selected runner: Node v22.21.1. Requirements are declared in package.json devDependencies. Initial test execution was blocked by absent dependencies; subsequent `npm ci --offline` succeeded, adding 612 packages.

Combine selection-manager tracking with main explicit-selection guard so clearing a global selection restores configured-manager routing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bschnurr

Copy link
Copy Markdown
Member Author

Resolved the merge conflict with main in 2141da2. Global routing now preserves the selecting manager for an explicit global selection, while main's explicit-selection guard ensures clearing that selection restores configured-manager routing.

Validation: TypeScript compilation, lint, executable localization YAML guards, and 76 focused routing/global-selection tests passed. A broader unit run reported 3514 passing, 5 pending, and 2 startup-fixture failures. Both failures also reproduce on unmodified origin/main (ebb7d76) in a separate baseline worktree, so no unrelated fixture or runtime changes were made. Temporary baseline worktree removed. CI will run on the updated PR commit.

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>
@bschnurr

Copy link
Copy Markdown
Member Author

Dependency: microsoft/vscode-common-python-lsp#127

Pin the localization action and both release import resources to 6b4a3573e7e7a9fe1e468e129544432278aec2d6. This allows untranslated strings, including wholly untranslated tables, to retain English rather than fail packaging. Missing/empty/malformed/incomplete locale tables remain errors. Update the documented policy; preserve dev translation branch, Pylance-Eng main, publication defaults, and all build/release settings.

Validation: actual-YAML caller guards, formatting, and Azure preview expansion passed. Shared tests/lint passed; real isort dev import produces all 28 locale files with English fallback. Environments' native pipelines remain disabled; exact YAML expansion was verified through an enabled definition. No release builds queued or publication performed. Merge the shared dependency before this consumer pin update.

this._explicitSelections.set(key, { managerId: manager.id, userSelected });
if (key === 'global') {
this._globalSelectionManagerId = manager.id;
}

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.

Info · Optional note

📍 src\features\envManagers.ts:1133
The explicit-selection record already stores managerId, so _globalSelectionManagerId introduces a second representation of the same routing identity that must remain synchronized. Read the global explicit-selection record once in the routing branch and use its managerId, removing the additional field and assignments.

[verified]

Comment thread README.md

Keep English `package.nls.json` tracked. Root `package.nls.<locale>.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. 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.

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 · Non-blocking recommendation

📍 README.md:396
This paragraph permits wholly untranslated tables, while the PR’s readiness contract explicitly requires rejecting them. Reconcile the README and PR acceptance contract with the pinned importer’s intended policy; the established finding is a documentation mismatch, not a verified importer defect.

[verified]

@rchiodo

Copy link
Copy Markdown
Contributor

Warning · Non-blocking recommendation

Please add focused test coverage for global refresh preserves the selecting manager when its fallback belongs to another manager.

Add persistent coverage for the new routing branch: select a global environment, have that manager return another manager's descriptor during refresh, and assert subsequent routing/readback stays with the selecting manager; the temporary verification probe passed this scenario.

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

Labels

debt Code quality issues review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants