You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dbcb672
Browse filesBrowse the repository at this point in the historyBrowse files
chore: update vsce to 4 and fix the msal-node advisory (#1927)
## Motivation
Two Dependabot alerts cannot be fixed automatically:
- `@azure/msal-node` [GHSA-xcx6-jx8p-x3h5](GHSA-xcx6-jx8p-x3h5) (fixed in 7.1.0), pulled in by `@vscode/vsce` and `ovsx` through `@azure/identity@4.13.3`.
- `minimatch` [GHSA-g3hv-75wg-m249](GHSA-g3hv-75wg-m249) (affects `>=7.0.0 <11.0.1`, no fixed 10.x release).
## Changes
- Update `@azure/identity` in the lockfile to 4.14.1. It depends on `@azure/msal-node` `^7.1.0`, so `@azure/msal-node` is now 7.2.1. This fixes the msal-node alert without changing any version range in `package.json`.
- Update `@vscode/vsce` from `^3.6.0` to `^4.1.0`. `ovsx@1.3.0` already depends on vsce 4, so two vsce trees were installed. vsce 4 needs Node.js 22 or later (CI uses 24). It replaces glob with tinyglobby and no longer depends on `keytar`, so `keytar` is removed from `allowBuilds`. The lockfile loses about 1,000 lines.
- Remove `src/test/suite/index.ts`. It is the old Mocha runner from before `@vscode/test-cli`, and `.vscode-test.mjs` does not use it. The root `glob` dev dependency was only used there, so it is removed too.
- TypeScript 7 defaults `types` to `[]`. The removed runner's `import Mocha from 'mocha'` was what loaded the Mocha globals (`suite`, `test`) for the other test files, so `tsconfig.json` now lists `mocha` and `node` in `types`.
No CHANGELOG entry, as this is an internal change.
## Notes: minimatch alert stays open
This PR does not fix the minimatch alert, and it cannot be fixed with an `overrides` entry:
- `vscode-languageclient` (10.1.2, and also the latest 11.0.0) depends on `minimatch ^10.2.6` and calls `Minimatch#makeRe()`. minimatch 11 removes `makeRe()`, so forcing 11 would throw a `TypeError` at runtime in the bundled extension. Upstream tracks this in `microsoft/vscode-languageserver-node#1938` (the fix PR `microsoft/vscode-languageserver-node#1935` currently fails CI).
- glob 10 and 13 (via mocha, `@vscode/test-cli` and `test-exclude`) need glob 14 for minimatch 11, so the dev tools would need several more overrides. The alert would still stay open because of `vscode-languageclient`.
The vulnerable code (`firstPhasePreProcess`) only runs with `optimizationLevel >= 2`. `vscode-languageclient` uses the default level 1, and its patterns come from the R language server. glob uses level 2, but only with the repository's own test globs. Once `vscode-languageclient` releases a version on minimatch 11, the alert should be fixable with a normal update.
## Update: debugging extension tests
The **Extension Tests** launch configuration in `.vscode/launch.json` still pointed at the removed runner (`out/test/suite/index`), so it could no longer run any tests. It now uses js-debug's `testConfiguration` option (VS Code 1.87+) with `.vscode-test.mjs`:
- After the `pretest` pre-launch task, js-debug runs `vscode-test --list-configuration`, asks which configuration to run, and launches `@vscode/test-cli`'s own runner with that configuration's files, Mocha options and launch arguments. F5 debugging works as before, without a second hand-written runner or the `glob` dependency.
- This is also more accurate than the old runner, which ran every `src/test/suite/` file in one window without `out/test/common/extensionSetup.js` or the per-suite profiles.
- Unlike the CLI, it runs in the current VS Code and does not install extension dependencies, so R Syntax must already be installed. `CONTRIBUTING.md` says this.
[Extension Test Runner](https://marketplace.visualstudio.com/items?itemName=ms-vscode.extension-test-runner) (`ms-vscode.extension-test-runner`) is added to the workspace recommendations as an optional way to run or debug individual tests from the Testing view. Neither the debugger nor the CLI requires it.
The `sess-install-tasks` configuration is removed. Its only test (`src/test/integration/sessInstall.test.ts`) was removed in #1856, so it ran 0 tests. Its temporary workspace was also deleted on process exit, so it was gone when a separate `--list-configuration` process (as used by the debugger and Extension Test Runner) exited.
## Update: working-directory-independent test profiles
Test profile directories in `.vscode-test.mjs` now resolve relative to the configuration file's `import.meta.url`, using `fileURLToPath` for native filesystem paths. js-debug can load the configuration from a working directory outside the checkout, including the VS Code installation directory on Windows. Profiles now consistently stay under the checkout's `.vscode-test/user-data` directory.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+23-9Lines changed: 23 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ If a command reports `pnpm: command not found`, ensure pnpm's installation direc
17
17
2. Select **Launch Extension** in Run and Debug, then press **F5**. The pre-launch task runs `pnpm run compile` to build the extension and webviews in `dist`, including source maps for TypeScript breakpoints.
18
18
3. Open an R file or run an R command in the Extension Development Host to activate vscode-R. Ensure the **R Syntax** extension (`REditorSupport.r-syntax`) is installed and enabled there.
19
19
20
-
For continuous rebuilding, run `pnpm run watch`. `pnpm run build` additionally installs the bundled `sess` R package; this is not required just to launch the extension debugger.**Extension Tests** builds both the bundle and the TypeScript test files before launching.
20
+
For continuous rebuilding, run `pnpm run watch`. `pnpm run build` additionally installs the bundled `sess` R package; this is not required just to launch the extension debugger.
21
21
22
22
VS Code 1.140.0 bundles [JavaScript Debugger 1.140.0](https://github.com/microsoft/vscode-js-debug/releases/tag/v1.140.0), which fixes the [extension host attach regression in VS Code 1.139](https://github.com/microsoft/vscode-js-debug/issues/2420). Use the built-in **JavaScript Debugger** on VS Code 1.140.0 or newer. If you previously used **JavaScript Debugger Nightly**, disable Nightly, re-enable the built-in debugger (`ms-vscode.js-debug`) in the Extensions view, and run **Developer: Reload Window**.
The provider is arf. `ARF_PATH` selects its executable; `VSCR_TEST_STATIC=1` selects standard graphics. The tmux variant needs tmux and exercises a real supervised agent, as Linux CI does. These variables can be combined. Check skipped tests when assessing coverage: a missing optional runtime or package is not a verified pass for that feature.
101
101
102
102
`pnpm run test` prepares the bundle and test files, runs `src/test/node/` directly
103
-
in Node/Mocha, then runs the extension-host suites and isolated sess task tests.
103
+
in Node/Mocha, then runs the extension-host suites.
104
104
`pnpm run test:interactive` prepares and runs only the Node suites, including
105
105
supervision. After preparing once with `pnpm run pretest`, use `pnpm run test:node`
106
-
and `pnpm run test:extension` to rerun either layer without rebuilding. The
107
-
**Extension Tests** debugger configuration runs only `src/test/suite/`; use the
108
-
CLI for the isolated multi-folder sess task tests.
106
+
and `pnpm run test:extension` to rerun either layer without rebuilding.
107
+
108
+
To debug extension-host tests, select **Extension Tests** in Run and Debug and
109
+
press **F5**. The pre-launch task runs `pnpm run pretest`, and the debugger then
110
+
asks which `.vscode-test.mjs` configuration to run (`provider-tests`,
111
+
`editor-command-tests` or `interactive-integration`). One launch runs only the
112
+
selected configuration, with the same files, Mocha options and launch arguments
113
+
as `pnpm run test:extension`. Unlike the CLI, it runs in the current VS Code and
114
+
does not install extension dependencies, so the **R Syntax** extension must
115
+
already be installed. `interactive-integration` also needs the R and arf setup
116
+
described above.
117
+
118
+
Alternatively, the optional
119
+
[Extension Test Runner](https://marketplace.visualstudio.com/items?itemName=ms-vscode.extension-test-runner)
120
+
extension (`ms-vscode.extension-test-runner`, in the workspace recommendations)
121
+
lists the same configurations in the Testing view, so individual tests or suites
122
+
can be run or debugged from there after `pnpm run pretest`.
109
123
110
124
PR CI, main pushes and manual runs execute the full supported suites on every
111
-
OS. Linux and macOS run the same Node, Interactive editor and isolated sess task
112
-
tests, including the actual VS Code Electron runtime check with no Node executable
113
-
on PATH and successful session creation using the default VS Code runtime.
125
+
OS. Linux and macOS run the same Node and Interactive editor tests, including
126
+
the actual VS Code Electron runtime check with no Node executable on PATH and
127
+
successful session creation using the default VS Code runtime.
114
128
Windows skips the Interactive runtime/editor suites because persistent
115
129
supervision currently requires Linux/macOS. Linux additionally runs the tmux launcher survival case
116
130
once with tmux enabled and uses Xvfb for extension-host tests. Source/bootstrap
On headless Linux, run the editor command under `xvfb-run -a`. The test configuration installs R Syntax in the test profile. [runtime-lifecycle.cjs](src/test/examples/README.md#editor-runtime-lifecycle) separately checks persistence across full application exit and different editor versions. Use it with the minimum VS Code version from `package.json` and current stable when changing runtime launch or reconnection.
140
+
On headless Linux, run the editor command under `xvfb-run -a`. When run from the CLI, the test configuration installs R Syntax in the test profile. [runtime-lifecycle.cjs](src/test/examples/README.md#editor-runtime-lifecycle) separately checks persistence across full application exit and different editor versions. Use it with the minimum VS Code version from `package.json` and current stable when changing runtime launch or reconnection.
0 commit comments