Skip to content

Allow English fallback during localization release imports - #613

Open
Bill Schnurr (bschnurr) wants to merge 1 commit into
mainfrom
users/bschnurr/allow-untranslated-localization
Open

Bill Schnurr (bschnurr) wants to merge 1 commit into
mainfrom
users/bschnurr/allow-untranslated-localization

Conversation

@bschnurr

Copy link
Copy Markdown
Member

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.

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

Rich Chiodo (rchiodo) commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

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

@rchiodo

Copy link
Copy Markdown
Contributor

Reviewed commit: a61917efc2fc5f6c7f656bcba07bfb7f484dbe87

Result: ⚠️ partially-verified

Verification details

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

Summary: Targeted formatting passed, and an actual-YAML probe confirmed all three pins and preserved workflow, build, and publication settings. The PR adds no tests; no consumer localization tests were found. Discovery encountered missing Git metadata and Node dependencies, but offline dependency preparation succeeded. Shared fallback imports and Azure template expansion were not executed, so verification is partial. **Reviewer dependency follow-up (nonblocking):** Suggest a separate PR adding `prettier ^3.8.1` 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: 3 passed, 1 failed, 1 not run

  • ⚠️ Not run | Shared fallback import and Azure template expansion
  • ❌ Failed | unrelated to this PR | Dependency and test discovery | printf 'Sandbox profile: %s\n' "$AUTOMATION_SANDBOX_PROFILE"; git log -3 --oneline; git diff HEAD~1 HEAD --stat; git submodule status; python --version; node --version; npm --version; python -c "import importlib.util, sys; print('Interpreter:', sys.executable); print('PyYAML available:', importlib.util.find_spec('yaml') is not None); print('pytest available:', importlib.util.find_spec('pytest') is not None)"; test -d node_modules && echo 'root node_modules present' || echo 'root node_modules absent'; test -f external/vscode-common-python-lsp/typescript/package.json && echo 'shared package restored' || echo 'shared package absent'; git ls-files 'test' 'localization'
  • ✅ Passed | Changed YAML formatting | node ./node_modules/prettier/bin/prettier.cjs --check .github/workflows/localization.yml build/azure-devdiv-pipeline.pre-release.yml build/azure-devdiv-pipeline.stable.yml
  • ✅ Passed | Offline Node dependency preparation | npm ci --offline --ignore-scripts
  • ✅ Passed | Actual-YAML caller and documented-policy guards | python - <<'PY'
    import json
    from pathlib import Path
    import yaml

PIN = '6b4a3573e7e7a9fe1e468e129544432278aec2d6'
def load(path):
return yaml.load(Path(path).read_text(), Loader=yaml.BaseLoader)

workflow = load('.github/workflows/localization.yml')
assert workflow['name'] == 'Localization'
assert workflow['on'] == {'workflow_dispatch': '', 'push': {'branches': ['main'], 'paths': ['package.json', 'package.nls.json', 'src/**/*.ts', 'external/vscode-common-python-lsp', '.gitmodules', '.nvmrc', '.github/workflows/localization.yml']}}
assert workflow['permissions'] == {'contents': 'read'}
assert workflow['concurrency'] == {'group': 'localization-${{ github.ref }}', 'cancel-in-progress': 'false'}
job = workflow['jobs']['localization']
assert job['if'] == "github.repository == 'microsoft/vscode-flake8'"
assert job['runs-on'] == 'ubuntu-latest' and job['timeout-minutes'] == '20'
assert job['steps'] == [{'uses': 'microsoft/vscode-common-python-lsp/.github/actions/localization@' + PIN, 'with': {'app-id': '${{ vars.PYTHON_LOCALIZATION_APP_ID }}', 'private-key': '${{ secrets.PYTHON_LOCALIZATION_PRIVATE_KEY }}', 'submodules': 'recursive', 'source-paths': '["src", "external/vscode-common-python-lsp/typescript/src"]', 'node-version': '24.17.0'}}]
assert json.loads(job['steps'][0]['with']['source-paths']) == ['src', 'external/vscode-common-python-lsp/typescript/src']
print('PASS: actual GitHub YAML pin, triggers, security, concurrency and action inputs')

for channel in ['stable', 'pre-release']:
path = f'build/azure-devdiv-pipeline.{channel}.yml'
pipeline = load(path)
assert pipeline['resources']['repositories'] == [
{'repository': 'templates', 'type': 'git', 'name': 'DevDiv/Pylance-Eng', 'ref': 'refs/heads/main'},
{'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': PIN, 'endpoint': 'Github-Pylance'}]
assert pipeline['pr'] == 'none'
if channel == 'stable':
assert pipeline['name'] == 'Publish Release'
assert pipeline['trigger'] == {'branches': {'include': ['release/*']}}
else:
assert pipeline['trigger'] == 'none'
assert pipeline['schedules'] == [{'cron': '0 10 * * 1-5', 'displayName': 'Nightly Pre-Release Schedule', 'always': 'false', 'branches': {'include': ['main']}}]
assert pipeline['variables'] == [{'name': 'TeamName', 'value': 'VSCode-flake8'}, {'name': 'VsixName', 'value': 'flake8.vsix'}, {'name': 'AZURE_ARTIFACTS_FEED', 'value': 'https://devdiv.pkgs.visualstudio.com/DevDiv/_packaging/Pylance_PublicPackages/npm/registry/'}]
publish, build = pipeline['parameters']
assert publish == {'name': 'publishExtension', 'displayName': '\U0001f680 Publish Extension', 'type': 'boolean', 'default': 'true'}
version = 'python ./build/update_ext_version.py ' + ('--release ' if channel == 'stable' else '') + '--for-publishing'
assert build == {'name': 'buildSteps', 'type': 'stepList', 'default': [
{'script': 'git submodule update --init --recursive', 'displayName': 'Checkout submodules'},
{'script': 'npm ci', 'displayName': 'Install NPM dependencies'},
{'script': 'python -m pip install -U pip', 'displayName': 'Upgrade pip'},
{'script': 'python -m pip install wheel', 'displayName': 'Install wheel'},
{'script': 'python -m pip install nox', 'displayName': 'Install nox'},
{'script': 'python -m nox --session install_bundled_libs', 'displayName': 'Install Python dependencies'},
{'script': version, 'displayName': 'Update build number'},
{'script': 'npm run package', 'displayName': 'Build extension'}]}
expected = {'buildSteps': '${{ parameters.buildSteps }}', 'standardizedVersioning': 'true', 'customNPMRegistry': '$(AZURE_ARTIFACTS_FEED)', 'publishExtension': '${{ parameters.publishExtension }}', 'teamName': '$(TeamName)', 'ghCreateTag': 'true', 'ghCreateRelease': 'true', 'ghReleaseAddChangeLog': 'true', 'sourceAnalysisPool': 'VSEng-MicroBuildVSStable', 'pullLocalization': 'true'}
if channel == 'stable':
expected['validationNotifyUsers'] = 'plseng@microsoft.com'
assert pipeline['extends'] == {'template': f'azure-pipelines/extension/{channel}.yml@templates', 'parameters': expected}
print(f'PASS: actual {channel} Azure YAML pin, resource branches, publication default, build steps and release settings')

readme = Path('README.md').read_text()
assert 'Nonempty manifest and runtime tables must be present for all 14 supported locales.' in readme
assert 'Untranslated strings, including wholly untranslated tables, are allowed; users see English until translations arrive.' in readme
assert 'Missing, empty, malformed, or incomplete handbacks still fail before packaging, without falling back to stale translations.' in readme
assert 'every required real-language table must contain translation evidence' not in readme
print('PASS: documented English fallback and retained invalid-handback policy')
PY

⚠️ Shared fallback import and Azure template expansion diagnostic output
Not attempted: these checks require external resources and service execution unavailable in this offline container. Local YAML assertions do not establish that the pinned action executes successfully or that release imports produce English fallback. No release builds or publication were performed.
❌ Dependency and test discovery diagnostic output
[container exit=128]
Sandbox profile: typescript
fatal: not a git repository (or any parent up to mount point /)
Python 3.13.18
v24.17.0
11.13.0
Interpreter: /opt/automation-venv/bin/python
PyYAML available: True
pytest available: True
root node_modules absent
shared package restored
Git-based discovery failed because the container lacks Git metadata. Read-only repository tools supplied baseline and test discovery instead. Formatting requires package.json devDependency prettier ^3.8.1; offline npm ci --offline --ignore-scripts subsequently succeeded.

@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 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants