Skip to content

Commit 4b006f3

Browse files
bschnurrCopilot
andauthored
Use public registries in GitHub Actions and authenticated release feeds (#1144)
* Use template-authenticated internal feeds for release builds Match flake8/environments: pass Pylance_PublicPackages as the custom npm registry, use npm ci instead of the proxy-forcing ci:msft helper, and let PipAuthenticate supply Python feed credentials without per-step proxy overrides. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Honor authenticated release registries in ci:msft Preserve the release variable names and ci:msft command. Honor the effective npm registry for lockfile rewriting and installation while inheriting the template-authenticated npmrc. Resolve PIP_PROXY_INDEX_URL from PipAuthenticate output so per-step pip settings retain feed credentials. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Use internal Microsoft package feed defaults Replace packagefeedproxy defaults with Pylance_PublicPackages for npm and DevDiv/debugpy for pip. Preserve public defaults and update existing setup/registry tests. No workflow or credential changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Normalize registry overrides before rewriting and installing Ensure slashless npm registry overrides end in a slash before building lockfile download URLs and invoking npm ci. Add regressions for public/internal registry rewrites and both uppercase/lowercase environment overrides while preserving npm authentication. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Use internal package feeds in GitHub workflows Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Authenticate GitHub package feed installs using Azure OIDC Port the isort feed authentication action and npm/pip configuration. Retain per-platform debugger bundles because debugpy wheels are host-specific. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Use public registries in GitHub Actions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 629d0ab commit 4b006f3

15 files changed

Lines changed: 122 additions & 83 deletions

‎.github/actions/build-vsix/action.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ runs:
3535
run: python -m pip install -U pip pipx wheel
3636
shell: bash
3737

38-
- name: Install Node dependencies through Microsoft feeds
39-
run: npm run ci:msft
38+
- name: Install Node dependencies
39+
run: npm ci
4040
env:
4141
npm_config_prefer_offline: 'true'
4242
shell: bash

‎.github/actions/lint/action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ runs:
2020
shell: bash
2121

2222
- name: Install Node dependencies
23-
run: npm run ci:msft
23+
run: npm ci
2424
shell: bash
2525

2626
- name: Lint TypeScript code

‎.github/workflows/codeql-analysis.yml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ on:
2020
schedule:
2121
- cron: '15 16 * * 2'
2222

23-
env:
24-
NPM_CONFIG_REGISTRY: https://packagefeedproxy.microsoft.io/npm/
25-
PIP_INDEX_URL: https://packagefeedproxy.microsoft.io/pypi/simple/
26-
2723
jobs:
2824
analyze:
2925
name: Analyze

‎.github/workflows/info-needed-closer.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ permissions:
1212
jobs:
1313
main:
1414
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
issues: write
1518
steps:
1619
- name: Checkout Actions
1720
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

‎.github/workflows/issue-labels.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ jobs:
1515
add-classify-label:
1616
name: "Add 'triage-needed' and remove assignees"
1717
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
issues: write
1821
steps:
1922
- name: Checkout Actions
2023
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

‎.github/workflows/localization.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ jobs:
2828
with:
2929
app-id: ${{ vars.PYTHON_LOCALIZATION_APP_ID }}
3030
private-key: ${{ secrets.PYTHON_LOCALIZATION_PRIVATE_KEY }}
31+
npm-registry: https://registry.npmjs.org/

‎.github/workflows/pr-check.yml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
permissions: {}
77

88
env:
9-
PIP_INDEX_URL: https://packagefeedproxy.microsoft.io/pypi/simple/
109
NODE_VERSION: 22.17.0
1110
TEST_RESULTS_DIRECTORY: .
1211
# Force a path with spaces and unicode chars to test extension works in these scenarios
@@ -17,6 +16,8 @@ jobs:
1716
build-vsix:
1817
name: Create VSIX
1918
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
2021
steps:
2122
- name: Checkout
2223
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -31,6 +32,8 @@ jobs:
3132
lint:
3233
name: Lint
3334
runs-on: ubuntu-latest
35+
permissions:
36+
contents: read
3437
steps:
3538
- name: Checkout
3639
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -45,6 +48,8 @@ jobs:
4548
tests:
4649
name: Tests
4750
runs-on: ${{ matrix.os }}
51+
permissions:
52+
contents: read
4853
defaults:
4954
run:
5055
working-directory: ${{ env.special-working-directory }}
@@ -85,7 +90,7 @@ jobs:
8590
cache-dependency-path: ${{ env.special-working-directory-relative }}/package-lock.json
8691

8792
- name: Install dependencies (npm ci)
88-
run: npm run ci:msft
93+
run: npm ci
8994

9095
# Now that the bundle is installed to target using python 3.9
9196
# switch back the python we want to test with

‎.github/workflows/push-check.yml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ on:
1111
permissions: {}
1212

1313
env:
14-
PIP_INDEX_URL: https://packagefeedproxy.microsoft.io/pypi/simple/
1514
NODE_VERSION: 22.17.0
1615
TEST_RESULTS_DIRECTORY: .
1716
# Force a path with spaces and unicode chars to test extension works in these scenarios
@@ -22,6 +21,8 @@ jobs:
2221
build-vsix:
2322
name: Create VSIX
2423
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
2526
steps:
2627
- name: Checkout
2728
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -36,6 +37,8 @@ jobs:
3637
lint:
3738
name: Lint
3839
runs-on: ubuntu-latest
40+
permissions:
41+
contents: read
3942
steps:
4043
- name: Checkout
4144
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -50,6 +53,8 @@ jobs:
5053
tests:
5154
name: Tests
5255
runs-on: ${{ matrix.os }}
56+
permissions:
57+
contents: read
5358
defaults:
5459
run:
5560
working-directory: ${{ env.special-working-directory }}
@@ -90,7 +95,7 @@ jobs:
9095
cache-dependency-path: ${{ env.special-working-directory-relative }}/package-lock.json
9196

9297
- name: Install dependencies (npm ci)
93-
run: npm run ci:msft
98+
run: npm ci
9499

95100
# Now that the bundle is installed to target using python 3.9
96101
# switch back the python we want to test with

‎README.md‎

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The Debugpy Extension for Visual Studio Code collects usage data and sends it to
5757

5858
### Local package feeds
5959

60-
Use Node.js supported by this repository and Python 3.10 or later. Both setup commands create or reuse `.venv` and install the Python bundling tools. Choose the appropriate setup below before installing dependencies. Committed lockfiles use public npm URLs; Microsoft setup rewrites working copies for proxy installs.
60+
Use Node.js supported by this repository and Python 3.10 or later. Both setup commands create or reuse `.venv` and install the Python bundling tools. Choose the appropriate setup below before installing dependencies. Committed lockfiles use public npm URLs; Microsoft setup rewrites working copies for Microsoft feed installs.
6161

6262
#### Public contributors (non-Microsoft employees)
6363

@@ -75,13 +75,13 @@ For subsequent npm installs, use `npm ci`. Public contributors do not need the M
7575

7676
> **Microsoft users only:** The commands in this section configure Microsoft package feeds. Public contributors should use the public setup above.
7777

78-
Use the Microsoft setup, which selects `https://packagefeedproxy.microsoft.io/npm/` and `https://packagefeedproxy.microsoft.io/pypi/simple/` for its child processes:
78+
Use the Microsoft setup, which selects the `Pylance_PublicPackages` npm and PyPI feeds in `build/package-feeds.json`. Configure credentials for both feeds before running it; setup does not authenticate:
7979

8080
```bash
8181
npm run setup:msft
8282
```
8383

84-
Microsoft setup rewrites public npm and Yarn `resolved` URLs in the root `package-lock.json` to the npm proxy before running `npm ci`. Versions, integrity hashes, formatting, and private-feed URLs are preserved. The public setup leaves lockfiles unchanged.
84+
Microsoft setup rewrites public npm and Yarn `resolved` URLs in the root `package-lock.json` to the Microsoft npm feed before running `npm ci`. Versions, integrity hashes, formatting, and private-feed URLs are preserved. The public setup leaves lockfiles unchanged.
8585

8686
After pulling a new lockfile from GitHub, rerun `npm run setup:msft`, or run the dependency-free rewrite step alone before your next install/build:
8787

@@ -97,7 +97,7 @@ For subsequent root npm installs, use:
9797
npm run ci:msft
9898
```
9999

100-
This rewrites the root lockfile, then runs root `npm ci` with the proxy registry explicitly selected for package, audit, and metadata requests. Use `npm run setup:msft` for full setup, including Python dependencies.
100+
This rewrites the root lockfile, then runs root `npm ci` with the Microsoft registry explicitly selected for package, audit, and metadata requests. Use `npm run setup:msft` for full setup, including Python dependencies.
101101

102102
Local setup, lockfile rewriting, and `ci:msft` share the feed URLs in `build/package-feeds.json`.
103103

@@ -121,25 +121,19 @@ To normalize manually, run `npm run normalize-lockfile`, review the changes, and
121121

122122
### GitHub Actions package feeds
123123

124-
The PR and push workflows set `PIP_INDEX_URL` to `https://packagefeedproxy.microsoft.io/pypi/simple/` for pip and nox installs. Their Node installation steps select `https://packagefeedproxy.microsoft.io/npm/` explicitly through `npm run ci:msft`, so these workflows do not set `NPM_CONFIG_REGISTRY`. CodeQL retains both environment variables because its autobuild step does not use the install helper. The npm endpoint follows the [TypeScript CI package-feed-proxy job](https://github.com/microsoft/TypeScript/blob/main/.github/workflows/ci.yml).
125-
126-
The shared lint and VSIX build actions and applicable PR/push test jobs use `npm run ci:msft`, rewriting working-copy lockfile URLs before installation and explicitly selecting the proxy for npm requests. Workflows do not commit these rewrites or change local registry configuration or Dependabot configuration. Existing dependency caches are retained; the VSIX build also retains its offline-cache preference. CodeQL retains workflow-level feed settings for its autobuild step.
124+
GitHub Actions use public npm and PyPI without feed authentication, including for fork PRs. Localization explicitly selects public npm because the shared action defaults to a proxy.
127125

128126
### Azure release package feeds
129127

130-
The DevDiv Azure stable/prerelease pipelines pass the npm proxy to their build/publish templates using `customNPMRegistry`. Their dependency install steps use `npm run ci:msft` to rewrite the root npm lockfile and install through the proxy.
131-
132-
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.
133-
134-
Dependabot continues to use public registries and its existing update settings. Legacy Azure stable, prerelease, and validation definitions are unchanged.
128+
The DevDiv stable and prerelease pipelines pass the `Pylance_PublicPackages` npm feed to the shared template, which authenticates npm and the `DevDiv/debugpy` Python feed before build steps. Release triggers, approval gates, signing, and publishing are unchanged.
135129

136130
### Localization
137131

138132
The **Localization** GitHub workflow submits English strings using the [shared composite action and Python tooling](https://github.com/microsoft/vscode-python-ci/tree/main/actions/localization). Stable and pre-release DevDiv pipelines independently retrieve translations through Pylance-Eng's `pullLocalization: true`; releases never submit English or create translation-update PRs.
139133

140134
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.
141135

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 the [pipeline templates](https://github.com/microsoft/pylance-eng), translation, and shared-tooling repository resources in both release pipelines.
136+
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 public npm and a pinned localization CLI. Authorize the literal `Github-Pylance` service connection for the [pipeline templates](https://github.com/microsoft/pylance-eng), translation, and shared-tooling repository resources in both release pipelines.
143137

144138
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).
145139

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

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ variables:
3333
value: VSCode-python-debugger
3434
- name: VsixName
3535
value: python-debugger.vsix
36-
- name: NPM_CONFIG_REGISTRY
37-
value: 'https://packagefeedproxy.microsoft.io/npm/'
38-
- name: PIP_PROXY_INDEX_URL
39-
value: 'https://packagefeedproxy.microsoft.io/pypi/simple/'
36+
- name: AZURE_ARTIFACTS_FEED
37+
value: 'https://devdiv.pkgs.visualstudio.com/DevDiv/_packaging/Pylance_PublicPackages/npm/registry/'
4038

4139
parameters:
4240
- name: publishExtension
@@ -74,28 +72,20 @@ parameters:
7472
- name: buildSteps
7573
type: stepList
7674
default:
77-
- script: npm run ci:msft
75+
- script: npm ci
7876
displayName: Install NPM dependencies
7977

8078
- script: python -m pip install -U pip
8179
displayName: Upgrade pip
82-
env:
83-
PIP_INDEX_URL: $(PIP_PROXY_INDEX_URL)
8480

8581
- script: python -m pip install wheel
8682
displayName: Install wheel
87-
env:
88-
PIP_INDEX_URL: $(PIP_PROXY_INDEX_URL)
8983

9084
- script: python -m pip install nox
9185
displayName: Install nox
92-
env:
93-
PIP_INDEX_URL: $(PIP_PROXY_INDEX_URL)
9486

9587
- script: python -m nox --session install_bundled_libs
9688
displayName: Install Python dependencies
97-
env:
98-
PIP_INDEX_URL: $(PIP_PROXY_INDEX_URL)
9989

10090
- script: python ./build/update_ext_version.py --for-publishing
10191
displayName: Update build number
@@ -112,7 +102,7 @@ extends:
112102
buildPlatforms: ${{ parameters.buildPlatforms }}
113103
buildSteps: ${{ parameters.buildSteps }}
114104
standardizedVersioning: true
115-
customNPMRegistry: $(NPM_CONFIG_REGISTRY)
105+
customNPMRegistry: $(AZURE_ARTIFACTS_FEED)
116106
publishExtension: ${{ parameters.publishExtension }}
117107
teamName: $(TeamName)
118108
ghCreateTag: true

0 commit comments

Comments
 (0)