Skip to content

Commit cb07f64

Browse files
authored
Merge branch 'main' into fsinfront
2 parents 43d26d1 + db952ef commit cb07f64

Some content is hidden

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

53 files changed

+804
-692
lines changed

.github/workflows/pr_checks.yaml

Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: PR checks
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
branches:
66
- main
77
paths:
@@ -22,21 +22,10 @@ on:
2222
- ".github/workflows/**"
2323

2424
jobs:
25-
validate-pr:
26-
runs-on: ubuntu-latest
27-
environment: tests-requiring-secrets
28-
steps:
29-
- uses: actions/checkout@v4
30-
3125
install-root:
32-
needs: validate-pr
3326
runs-on: ubuntu-latest
3427
steps:
3528
- uses: actions/checkout@v4
36-
with:
37-
ref: ${{ github.event.pull_request.head.sha }}
38-
# This is important - it switches from the base repo to the fork
39-
repository: ${{ github.event.pull_request.head.repo.full_name }}
4029

4130
- uses: actions/setup-node@v4
4231
with:
@@ -57,9 +46,6 @@ jobs:
5746
runs-on: ubuntu-latest
5847
steps:
5948
- uses: actions/checkout@v4
60-
with:
61-
ref: ${{ github.event.pull_request.head.sha }}
62-
repository: ${{ github.event.pull_request.head.repo.full_name }}
6349

6450
- uses: actions/setup-node@v4
6551
with:
@@ -86,12 +72,8 @@ jobs:
8672
core-checks:
8773
needs: install-core
8874
runs-on: ubuntu-latest
89-
environment: tests-requiring-secrets
9075
steps:
9176
- uses: actions/checkout@v4
92-
with:
93-
ref: ${{ github.event.pull_request.head.sha }}
94-
repository: ${{ github.event.pull_request.head.repo.full_name }}
9577

9678
- uses: actions/setup-node@v4
9779
with:
@@ -122,9 +104,6 @@ jobs:
122104
runs-on: ubuntu-latest
123105
steps:
124106
- uses: actions/checkout@v4
125-
with:
126-
ref: ${{ github.event.pull_request.head.sha }}
127-
repository: ${{ github.event.pull_request.head.repo.full_name }}
128107

129108
- uses: actions/setup-node@v4
130109
with:
@@ -157,9 +136,6 @@ jobs:
157136
runs-on: ubuntu-latest
158137
steps:
159138
- uses: actions/checkout@v4
160-
with:
161-
ref: ${{ github.event.pull_request.head.sha }}
162-
repository: ${{ github.event.pull_request.head.repo.full_name }}
163139

164140
- uses: actions/setup-node@v4
165141
with:
@@ -191,9 +167,6 @@ jobs:
191167
runs-on: ubuntu-latest
192168
steps:
193169
- uses: actions/checkout@v4
194-
with:
195-
ref: ${{ github.event.pull_request.head.sha }}
196-
repository: ${{ github.event.pull_request.head.repo.full_name }}
197170

198171
- uses: actions/setup-node@v4
199172
with:
@@ -231,9 +204,6 @@ jobs:
231204
runs-on: ubuntu-latest
232205
steps:
233206
- uses: actions/checkout@v4
234-
with:
235-
ref: ${{ github.event.pull_request.head.sha }}
236-
repository: ${{ github.event.pull_request.head.repo.full_name }}
237207

238208
- uses: actions/setup-node@v4
239209
with:
@@ -268,9 +238,6 @@ jobs:
268238
runs-on: ubuntu-latest
269239
steps:
270240
- uses: actions/checkout@v4
271-
with:
272-
ref: ${{ github.event.pull_request.head.sha }}
273-
repository: ${{ github.event.pull_request.head.repo.full_name }}
274241

275242
- uses: actions/setup-node@v4
276243
with:
@@ -303,9 +270,6 @@ jobs:
303270
runs-on: ubuntu-latest
304271
steps:
305272
- uses: actions/checkout@v4
306-
with:
307-
ref: ${{ github.event.pull_request.head.sha }}
308-
repository: ${{ github.event.pull_request.head.repo.full_name }}
309273

310274
- uses: actions/setup-node@v4
311275
with:
@@ -321,6 +285,7 @@ jobs:
321285
cd core
322286
npm test
323287
env:
288+
IGNORE_API_KEY_TESTS: ${{ github.event.pull_request.head.repo.fork }}
324289
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
325290
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
326291
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
@@ -333,9 +298,6 @@ jobs:
333298
test_file_matrix: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}
334299
steps:
335300
- uses: actions/checkout@v4
336-
with:
337-
ref: ${{ github.event.pull_request.head.sha }}
338-
repository: ${{ github.event.pull_request.head.repo.full_name }}
339301

340302
- name: Cache node modules
341303
uses: actions/cache@v3
@@ -363,9 +325,6 @@ jobs:
363325
needs: [install-vscode, install-core]
364326
steps:
365327
- uses: actions/checkout@v4
366-
with:
367-
ref: ${{ github.event.pull_request.head.sha }}
368-
repository: ${{ github.event.pull_request.head.repo.full_name }}
369328

370329
- uses: actions/setup-node@v4
371330
with:
@@ -399,9 +358,6 @@ jobs:
399358
needs: [install-vscode, install-core]
400359
steps:
401360
- uses: actions/checkout@v4
402-
with:
403-
ref: ${{ github.event.pull_request.head.sha }}
404-
repository: ${{ github.event.pull_request.head.repo.full_name }}
405361

406362
- uses: actions/setup-node@v4
407363
with:
@@ -443,17 +399,13 @@ jobs:
443399
]
444400
runs-on: ubuntu-latest
445401
# Tests requiring secrets need approval from maintainers
446-
environment: tests-requiring-secrets
447402
strategy:
448403
fail-fast: false
449404
matrix:
450405
test_file: ${{ fromJson(needs.vscode-get-test-file-matrix.outputs.test_file_matrix) }}
451406
command: ["e2e:ci:run", "e2e:ci:run-yaml"]
452407
steps:
453408
- uses: actions/checkout@v4
454-
with:
455-
ref: ${{ github.event.pull_request.head.sha }}
456-
repository: ${{ github.event.pull_request.head.repo.full_name }}
457409

458410
- uses: actions/setup-node@v4
459411
with:
@@ -492,6 +444,7 @@ jobs:
492444
chmod 600 ~/.ssh/id_rsa
493445
ssh-keyscan -H "$SSH_HOST" >> ~/.ssh/known_hosts
494446
echo -e "Host ssh-test-container\n\tHostName $SSH_HOST\n\tUser ec2-user\n\tIdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config
447+
if: ${{ github.event.pull_request.head.repo.fork == false }}
495448

496449
- name: Set up Xvfb
497450
run: |
@@ -501,7 +454,7 @@ jobs:
501454
- name: Run e2e tests
502455
run: |
503456
cd extensions/vscode
504-
TEST_FILE="${{ matrix.test_file }}" npm run ${{ matrix.command }}
457+
IGNORE_SSH_TESTS="${{ github.event.pull_request.head.repo.fork }}" TEST_FILE="${{ matrix.test_file }}" npm run ${{ matrix.command }}
505458
env:
506459
DISPLAY: :99
507460

@@ -517,9 +470,6 @@ jobs:
517470
runs-on: ubuntu-latest
518471
steps:
519472
- uses: actions/checkout@v4
520-
with:
521-
ref: ${{ github.event.pull_request.head.sha }}
522-
repository: ${{ github.event.pull_request.head.repo.full_name }}
523473

524474
- uses: actions/setup-node@v4
525475
with:
@@ -552,10 +502,6 @@ jobs:
552502
runs-on: ubuntu-latest
553503
steps:
554504
- uses: actions/checkout@v4
555-
with:
556-
ref: ${{ github.event.pull_request.head.sha }}
557-
repository: ${{ github.event.pull_request.head.repo.full_name }}
558-
559505
- uses: actions/cache@v4
560506
with:
561507
path: core/node_modules

SECURITY.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
If you discover a security vulnerability, please do not open a public issue. Instead, please report it by emailing [email protected]. We will be highly responsive to all security concerns and ask that you give us sufficient time to investigate and address the vulnerability before disclosing it publicly.
6+
7+
Please include the following details in your report:
8+
9+
- A description of the vulnerability
10+
- Steps to reproduce the issue
11+
- Your assessment of the potential impact
12+
- Any possible mitigations
13+
14+
## Contact
15+
16+
For any other questions or concerns related to security, please contact us at [email protected].

binary/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/autocomplete/CompletionProvider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ export class CompletionProvider {
246246
completionOptions,
247247
cacheHit,
248248
filepath: helper.filepath,
249+
numLines: completion.split("\n").length,
249250
completionId: helper.input.completionId,
250251
gitRepo: await this.ide.getRepoName(helper.filepath),
251252
uniqueId: await this.ide.getUniqueId(),

core/autocomplete/util/types.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
import {
2-
Position,
3-
Range,
4-
RangeInFile,
5-
RangeInFileWithContents,
6-
TabAutocompleteOptions,
7-
} from "../..";
1+
import { Position, Range, RangeInFile, TabAutocompleteOptions } from "../..";
82
import { AutocompleteCodeSnippet } from "../snippets/types";
93

104
export type RecentlyEditedRange = RangeInFile & {
@@ -42,6 +36,7 @@ export interface AutocompleteOutcome extends TabAutocompleteOptions {
4236
modelName: string;
4337
completionOptions: any;
4438
cacheHit: boolean;
39+
numLines: number;
4540
filepath: string;
4641
gitRepo?: string;
4742
completionId: string;

core/config/ConfigHandler.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
import * as fs from "node:fs";
22

3+
import {
4+
AssistantUnrolled,
5+
ConfigResult,
6+
FullSlug,
7+
} from "@continuedev/config-yaml";
8+
import * as YAML from "yaml";
9+
310
import {
411
ControlPlaneClient,
512
ControlPlaneSessionInfo,
613
} from "../control-plane/client.js";
14+
import { getControlPlaneEnv, useHub } from "../control-plane/env.js";
715
import {
816
BrowserSerializedContinueConfig,
917
ContinueConfig,
@@ -15,15 +23,8 @@ import {
1523
import Ollama from "../llm/llms/Ollama.js";
1624
import { GlobalContext } from "../util/GlobalContext.js";
1725
import { getConfigJsonPath, getConfigYamlPath } from "../util/paths.js";
18-
19-
import {
20-
AssistantUnrolled,
21-
ConfigResult,
22-
FullSlug,
23-
} from "@continuedev/config-yaml";
24-
import * as YAML from "yaml";
25-
import { getControlPlaneEnv, useHub } from "../control-plane/env.js";
2626
import { localPathToUri } from "../util/pathToUri.js";
27+
2728
import {
2829
LOCAL_ONBOARDING_CHAT_MODEL,
2930
ONBOARDING_LOCAL_MODEL_TITLE,
@@ -135,6 +136,7 @@ export class ConfigHandler {
135136
{ ...assistant.configResult, config: renderedConfig },
136137
assistant.ownerSlug,
137138
assistant.packageSlug,
139+
assistant.iconUrl,
138140
assistant.configResult.config?.version ?? "latest",
139141
this.controlPlaneClient,
140142
this.ide,
@@ -336,11 +338,11 @@ export class ConfigHandler {
336338
this.updateListeners.push(listener);
337339
}
338340

339-
async reloadConfig() {
341+
async reloadConfig(additionalContextProviders: IContextProvider[] = []) {
340342
// TODO: this isn't right, there are two different senses in which you want to "reload"
341343

342344
const { config, errors, configLoadInterrupted } =
343-
await this.currentProfile.reloadConfig();
345+
await this.currentProfile.reloadConfig(additionalContextProviders);
344346

345347
if (config) {
346348
this.inactiveProfiles.forEach((profile) => profile.clearConfig());
@@ -390,6 +392,6 @@ export class ConfigHandler {
390392

391393
registerCustomContextProvider(contextProvider: IContextProvider) {
392394
this.additionalContextProviders.push(contextProvider);
393-
void this.reloadConfig();
395+
void this.reloadConfig(this.additionalContextProviders);
394396
}
395397
}

core/config/ProfileLifecycleManager.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
ConfigValidationError,
44
FullSlug,
55
} from "@continuedev/config-yaml";
6+
67
import {
78
BrowserSerializedContinueConfig,
89
ContinueConfig,
@@ -18,9 +19,16 @@ export interface ProfileDescription {
1819
profileType: "control-plane" | "local" | "platform";
1920
title: string;
2021
id: string;
22+
iconUrl: string;
2123
errors: ConfigValidationError[] | undefined;
2224
}
2325

26+
export interface OrganizationDescription {
27+
id: string;
28+
iconUrl: string;
29+
name: string;
30+
}
31+
2432
export class ProfileLifecycleManager {
2533
private savedConfigResult: ConfigResult<ContinueConfig> | undefined;
2634
private savedBrowserConfigResult?: ConfigResult<BrowserSerializedContinueConfig>;
@@ -42,12 +50,12 @@ export class ProfileLifecycleManager {
4250
}
4351

4452
// Clear saved config and reload
45-
async reloadConfig(): Promise<ConfigResult<ContinueConfig>> {
53+
async reloadConfig(additionalContextProviders: IContextProvider[] = []): Promise<ConfigResult<ContinueConfig>> {
4654
this.savedConfigResult = undefined;
4755
this.savedBrowserConfigResult = undefined;
4856
this.pendingConfigPromise = undefined;
4957

50-
return this.loadConfig([], true);
58+
return this.loadConfig(additionalContextProviders, true);
5159
}
5260

5361
async loadConfig(

core/config/profile/ControlPlaneProfileLoader.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ConfigJson } from "@continuedev/config-types";
2+
import { ConfigResult } from "@continuedev/config-yaml";
23

34
import { ControlPlaneClient } from "../../control-plane/client.js";
45
import {
@@ -7,9 +8,8 @@ import {
78
IdeSettings,
89
SerializedContinueConfig,
910
} from "../../index.js";
10-
11-
import { ConfigResult } from "@continuedev/config-yaml";
1211
import { ProfileDescription } from "../ProfileLifecycleManager.js";
12+
1313
import doLoadConfig from "./doLoadConfig.js";
1414
import { IProfileLoader } from "./IProfileLoader.js";
1515

@@ -32,6 +32,7 @@ export default class ControlPlaneProfileLoader implements IProfileLoader {
3232
this.description = {
3333
id: workspaceId,
3434
profileType: "control-plane",
35+
iconUrl: "",
3536
fullSlug: {
3637
ownerSlug: "",
3738
packageSlug: "",

0 commit comments

Comments
 (0)