Skip to content

Commit 320d8ae

Browse files
authored
Update copilot-setup-steps and NodeJS dependencies (#142)
1 parent f12b14b commit 320d8ae

File tree

6 files changed

+259
-196
lines changed

6 files changed

+259
-196
lines changed

.github/workflows/copilot-setup-steps.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,23 @@ jobs:
6060

6161
- name: Copilot Setup - Install CodeQL packs used in integration tests
6262
run: ./server/scripts/install-packs.sh
63+
64+
# VS Code extension integration test prerequisites
65+
- name: Copilot Setup - Install xvfb and VS Code dependencies
66+
run: |
67+
sudo apt-get update
68+
sudo apt-get install -y xvfb libgbm1 libgtk-3-0 libxshmfence1
69+
sudo apt-get install -y libasound2t64 || sudo apt-get install -y libasound2
70+
71+
- name: Copilot Setup - Build server (extension dependency)
72+
run: npm run build -w server
73+
74+
- name: Copilot Setup - Bundle extension and server
75+
working-directory: extensions/vscode
76+
run: |
77+
npm run bundle
78+
npm run bundle:server
79+
80+
- name: Copilot Setup - Download VS Code for integration tests
81+
working-directory: extensions/vscode
82+
run: npm run download:vscode

extensions/vscode/package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"url": "https://github.com/advanced-security/codeql-development-mcp-server/issues"
1717
},
1818
"engines": {
19-
"vscode": "^1.109.0",
19+
"vscode": "^1.110.0",
2020
"node": ">=24.13.0"
2121
},
2222
"categories": [
@@ -148,6 +148,7 @@
148148
"bundle": "node esbuild.config.js",
149149
"bundle:server": "node scripts/bundle-server.js",
150150
"clean": "rm -rf dist server .vscode-test/* *.vsix",
151+
"download:vscode": "node scripts/download-vscode.js",
151152
"lint": "eslint src/ test/",
152153
"lint:fix": "eslint src/ test/ --fix",
153154
"package": "vsce package --no-dependencies --out codeql-development-mcp-server-v$(node -e 'process.stdout.write(require(`./package.json`).version)').vsix",
@@ -162,21 +163,21 @@
162163
"devDependencies": {
163164
"@eslint/js": "^10.0.1",
164165
"@types/mocha": "^10.0.10",
165-
"@types/node": "^25.3.5",
166-
"@types/vscode": "^1.109.0",
166+
"@types/node": "^25.5.0",
167+
"@types/vscode": "^1.110.0",
167168
"@vitest/coverage-v8": "^4.1.0",
168169
"@vscode/test-cli": "^0.0.12",
169170
"@vscode/test-electron": "^2.5.2",
170171
"@vscode/vsce": "^3.7.1",
171-
"esbuild": "^0.27.3",
172+
"esbuild": "^0.27.4",
172173
"eslint": "^10.0.3",
173174
"eslint-config-prettier": "^10.1.8",
174175
"eslint-plugin-prettier": "^5.5.5",
175176
"glob": "^13.0.6",
176177
"mocha": "^11.7.5",
177178
"prettier": "^3.8.1",
178179
"typescript": "^5.9.3",
179-
"typescript-eslint": "^8.56.1",
180-
"vitest": "^4.0.18"
180+
"typescript-eslint": "^8.57.0",
181+
"vitest": "^4.1.0"
181182
}
182183
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/env node
2+
/**
3+
* Downloads VS Code for integration testing.
4+
*
5+
* This script pre-downloads the VS Code instance required by @vscode/test-cli
6+
* for running Extension Host integration tests. Used in CI/copilot setup steps
7+
* to ensure VS Code is available before running tests.
8+
*
9+
* Usage: node scripts/download-vscode.js [version]
10+
*
11+
* The version defaults to the minimum VS Code version from engines.vscode in
12+
* package.json (e.g. "^1.110.0" -> "1.110.0"). Pass "stable" or an explicit
13+
* version to override.
14+
*/
15+
16+
import { readFileSync } from 'node:fs';
17+
import { downloadAndUnzipVSCode } from '@vscode/test-electron';
18+
19+
function getEnginesVscodeVersion() {
20+
const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf-8'));
21+
const range = pkg.engines?.vscode;
22+
if (range) {
23+
const match = range.match(/(\d+\.\d+\.\d+)/);
24+
if (match) return match[1];
25+
}
26+
return 'stable';
27+
}
28+
29+
const version = process.argv[2] || getEnginesVscodeVersion();
30+
31+
console.log(`Downloading VS Code (${version}) for integration tests...`);
32+
33+
try {
34+
const vscodeExecutablePath = await downloadAndUnzipVSCode(version);
35+
console.log(`✅ VS Code downloaded to: ${vscodeExecutablePath}`);
36+
} catch (error) {
37+
console.error(
38+
'❌ Failed to download VS Code:',
39+
error instanceof Error ? error.message : String(error),
40+
);
41+
process.exit(1);
42+
}

0 commit comments

Comments
 (0)