Skip to content

Commit b76af6a

Browse files
Squash commits for JB integration testing
1 parent d2d3c30 commit b76af6a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2466
-1947
lines changed

.github/workflows/pr_checks.yaml

+105
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
branches:
1515
- main
1616
paths:
17+
- "extensions/intellij/**"
1718
- "extensions/vscode/**"
1819
- "core/**"
1920
- "gui/**"
@@ -293,3 +294,107 @@ jobs:
293294
run: |
294295
cd gui
295296
npm test
297+
298+
jetbrains-tests:
299+
needs: [install-root, core-checks]
300+
runs-on: ubuntu-latest
301+
steps:
302+
- uses: actions/checkout@v4
303+
304+
- uses: actions/cache@v4
305+
with:
306+
path: core/node_modules
307+
key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
308+
309+
- name: Setup Java
310+
uses: actions/[email protected]
311+
with:
312+
distribution: zulu
313+
java-version: 17
314+
315+
- name: Setup FFmpeg
316+
uses: AnimMouse/setup-ffmpeg@v1
317+
with:
318+
token: ${{ secrets.GITHUB_TOKEN }}
319+
320+
- name: Setup Gradle
321+
uses: gradle/actions/setup-gradle@v3
322+
323+
- name: Use Node.js from .nvmrc
324+
uses: actions/setup-node@v4
325+
with:
326+
node-version-file: ".nvmrc"
327+
328+
- uses: actions/cache@v4
329+
id: gui-cache
330+
with:
331+
path: gui/node_modules
332+
key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }}
333+
334+
- name: Build GUI
335+
run: |
336+
cd gui
337+
npm ci
338+
npm run build
339+
340+
- name: Run prepackage script
341+
run: |
342+
cd extensions/vscode
343+
npm ci
344+
npm run prepackage
345+
env:
346+
# https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333
347+
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
348+
349+
- uses: actions/cache@v4
350+
id: binary-cache
351+
with:
352+
path: binary/node_modules
353+
key: ${{ runner.os }}-binary-node-modules-${{ hashFiles('binary/package-lock.json') }}
354+
355+
- name: Build the binaries
356+
run: |
357+
cd binary
358+
npm run build
359+
360+
- name: Start test IDE
361+
run: |
362+
cd extensions/intellij
363+
export DISPLAY=:99.0
364+
Xvfb -ac :99 -screen 0 1920x1080x24 &
365+
sleep 10
366+
mkdir -p build/reports
367+
./gradlew runIdeForUiTests &
368+
369+
- name: Wait for JB connection
370+
uses: jtalk/url-health-check-action@v3
371+
with:
372+
url: http://127.0.0.1:8082
373+
max-attempts: 15
374+
retry-delay: 30s
375+
376+
- name: Run tests
377+
run: |
378+
cd extensions/intellij
379+
export DISPLAY=:99.0
380+
./gradlew test
381+
382+
- name: Move video
383+
if: ${{ failure() }}
384+
run: |
385+
cd extensions/intellij
386+
mv video build/reports
387+
388+
- name: Copy logs
389+
if: ${{ failure() }}
390+
run: |
391+
cd extensions/intellij
392+
mv build/idea-sandbox/system/log/ build/reports
393+
394+
- name: Save fails report
395+
if: ${{ failure() }}
396+
uses: actions/upload-artifact@v4
397+
with:
398+
name: jb-failure-report
399+
path: |
400+
${{ github.workspace }}/extensions/intellij/build/reports

.idea/jarRepositories.xml

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.vscode/settings.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@
3434
"extensions/vscode/tag-qry/**": true,
3535
"extensions/vscode/textmate-syntaxes/**": true,
3636
"extensions/vscode/tree-sitter/**": true,
37-
"gui/dist/**": true
37+
"gui/dist/**": true,
38+
"extensions/vscode/e2e/.test-extensions": true,
39+
"extensions/vscode/e2e/_output": true,
40+
"extensions/vscode/e2e/storage": true,
41+
"extensions/vscode/e2e/vsix": true,
42+
"extensions/.continue-debug": true
3843
// "sync/**": true
3944
},
4045
"eslint.workingDirectories": ["./core"]

binary/build.js

+21-15
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,22 @@ async function installNodeModuleInTempDirAndCopyToCurrent(packageName, toCopy) {
118118
}
119119

120120
(async () => {
121+
// Informs of where to look for node_sqlite3.node https://www.npmjs.com/package/bindings#:~:text=The%20searching%20for,file%20is%20found
122+
// This is only needed for our `pkg` command
123+
fs.writeFileSync(
124+
"out/package.json",
125+
JSON.stringify(
126+
{
127+
name: "binary",
128+
version: "1.0.0",
129+
author: "Continue Dev, Inc",
130+
license: "Apache-2.0",
131+
},
132+
undefined,
133+
2,
134+
),
135+
);
136+
121137
console.log("[info] Downloading prebuilt lancedb...");
122138
for (const target of targets) {
123139
if (targetToLanceDb[target]) {
@@ -236,21 +252,6 @@ async function installNodeModuleInTempDirAndCopyToCurrent(packageName, toCopy) {
236252
execCmdSync(`curl -L -o ${targetDir}/build.tar.gz ${downloadUrl}`);
237253
execCmdSync(`cd ${targetDir} && tar -xvzf build.tar.gz`);
238254

239-
// Informs of where to look for node_sqlite3.node https://www.npmjs.com/package/bindings#:~:text=The%20searching%20for,file%20is%20found
240-
fs.writeFileSync(
241-
`${targetDir}/package.json`,
242-
JSON.stringify(
243-
{
244-
name: "binary",
245-
version: "1.0.0",
246-
author: "Continue Dev, Inc",
247-
license: "Apache-2.0",
248-
},
249-
undefined,
250-
2,
251-
),
252-
);
253-
254255
// Copy to build directory for testing
255256
try {
256257
const [platform, arch] = target.split("-");
@@ -275,6 +276,11 @@ async function installNodeModuleInTempDirAndCopyToCurrent(packageName, toCopy) {
275276
);
276277
}
277278

279+
// Our dummy `package.json` is no longer needed so we can remove it.
280+
// If it isn't removed, then running locally via `node out/index.js` will fail
281+
// with a `Failed to locate bindings` error
282+
fs.unlinkSync("out/package.json");
283+
278284
const pathsToVerify = [];
279285
for (target of targets) {
280286
const exe = target.startsWith("win") ? ".exe" : "";

binary/pkgJson/darwin-arm64/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"../../out/tree-sitter-wasms/*",
1414
"../../out/llamaTokenizer.mjs",
1515
"../../out/llamaTokenizerWorkerPool.mjs",
16-
"../../out/tiktokenWorkerPool.mjs"
16+
"../../out/tiktokenWorkerPool.mjs",
17+
"../../out/package.json"
1718
],
1819
"targets": [
1920
"node18-macos-arm64"

binary/pkgJson/darwin-x64/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"../../out/tree-sitter-wasms/*",
1414
"../../out/llamaTokenizer.mjs",
1515
"../../out/llamaTokenizerWorkerPool.mjs",
16-
"../../out/tiktokenWorkerPool.mjs"
16+
"../../out/tiktokenWorkerPool.mjs",
17+
"../../out/package.json"
1718
],
1819
"targets": [
1920
"node18-macos-x64"

binary/pkgJson/linux-arm64/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"../../out/tree-sitter-wasms/*",
1414
"../../out/llamaTokenizer.mjs",
1515
"../../out/llamaTokenizerWorkerPool.mjs",
16-
"../../out/tiktokenWorkerPool.mjs"
16+
"../../out/tiktokenWorkerPool.mjs",
17+
"../../out/package.json"
1718
],
1819
"targets": [
1920
"node18-linux-arm64"

binary/pkgJson/linux-x64/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"../../out/tree-sitter-wasms/*",
1414
"../../out/llamaTokenizer.mjs",
1515
"../../out/llamaTokenizerWorkerPool.mjs",
16-
"../../out/tiktokenWorkerPool.mjs"
16+
"../../out/tiktokenWorkerPool.mjs",
17+
"../../out/package.json"
1718
],
1819
"targets": [
1920
"node18-linux-x64"

binary/pkgJson/win32-arm64/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"../../node_modules/win-ca/lib/roots.exe",
1717
"../../out/llamaTokenizer.mjs",
1818
"../../out/llamaTokenizerWorkerPool.mjs",
19-
"../../out/tiktokenWorkerPool.mjs"
19+
"../../out/tiktokenWorkerPool.mjs",
20+
"../../out/package.json"
2021
],
2122
"targets": [
2223
"node18-win-arm64"

binary/pkgJson/win32-x64/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"../../node_modules/win-ca/lib/roots.exe",
1717
"../../out/llamaTokenizer.mjs",
1818
"../../out/llamaTokenizerWorkerPool.mjs",
19-
"../../out/tiktokenWorkerPool.mjs"
19+
"../../out/tiktokenWorkerPool.mjs",
20+
"../../out/package.json"
2021
],
2122
"targets": [
2223
"node18-win-x64"

binary/src/index.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,24 @@ program.action(async () => {
2020
let messenger: IMessenger<ToCoreProtocol, FromCoreProtocol>;
2121
if (process.env.CONTINUE_DEVELOPMENT === "true") {
2222
messenger = new TcpMessenger<ToCoreProtocol, FromCoreProtocol>();
23-
console.log("Waiting for connection");
23+
console.log("[binary] Waiting for connection");
2424
await (
2525
messenger as TcpMessenger<ToCoreProtocol, FromCoreProtocol>
2626
).awaitConnection();
27-
console.log("Connected");
27+
console.log("[binary] Connected");
2828
} else {
2929
setupCoreLogging();
3030
// await setupCa();
3131
messenger = new IpcMessenger<ToCoreProtocol, FromCoreProtocol>();
3232
}
3333
const ide = new IpcIde(messenger);
3434
const promptLogsPath = getPromptLogsPath();
35-
const core = new Core(messenger, ide, async (text) => {
35+
36+
new Core(messenger, ide, async (text) => {
3637
fs.appendFileSync(promptLogsPath, text + "\n\n");
3738
});
38-
console.log("Core started");
39+
40+
console.log("[binary] Core started");
3941
} catch (e) {
4042
fs.writeFileSync("./error.log", `${new Date().toISOString()} ${e}\n`);
4143
console.log("Error: ", e);

core/core.ts

-5
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,6 @@ export class Core {
239239
void this.configHandler.reloadConfig();
240240
});
241241

242-
on("config/addOpenAiKey", (msg) => {
243-
addOpenAIKey(msg.data);
244-
void this.configHandler.reloadConfig();
245-
});
246-
247242
on("config/deleteModel", (msg) => {
248243
deleteModel(msg.data.title);
249244
void this.configHandler.reloadConfig();

core/protocol/ideWebview.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@ import type {
1111
} from "../";
1212

1313
export type ToIdeFromWebviewProtocol = ToIdeFromWebviewOrCoreProtocol & {
14-
onLoad: [
15-
undefined,
16-
{
17-
windowId: string;
18-
serverUrl: string;
19-
workspacePaths: string[];
20-
vscMachineId: string;
21-
vscMediaUrl: string;
22-
},
23-
];
2414
openUrl: [string, void];
2515
// We pass the `curSelectedModel` because we currently cannot access the
2616
// default model title in the GUI from JB
@@ -42,8 +32,18 @@ export type ToIdeFromWebviewProtocol = ToIdeFromWebviewOrCoreProtocol & {
4232
toggleFullScreen: [{ newWindow?: boolean } | undefined, void];
4333
insertAtCursor: [{ text: string }, void];
4434
copyText: [{ text: string }, void];
45-
"jetbrains/editorInsetHeight": [{ height: number }, void];
4635
"jetbrains/isOSREnabled": [undefined, boolean];
36+
"jetbrains/onLoad": [
37+
undefined,
38+
{
39+
windowId: string;
40+
serverUrl: string;
41+
workspacePaths: string[];
42+
vscMachineId: string;
43+
vscMediaUrl: string;
44+
},
45+
];
46+
"jetbrains/getColors": [undefined, void];
4747
"vscode/openMoveRightMarkdown": [undefined, void];
4848
setGitHubAuthToken: [{ token: string }, void];
4949
acceptDiff: [{ filepath: string; streamId?: string }, void];

core/protocol/passThrough.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import {
44
} from "./coreWebview.js";
55

66
// Message types to pass through from webview to core
7+
// Note: If updating these values, make a corresponding update in
8+
// extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt
79
export const WEBVIEW_TO_CORE_PASS_THROUGH: (keyof ToCoreFromWebviewProtocol)[] =
810
[
911
"ping",
@@ -13,13 +15,11 @@ export const WEBVIEW_TO_CORE_PASS_THROUGH: (keyof ToCoreFromWebviewProtocol)[] =
1315
"history/load",
1416
"history/save",
1517
"devdata/log",
16-
"config/addOpenAiKey",
1718
"config/addModel",
1819
"config/newPromptFile",
1920
"config/ideSettingsUpdate",
2021
"config/getSerializedProfileInfo",
2122
"config/deleteModel",
22-
"config/reload",
2323
"config/listProfiles",
2424
"config/openProfile",
2525
"context/getContextItems",

extensions/intellij/.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ src/main/resources/webview
22
!src/main/resources/webview/index.html
33
src/main/resources/bin
44
src/main/resources/config_schema.json
5-
src/main/resources/continue_rc_schema.json
5+
src/main/resources/continue_rc_schema.json
6+
video

extensions/intellij/.run/Run Tests.run.xml

-24
This file was deleted.

0 commit comments

Comments
 (0)