Skip to content

Allow English fallback during localization release imports - #657

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: 89e1215d26a3f10cd0b409fab406d53d5599e3d1

Result: ⚠️ partially-verified

Verification details

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

Summary: In the Linux container, targeted formatting and actual-YAML caller guards passed. All three references use the requested SHA, with workflow inputs, translation branches, publication defaults, and build/release settings preserved. The PR adds no tests. English-fallback execution and Azure template expansion were not verified because the referenced action and remote resources were unavailable locally, so confidence is limited to the consumer configuration. **Reviewer dependency follow-up (nonblocking):** Suggest a separate PR adding `prettier ^3.2.4` 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, 2 not run

  • ⚠️ Not run | Release localization import and Azure template expansion
  • ⚠️ Not run | Dependency and test discovery | printf 'Sandbox profile: %s\n' "$AUTOMATION_SANDBOX_PROFILE"; uname -s; python --version; node --version; npm --version; git log -3 --oneline; git diff HEAD^ HEAD --stat; git ls-tree HEAD external/vscode-common-python-lsp; printf '\nLocalization/test discovery\n'; git grep -n -E 'localization|translation|l10n' -- build src/test .github/workflows package.json; printf '\nAvailable dependencies\n'; python -c "import importlib.util, sys; print('interpreter:', sys.executable); print({name: importlib.util.find_spec(name) is not None for name in ['pytest', 'yaml']})"; for p in node_modules/prettier/bin/prettier.cjs node_modules/yaml external/vscode-common-python-lsp/.github/actions/localization/action.yml external/vscode-common-python-lsp/typescript/package.json; do if test -e "$p"; then printf 'present: %s\n' "$p"; else printf 'absent: %s\n' "$p"; fi; done
  • ✅ 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 formatting dependency preparation | npm ci --offline --ignore-scripts
  • ✅ Passed | Actual-YAML localization caller contracts | python - <<'PY'
    from pathlib import Path
    import yaml

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

workflow_path = '.github/workflows/localization.yml'
expected_workflow = {
'name': 'Localization',
'on': {'workflow_dispatch': '', 'push': {
'branches': ['main'],
'paths': ['package.json', 'package.nls.json', 'src/**/*.ts',
'external/vscode-common-python-lsp', '.gitmodules', '.nvmrc', workflow_path]}},
'permissions': {'contents': 'read'},
'concurrency': {'group': 'localization-${{ github.ref }}', 'cancel-in-progress': 'false'},
'jobs': {'localization': {
'if': "github.repository == 'microsoft/vscode-mypy'",
'runs-on': 'ubuntu-latest', 'timeout-minutes': '20',
'steps': [{'uses': f'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 load(workflow_path) == expected_workflow, 'Workflow differs from baseline plus requested pin'
assert OLD_PIN not in Path(workflow_path).read_text()
print('PASS: actual GitHub YAML uses exact pin; triggers, permissions, concurrency and all inputs preserved')

for release in ('pre-release', 'stable'):
path = f'build/azure-devdiv-pipeline.{release}.yml'
steps = [
{'script': 'git submodule update --init --recursive', 'displayName': 'Checkout submodules'},
{'script': 'npm run ci:msft', 'displayName': 'Install NPM dependencies'},
]
for script, display in [
('python -m pip install -U pip', 'Upgrade pip'),
('python -m pip install wheel', 'Install wheel'),
('python -m pip install nox', 'Install nox'),
('python -m nox --session install_bundled_libs', 'Install Python dependencies'),
]:
steps.append({'script': script, 'displayName': display,
'env': {'PIP_INDEX_URL': '$(PIP_PROXY_INDEX_URL)'}})
version_command = 'python ./build/update_ext_version.py ' + ('--release ' if release == 'stable' else '') + '--for-publishing'
steps.extend([{'script': version_command, 'displayName': 'Update build number'},
{'script': 'npm run package', 'displayName': 'Build extension'}])
extension_parameters = {
'buildSteps': '${{ parameters.buildSteps }}', 'standardizedVersioning': 'true',
'customNPMRegistry': '$(NPM_CONFIG_REGISTRY)',
'publishExtension': '${{ parameters.publishExtension }}', 'teamName': '$(TeamName)',
'ghCreateTag': 'true', 'ghCreateRelease': 'true', 'ghReleaseAddChangeLog': 'true',
'sourceAnalysisPool': 'VSEng-MicroBuildVSStable', 'pullLocalization': 'true',
}
if release == 'stable':
extension_parameters['validationNotifyUsers'] = 'plseng@microsoft.com'
expected = {
'trigger': {'branches': {'include': ['release/*']}} if release == 'stable' else 'none',
'pr': 'none',
'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'},
]},
'variables': [{'name': name, 'value': value} for name, value in [
('TeamName', 'VSCode-mypy'), ('VsixName', 'mypy.vsix'),
('NPM_CONFIG_REGISTRY', 'https://packagefeedproxy.microsoft.io/npm/'),
('PIP_PROXY_INDEX_URL', 'https://packagefeedproxy.microsoft.io/pypi/simple/'),
]],
'parameters': [
{'name': 'publishExtension', 'displayName': '🚀 Publish Extension', 'type': 'boolean', 'default': 'true'},
{'name': 'buildSteps', 'type': 'stepList', 'default': steps},
],
'extends': {'template': f'azure-pipelines/extension/{release}.yml@templates',
'parameters': extension_parameters},
}
if release == 'stable':
expected['name'] = 'Publish Release'
else:
expected['schedules'] = [{'cron': '0 10 * * 1-5', 'displayName': 'Nightly Pre-Release Schedule',
'always': 'false', 'branches': {'include': ['main']}}]
assert load(path) == expected, f'{path} differs from baseline plus requested pin'
assert OLD_PIN not in Path(path).read_text()
print(f'PASS: actual {release} YAML uses exact pin; all build/release settings, dev translations, main templates and publication defaults preserved')

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
print('PASS: README documents English fallback and retains structural handback requirements')
print('LIMITATION: referenced shared action is not present in this checkout; YAML guards do not execute release import or Azure template expansion')
PY

⚠️ Release localization import and Azure template expansion diagnostic output
The referenced shared localization action was absent from the verification checkout. Remote translation resources and Pylance-Eng templates were unavailable locally. Consumer YAML checks do not establish English fallback, malformed-handback rejection, or Azure expansion. No release or publication workflow was invoked.
⚠️ Dependency and test discovery diagnostic output
[container exit=0; partial discovery]
Sandbox profile: typescript
Linux
Python 3.13.18
v24.17.0
11.13.0
fatal: not a git repository (or any parent up to mount point /)
interpreter: /opt/automation-venv/bin/python
{'pytest': True, 'yaml': True}
absent: node_modules/prettier/bin/prettier.cjs
absent: node_modules/yaml
absent: external/vscode-common-python-lsp/.github/actions/localization/action.yml
present: external/vscode-common-python-lsp/typescript/package.json
package.json declares prettier ^3.2.4 and uses it for format-check. Initial formatting readiness was blocked by absent Node dependencies. Authorized offline setup subsequently succeeded with npm ci --offline --ignore-scripts; the targeted formatter then passed. Git-based discovery was unavailable in the container; source and baseline inspection used read-only repository tools.

@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 Technical debt or repo cleanup 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