Skip to content

Commit 3e34beb

Browse files
bschnurrCopilot
andcommitted
Use shared English localization action and pull-only release imports
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d6fdba9 commit 3e34beb

5 files changed

Lines changed: 96 additions & 108 deletions

File tree

‎.github/workflows/localization.yml‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Localization
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- package.json
10+
- package.nls.json
11+
- src/**/*.ts
12+
- .github/workflows/localization.yml
13+
14+
permissions:
15+
contents: read
16+
17+
concurrency:
18+
group: localization-${{ github.ref }}
19+
cancel-in-progress: false
20+
21+
jobs:
22+
localization:
23+
if: github.repository == 'microsoft/vscode-python-debugger'
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 20
26+
steps:
27+
- uses: microsoft/vscode-common-python-lsp/.github/actions/localization@d1877b84bb10ff7caa6bd12ab4e75498ba760790
28+
with:
29+
app-id: ${{ vars.PYTHON_LOCALIZATION_APP_ID }}
30+
private-key: ${{ secrets.PYTHON_LOCALIZATION_PRIVATE_KEY }}

‎.gitignore‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@ bundled/libs/
1313
# Generated files (sources live in pre-built/)
1414
l10n/bundle.l10n.*.json
1515
package.nls.*.json
16-
telemetry.json
16+
telemetry.json
17+
18+
# Localization is generated from the dev handback during releases.
19+
/package.nls.*.json
20+
/l10n/

‎README.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,15 @@ The DevDiv Azure stable/prerelease pipelines pass the npm proxy to their build/p
132132
Each Python bootstrap and bundled-library install step explicitly sets `PIP_INDEX_URL` from `PIP_PROXY_INDEX_URL`, selecting the pip proxy even when a template's authentication setup changes the job-level index. Release triggers, approval gates, signing, and publishing behavior are unchanged.
133133

134134
Dependabot continues to use public registries and its existing update settings. Legacy Azure stable, prerelease, and validation definitions are unchanged.
135+
136+
### Localization
137+
138+
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.
139+
140+
Both paths use `microsoft/vscode-python-extensions-loc`, branch **`dev`**, with canonical extension ID **`ms-python.debugpy`**. English XLF is stored in `src/en/ms-python.debugpy` and handbacks in `out/ms-python.debugpy`. The action and Azure tooling checkout are pinned to the same reviewed revision.
141+
142+
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.
143+
144+
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 (debugger pre-built assets remain available, but the release import runs after their overlay and is authoritative).
145+
146+
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.

‎build/azure-devdiv-pipeline.pre-release.yml‎

Lines changed: 24 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,20 @@ schedules:
1212

1313
resources:
1414
repositories:
15-
- repository: MicroBuildTemplate
16-
type: git
17-
name: 1ESPipelineTemplates/MicroBuildTemplate
18-
ref: refs/tags/release
19-
2015
- repository: templates
2116
type: git
2217
name: DevDiv/Pylance-Eng
23-
ref: refs/heads/main
18+
ref: refs/heads/users/bschnurr/localization-wrapper
19+
- repository: translations
20+
type: github
21+
name: microsoft/vscode-python-extensions-loc
22+
ref: refs/heads/dev
23+
endpoint: Github-Pylance
24+
- repository: localizationTools
25+
type: github
26+
name: microsoft/vscode-common-python-lsp
27+
ref: d1877b84bb10ff7caa6bd12ab4e75498ba760790
28+
endpoint: Github-Pylance
2429
variables:
2530
- name: TeamName
2631
value: VSCode-python-debugger
@@ -33,7 +38,7 @@ variables:
3338

3439
parameters:
3540
- name: publishExtension
36-
displayName: 🚀 Publish Extension
41+
displayName: 🚀 Publish Extension
3742
type: boolean
3843
default: true
3944

@@ -100,43 +105,16 @@ parameters:
100105
displayName: Build extension
101106

102107
extends:
103-
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
108+
template: azure-pipelines/extension/pre-release.yml@templates
104109
parameters:
105-
sdl:
106-
sourceAnalysisPool: VSEng-MicroBuildVSStable
107-
codeSignValidation:
108-
enabled: true
109-
sbom:
110-
enabled: false # Disable global SBOM generation; we'll enable selectively per artifact output
111-
pool:
112-
name: AzurePipelines-EO
113-
os: windows
114-
115-
customBuildTags:
116-
- ES365AIMigrationTooling
117-
stages:
118-
- stage: Build
119-
displayName: Build & Package Extension
120-
jobs:
121-
- template: azure-pipelines/extension/templates/jobs/package.yml@templates
122-
parameters:
123-
buildPlatforms: ${{ parameters.buildPlatforms }}
124-
buildSteps: ${{ parameters.buildSteps }}
125-
isPreRelease: true
126-
standardizedVersioning: true
127-
customNPMRegistry: $(NPM_CONFIG_REGISTRY)
128-
129-
- stage: Publish
130-
displayName: Publish Extension
131-
dependsOn: Build
132-
jobs:
133-
- template: azure-pipelines/extension/templates/jobs/publish-extension.yml@templates
134-
parameters:
135-
buildPlatforms: ${{ parameters.buildPlatforms }}
136-
publishExtension: ${{ parameters.publishExtension }}
137-
preRelease: true
138-
teamName: $(TeamName)
139-
ghCreateTag: true
140-
ghCreateRelease: true
141-
ghReleaseAddChangeLog: true
142-
customNPMRegistry: $(NPM_CONFIG_REGISTRY)
110+
buildPlatforms: ${{ parameters.buildPlatforms }}
111+
buildSteps: ${{ parameters.buildSteps }}
112+
standardizedVersioning: true
113+
customNPMRegistry: $(NPM_CONFIG_REGISTRY)
114+
publishExtension: ${{ parameters.publishExtension }}
115+
teamName: $(TeamName)
116+
ghCreateTag: true
117+
ghCreateRelease: true
118+
ghReleaseAddChangeLog: true
119+
sourceAnalysisPool: VSEng-MicroBuildVSStable
120+
pullLocalization: true

‎build/azure-devdiv-pipeline.stable.yml‎

Lines changed: 25 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,20 @@ pr: none
77

88
resources:
99
repositories:
10-
- repository: MicroBuildTemplate
11-
type: git
12-
name: 1ESPipelineTemplates/MicroBuildTemplate
13-
ref: refs/tags/release
14-
1510
- repository: templates
1611
type: git
1712
name: DevDiv/Pylance-Eng
18-
ref: refs/heads/main
13+
ref: refs/heads/users/bschnurr/localization-wrapper
14+
- repository: translations
15+
type: github
16+
name: microsoft/vscode-python-extensions-loc
17+
ref: refs/heads/dev
18+
endpoint: Github-Pylance
19+
- repository: localizationTools
20+
type: github
21+
name: microsoft/vscode-common-python-lsp
22+
ref: d1877b84bb10ff7caa6bd12ab4e75498ba760790
23+
endpoint: Github-Pylance
1924
variables:
2025
- name: TeamName
2126
value: VSCode-python-debugger
@@ -28,7 +33,7 @@ variables:
2833

2934
parameters:
3035
- name: publishExtension
31-
displayName: 🚀 Publish Extension
36+
displayName: 🚀 Publish Extension
3237
type: boolean
3338
default: true
3439

@@ -95,58 +100,17 @@ parameters:
95100
displayName: Build extension
96101

97102
extends:
98-
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
103+
template: azure-pipelines/extension/stable.yml@templates
99104
parameters:
100-
sdl:
101-
sourceAnalysisPool: VSEng-MicroBuildVSStable
102-
codeSignValidation:
103-
enabled: true
104-
sbom:
105-
enabled: false # Disable global SBOM generation; we'll enable selectively per artifact output
106-
pool:
107-
name: AzurePipelines-EO
108-
os: windows
109-
110-
customBuildTags:
111-
- ES365AIMigrationTooling
112-
stages:
113-
- stage: Build
114-
displayName: Build & Package Extension
115-
jobs:
116-
- template: azure-pipelines/extension/templates/jobs/package.yml@templates
117-
parameters:
118-
buildPlatforms: ${{ parameters.buildPlatforms }}
119-
buildSteps: ${{ parameters.buildSteps }}
120-
isPreRelease: false
121-
standardizedVersioning: true
122-
customNPMRegistry: $(NPM_CONFIG_REGISTRY)
123-
124-
- stage: WaitForValidation
125-
displayName: Wait for Validation
126-
dependsOn: Build
127-
jobs:
128-
- job: wait_for_validation
129-
displayName: Wait for manual validation
130-
pool: server
131-
steps:
132-
- task: ManualValidation@0
133-
timeoutInMinutes: 1440 # task times out in 1 day
134-
inputs:
135-
notifyUsers: 'plseng@microsoft.com'
136-
instructions: 'please test the latest draft release then publish it.'
137-
onTimeout: 'reject'
138-
139-
- stage: Publish
140-
displayName: Publish Extension
141-
dependsOn: WaitForValidation
142-
jobs:
143-
- template: azure-pipelines/extension/templates/jobs/publish-extension.yml@templates
144-
parameters:
145-
buildPlatforms: ${{ parameters.buildPlatforms }}
146-
publishExtension: ${{ parameters.publishExtension }}
147-
preRelease: false
148-
teamName: $(TeamName)
149-
ghCreateTag: true
150-
ghCreateRelease: true
151-
ghReleaseAddChangeLog: true
152-
customNPMRegistry: $(NPM_CONFIG_REGISTRY)
105+
buildPlatforms: ${{ parameters.buildPlatforms }}
106+
buildSteps: ${{ parameters.buildSteps }}
107+
standardizedVersioning: true
108+
customNPMRegistry: $(NPM_CONFIG_REGISTRY)
109+
publishExtension: ${{ parameters.publishExtension }}
110+
teamName: $(TeamName)
111+
ghCreateTag: true
112+
ghCreateRelease: true
113+
ghReleaseAddChangeLog: true
114+
validationNotifyUsers: plseng@microsoft.com
115+
sourceAnalysisPool: VSEng-MicroBuildVSStable
116+
pullLocalization: true

0 commit comments

Comments
 (0)