Skip to content

Commit 84f0197

Browse files
committed
Merged PR 801431: Add shared extension release entry points and translation 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 ...
1 parent 8db86b5 commit 84f0197

6 files changed

Lines changed: 388 additions & 17 deletions

File tree

‎README.md‎

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,63 @@ TODO: Guide users through getting your code up and running on their own system.
1717

1818
# Build and Test
1919

20+
## Extension localization
21+
22+
The public `azure-pipelines/extension/stable.yml` and `pre-release.yml` entry
23+
points accept `pullLocalization: true` (default: false). This enables a shared
24+
**pull-only** import immediately after caller build steps and before VSIX
25+
packaging, so preparatory steps such as debugger pre-built copying cannot
26+
overwrite the imported translations.
27+
28+
Consumers declare two GitHub repository resources using their authorized
29+
`Github-Pylance` service connection:
30+
31+
```yaml
32+
resources:
33+
repositories:
34+
- repository: translations
35+
type: github
36+
name: microsoft/vscode-python-extensions-loc
37+
ref: refs/heads/dev
38+
endpoint: Github-Pylance
39+
- repository: localizationTools
40+
type: github
41+
name: microsoft/vscode-common-python-lsp
42+
ref: <reviewed-commit-sha>
43+
endpoint: Github-Pylance
44+
```
45+
46+
Declare Pylance-Eng as `templates` and extend the appropriate public entry point.
47+
Keep existing build, platform, registry, versioning, and validation parameters.
48+
Use `sourceAnalysisPool` to preserve an existing caller's source-analysis pool.
49+
50+
The package job keeps extension source at `$(Pipeline.Workspace)/s`, and checks
51+
out tools and translations in sibling `localization-tools` and
52+
`localization-translations` folders. Only translation data is automatically
53+
excluded from SDL source scanning. Extension source retains the default scan;
54+
executable tooling is explicitly included.
55+
`sourceRepositoriesToExclude` remains available for additional explicit
56+
exclusions. Azure template expansion can persist checkout credentials; this
57+
contract promises no release-side Git writes, not absence of persisted credentials.
58+
59+
The importer invokes the same pinned `scripts/localization.py` implementation
60+
used by the common repository's English-push GitHub composite action. It derives
61+
the extension ID and optional runtime directory from package.json, requires all
62+
14 locales, and validates all staged files before placement. Every required
63+
real-language manifest/runtime table must contain translation evidence; individual
64+
untranslated strings are permitted. Manifest-only extensions remain manifest-only.
65+
Missing or wholly untranslated handbacks fail explicitly.
66+
67+
English submission is a separate GitHub Actions workflow in each extension,
68+
calling the shared composite action with explicitly configured app credentials.
69+
Release pipelines do not extract English, acquire app write tokens, push to the
70+
drop, or create translation-update PRs. Pin action and Azure tooling revisions
71+
to the same reviewed common repository commit.
72+
73+
For validation, explicitly pass `publishExtension: false` to stable and
74+
pre-release previews/test runs. Do not publish while onboarding or real
75+
translated handbacks are still pending.
76+
2077
TODO: Describe and show how to build your code and run the tests.
2178

2279
# Contribute
@@ -28,5 +85,3 @@ If you want to learn more about creating good readme files then refer the follow
2885
- [ASP.NET Core](https://github.com/aspnet/Home)
2986
- [Visual Studio Code](https://github.com/Microsoft/vscode)
3087
- [Chakra Core](https://github.com/Microsoft/ChakraCore)
31-
32-
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
#
4+
# Pre-release entry point. Owns build, signing, and publishing stages.
5+
# Reference Pylance-Eng as "templates"; publishing is opt-in.
6+
parameters:
7+
- name: buildSteps
8+
type: stepList
9+
default: []
10+
- name: publishExtension
11+
type: boolean
12+
default: false
13+
- name: teamName
14+
type: string
15+
- name: customNPMRegistry
16+
type: string
17+
default: ''
18+
- name: sourceRepositoriesToExclude
19+
type: object
20+
default: []
21+
- name: sourceAnalysisPool
22+
type: string
23+
default: 'VSEngSS-MicroBuild2022-1ES'
24+
- name: pullLocalization
25+
type: boolean
26+
default: false
27+
- name: nodeVersion
28+
type: string
29+
default: '22.21.1'
30+
- name: workingDirectory
31+
type: string
32+
default: '$(Build.SourcesDirectory)'
33+
- name: buildPlatforms
34+
type: object
35+
default:
36+
- name: Linux
37+
vsceTarget:
38+
- name: standardizedVersioning
39+
type: boolean
40+
default: true
41+
- name: vscePackageArgs
42+
type: string
43+
default: ''
44+
- name: ghCreateTag
45+
type: boolean
46+
default: true
47+
- name: ghCreateRelease
48+
type: boolean
49+
default: true
50+
- name: ghReleaseAddChangeLog
51+
type: boolean
52+
default: true
53+
54+
extends:
55+
template: /azure-pipelines/extension/templates/pipeline.yml@templates
56+
parameters:
57+
buildSteps: ${{ parameters.buildSteps }}
58+
publishExtension: ${{ parameters.publishExtension }}
59+
teamName: ${{ parameters.teamName }}
60+
isPreRelease: true
61+
validationNotifyUsers: ''
62+
customNPMRegistry: ${{ parameters.customNPMRegistry }}
63+
sourceRepositoriesToExclude: ${{ parameters.sourceRepositoriesToExclude }}
64+
sourceAnalysisPool: ${{ parameters.sourceAnalysisPool }}
65+
pullLocalization: ${{ parameters.pullLocalization }}
66+
nodeVersion: ${{ parameters.nodeVersion }}
67+
workingDirectory: ${{ parameters.workingDirectory }}
68+
buildPlatforms: ${{ parameters.buildPlatforms }}
69+
standardizedVersioning: ${{ parameters.standardizedVersioning }}
70+
vscePackageArgs: ${{ parameters.vscePackageArgs }}
71+
ghCreateTag: ${{ parameters.ghCreateTag }}
72+
ghCreateRelease: ${{ parameters.ghCreateRelease }}
73+
ghReleaseAddChangeLog: ${{ parameters.ghReleaseAddChangeLog }}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
#
4+
# Stable entry point. Owns build, validation, signing, and publishing.
5+
# Reference Pylance-Eng as "templates"; publishing is opt-in and requires validation.
6+
parameters:
7+
- name: buildSteps
8+
type: stepList
9+
default: []
10+
- name: publishExtension
11+
type: boolean
12+
default: false
13+
- name: teamName
14+
type: string
15+
- name: validationNotifyUsers
16+
type: string
17+
default: ''
18+
- name: customNPMRegistry
19+
type: string
20+
default: ''
21+
- name: sourceRepositoriesToExclude
22+
type: object
23+
default: []
24+
- name: sourceAnalysisPool
25+
type: string
26+
default: 'VSEngSS-MicroBuild2022-1ES'
27+
- name: pullLocalization
28+
type: boolean
29+
default: false
30+
- name: nodeVersion
31+
type: string
32+
default: '22.21.1'
33+
- name: workingDirectory
34+
type: string
35+
default: '$(Build.SourcesDirectory)'
36+
- name: buildPlatforms
37+
type: object
38+
default:
39+
- name: Linux
40+
vsceTarget:
41+
- name: standardizedVersioning
42+
type: boolean
43+
default: true
44+
- name: vscePackageArgs
45+
type: string
46+
default: ''
47+
- name: ghCreateTag
48+
type: boolean
49+
default: true
50+
- name: ghCreateRelease
51+
type: boolean
52+
default: true
53+
- name: ghReleaseAddChangeLog
54+
type: boolean
55+
default: true
56+
57+
extends:
58+
template: /azure-pipelines/extension/templates/pipeline.yml@templates
59+
parameters:
60+
buildSteps: ${{ parameters.buildSteps }}
61+
publishExtension: ${{ parameters.publishExtension }}
62+
teamName: ${{ parameters.teamName }}
63+
isPreRelease: false
64+
validationNotifyUsers: ${{ parameters.validationNotifyUsers }}
65+
customNPMRegistry: ${{ parameters.customNPMRegistry }}
66+
sourceRepositoriesToExclude: ${{ parameters.sourceRepositoriesToExclude }}
67+
sourceAnalysisPool: ${{ parameters.sourceAnalysisPool }}
68+
pullLocalization: ${{ parameters.pullLocalization }}
69+
nodeVersion: ${{ parameters.nodeVersion }}
70+
workingDirectory: ${{ parameters.workingDirectory }}
71+
buildPlatforms: ${{ parameters.buildPlatforms }}
72+
standardizedVersioning: ${{ parameters.standardizedVersioning }}
73+
vscePackageArgs: ${{ parameters.vscePackageArgs }}
74+
ghCreateTag: ${{ parameters.ghCreateTag }}
75+
ghCreateRelease: ${{ parameters.ghCreateRelease }}
76+
ghReleaseAddChangeLog: ${{ parameters.ghReleaseAddChangeLog }}

‎azure-pipelines/extension/templates/jobs/package.yml‎

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,54 @@
44
# Template for building platform-specific VSIX packages
55
# Sets VSCETARGET environment variable for noxfile.py to select correct debugpy wheels
66
# Iterates over buildPlatforms to create a job per platform
7+
# Localization is pull-only and opt-in; declare translations and localizationTools.
78

89
parameters:
910
- name: buildPlatforms
1011
type: object
11-
displayName: "List of platforms to build"
12+
displayName: 'List of platforms to build'
1213
default:
1314
- name: Linux
1415
vsceTarget:
1516

1617
- name: customNPMRegistry
1718
type: string
18-
default: ""
19-
displayName: "Custom NPM registry (optional)"
19+
default: ''
20+
displayName: 'Custom NPM registry (optional)'
2021

2122
- name: nodeVersion
2223
type: string
23-
default: "22.21.1"
24-
displayName: "Node version to install"
24+
default: '22.21.1'
25+
displayName: 'Node version to install'
2526

2627
- name: buildSteps
2728
type: stepList
2829
default: []
29-
displayName: "Build steps to execute"
30+
displayName: 'Build steps to execute'
3031

3132
- name: isPreRelease
3233
type: boolean
3334
default: false
34-
displayName: "Is this a pre-release build"
35+
displayName: 'Is this a pre-release build'
3536

3637
- name: standardizedVersioning
3738
type: boolean
3839
default: false
39-
displayName: "Use standardized versioning (YYYYMMDDRR format)"
40+
displayName: 'Use standardized versioning (YYYYMMDDRR format)'
4041

4142
- name: vscePackageArgs
4243
type: string
43-
default: ""
44-
displayName: "Additional vsce package arguments"
44+
default: ''
45+
displayName: 'Additional vsce package arguments'
4546

4647
- name: workingDirectory
4748
type: string
48-
default: "$(Build.SourcesDirectory)"
49-
displayName: "Working directory for packaging"
49+
default: '$(Build.SourcesDirectory)'
50+
displayName: 'Working directory for packaging'
51+
52+
- name: pullLocalization
53+
type: boolean
54+
default: false
5055

5156
jobs:
5257
- ${{ each platform in parameters.buildPlatforms }}:
@@ -80,10 +85,14 @@ jobs:
8085
outputs:
8186
- output: pipelineArtifact
8287
displayName: "Publish VSIX for ${{ coalesce(platform.vsceTarget, 'universal') }}"
83-
targetPath: "$(Build.ArtifactStagingDirectory)/drop"
88+
targetPath: '$(Build.ArtifactStagingDirectory)/drop'
8489
artifactName: vsix-${{ coalesce(platform.vsceTarget, 'universal') }}
8590

8691
steps:
92+
# Keep the source root stable when buildSteps check out additional repositories.
93+
- checkout: self
94+
path: s
95+
8796
- template: ../steps/setup.yml
8897
parameters:
8998
customNPMRegistry: ${{ parameters.customNPMRegistry }}
@@ -97,11 +106,16 @@ jobs:
97106
- bash: |
98107
echo "##vso[task.setvariable variable=VSCETARGET]${{ platform.vsceTarget }}"
99108
echo "Building for target: ${{ platform.vsceTarget }}"
100-
displayName: "Set VSCETARGET variable"
109+
displayName: 'Set VSCETARGET variable'
101110
102111
- ${{ each buildStep in parameters.buildSteps }}:
103112
- ${{ buildStep }}
104113

114+
- ${{ if parameters.pullLocalization }}:
115+
- template: ../steps/import-localized-files.yml
116+
parameters:
117+
workingDirectory: ${{ parameters.workingDirectory }}
118+
105119
- ${{ if eq(platform.vsceTarget, '') }}:
106120
- bash: |
107121
VSIX=$(node -p "require(\"./package.json\").publisher + \".\" + require(\"./package.json\").name + \".\" + require(\"./package.json\").version + \".universal.vsix\"")
@@ -143,6 +157,6 @@ jobs:
143157
- task: CopyFiles@2
144158
inputs:
145159
sourceFolder: $(Build.BinariesDirectory)
146-
contents: "*.vsix"
160+
contents: '*.vsix'
147161
targetFolder: $(Build.ArtifactStagingDirectory)/drop
148162
displayName: 📦 Copy VSIX to staging

0 commit comments

Comments
 (0)