Skip to content

Commit fa12671

Browse files
committed
Merge remote-tracking branch 'origin/main' into koesie10/improve-skeleton-db-download
2 parents 8a87db6 + 407825e commit fa12671

File tree

26 files changed

+963
-612
lines changed

26 files changed

+963
-612
lines changed

.github/workflows/cli-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- name: Checkout
6161
uses: actions/checkout@v4
6262

63-
- uses: actions/setup-node@v3
63+
- uses: actions/setup-node@v4
6464
with:
6565
node-version-file: extensions/ql-vscode/.nvmrc
6666
cache: 'npm'

.github/workflows/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
with:
2121
fetch-depth: 1
2222

23-
- uses: actions/setup-node@v3
23+
- uses: actions/setup-node@v4
2424
with:
2525
node-version-file: extensions/ql-vscode/.nvmrc
2626
cache: 'npm'
@@ -62,7 +62,7 @@ jobs:
6262
with:
6363
fetch-depth: 1
6464

65-
- uses: actions/setup-node@v3
65+
- uses: actions/setup-node@v4
6666
with:
6767
node-version-file: extensions/ql-vscode/.nvmrc
6868
cache: 'npm'
@@ -110,7 +110,7 @@ jobs:
110110
with:
111111
fetch-depth: 1
112112

113-
- uses: actions/setup-node@v3
113+
- uses: actions/setup-node@v4
114114
with:
115115
node-version-file: extensions/ql-vscode/.nvmrc
116116
cache: 'npm'
@@ -149,7 +149,7 @@ jobs:
149149
with:
150150
fetch-depth: 1
151151

152-
- uses: actions/setup-node@v3
152+
- uses: actions/setup-node@v4
153153
with:
154154
node-version-file: extensions/ql-vscode/.nvmrc
155155
cache: 'npm'
@@ -183,7 +183,7 @@ jobs:
183183
with:
184184
fetch-depth: 1
185185

186-
- uses: actions/setup-node@v3
186+
- uses: actions/setup-node@v4
187187
with:
188188
node-version-file: extensions/ql-vscode/.nvmrc
189189
cache: 'npm'
@@ -251,7 +251,7 @@ jobs:
251251
- name: Checkout
252252
uses: actions/checkout@v4
253253

254-
- uses: actions/setup-node@v3
254+
- uses: actions/setup-node@v4
255255
with:
256256
node-version-file: extensions/ql-vscode/.nvmrc
257257
cache: 'npm'

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Checkout
2121
uses: actions/checkout@v4
2222

23-
- uses: actions/setup-node@v3
23+
- uses: actions/setup-node@v4
2424
with:
2525
node-version-file: extensions/ql-vscode/.nvmrc
2626

docs/test-plan.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,14 @@ Run one of the above MRVAs, but cancel it from within VS Code:
152152
- Check that the editor loads and shows methods to model.
153153
- Check that methods are grouped per library (e.g. `rocksdbjni@7.7.3` or `asm@6.0`)
154154
- Check that the "Open database" link works.
155+
- Check that the 'View' button works and the Method Usage panel highlight the correct method and usage
156+
- Check that the Method Modeling panel shows the correct method and modeling state
155157

156158
#### Test Case 2: Model methods
157159

158160
1. Expand one of the libraries.
159161
- Change the model type and check that the other dropdowns change.
162+
- Check that the method modeling panel updates accordingly
160163
2. Save the modeled methods.
161164
3. Click "Open extension pack"
162165
- Check that the file explorer opens a directory with a "models" directory
@@ -189,9 +192,28 @@ Are there any components that are not showing up?
189192

190193
## Optional Test Cases
191194

192-
These are mostly aimed at MRVA, but some of them are also applicable to non-MRVA queries.
193-
194-
### Selecting repositories to run on
195+
### Modeling Flow
196+
197+
1. Check that a method can have multiple models:
198+
- Add a couple of new models for one method in the model editor
199+
- Save and check that the modeling file (use the 'open extension pack' button to open it) shows multiple methods
200+
- Check that the Method Modeling Panel shows the correct multiple models
201+
- Check that you can browse through different models in the Method Modeling Panel
202+
- Check that a 'duplicated classification' error appears in both model editor and modeling panel when a duplicate modeling occurs
203+
- Check that a 'conflicting classification' error appears when a neutral model type is paired with a model of the same kind
204+
- Check that clicking on the error highlights the correct modeling in both the editor and the modeling panel
205+
2. Check the Method Usage Panel
206+
- Check that the Method Usage Panel opens and jumps to the correct usage when clicking on 'View' in the model editor
207+
- Check that the first and following usages are opening when clicking on a usage
208+
- Check that the usage icon color turns green when saving a newly modeled method
209+
- Check that the usage icon color turns red when saving a newly unmodeld method
210+
3. Check the Method Modeling Panel
211+
- Check that the 'Start modeling' button opens a new model editor
212+
- Check that it refreshes the blank state when a model editor is opened/closed
213+
- Check that when modeling in the editor the modeling panel updates accordingly
214+
- Check that when modeling in the modeling panel the model editor updates accordingly
215+
216+
### Selecting MRVA repositories to run on
195217

196218
#### Test case 1: Running a query on a single repository
197219

@@ -221,7 +243,7 @@ These are mostly aimed at MRVA, but some of them are also applicable to non-MRVA
221243
4. The org contains private repositories that are inaccessible
222244
2. The org does not exist
223245

224-
### Using different types of controller repos
246+
### Using different types of controller repos for MRVA
225247

226248
#### Test case 1: Running a query when the controller repository is public
227249

extensions/ql-vscode/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
## [UNRELEASED]
44

5+
## 1.9.3 - 26 October 2023
6+
57
- Sorted result set filenames now include a hash of the result set name instead of the full name. [#2955](https://github.com/github/vscode-codeql/pull/2955)
68
- The "Install Pack Dependencies" will now only list CodeQL packs located in the workspace. [#2960](https://github.com/github/vscode-codeql/pull/2960)
79
- Fix a bug where the "View Query Log" action for a query history item was not working. [#2984](https://github.com/github/vscode-codeql/pull/2984)
810
- Add a command to sort items in the databases view by language. [#2993](https://github.com/github/vscode-codeql/pull/2993)
911
- Fix not being able to open the results directory or evaluator log for a cancelled local query run. [#2996](https://github.com/github/vscode-codeql/pull/2996)
12+
- Fix empty row in alert path when the SARIF location was empty. [#3018](https://github.com/github/vscode-codeql/pull/3018)
1013

1114
## 1.9.2 - 12 October 2023
1215

extensions/ql-vscode/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/ql-vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "CodeQL for Visual Studio Code",
55
"author": "GitHub",
66
"private": true,
7-
"version": "1.9.3",
7+
"version": "1.9.4",
88
"publisher": "GitHub",
99
"license": "MIT",
1010
"icon": "media/VS-marketplace-CodeQL-icon.png",

extensions/ql-vscode/src/common/sarif-utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as Sarif from "sarif";
22
import type { HighlightedRegion } from "../variant-analysis/shared/analysis-result";
33
import { ResolvableLocationValue } from "../common/bqrs-cli-types";
4+
import { isEmptyPath } from "./bqrs-utils";
45

56
export interface SarifLink {
67
dest: number;
@@ -111,6 +112,9 @@ export function parseSarifLocation(
111112
return { hint: "no artifact location" };
112113
if (physicalLocation.artifactLocation.uri === undefined)
113114
return { hint: "artifact location has no uri" };
115+
if (isEmptyPath(physicalLocation.artifactLocation.uri)) {
116+
return { hint: "artifact location has empty uri" };
117+
}
114118

115119
// This is not necessarily really an absolute uri; it could either be a
116120
// file uri or a relative uri.

extensions/ql-vscode/src/config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,6 @@ const LLM_GENERATION_BATCH_SIZE = new Setting(
707707
MODEL_SETTING,
708708
);
709709
const EXTENSIONS_DIRECTORY = new Setting("extensionsDirectory", MODEL_SETTING);
710-
const SHOW_MULTIPLE_MODELS = new Setting("showMultipleModels", MODEL_SETTING);
711710

712711
export interface ModelConfig {
713712
flowGeneration: boolean;
@@ -744,6 +743,6 @@ export class ModelConfigListener extends ConfigListener implements ModelConfig {
744743
}
745744

746745
public get showMultipleModels(): boolean {
747-
return !!SHOW_MULTIPLE_MODELS.getValue<boolean>();
746+
return isCanary();
748747
}
749748
}

extensions/ql-vscode/src/databases/local-databases/database-manager.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ import {
1919
getFirstWorkspaceFolder,
2020
isFolderAlreadyInWorkspace,
2121
} from "../../common/vscode/workspace-folders";
22-
import { isQueryLanguage } from "../../common/query-language";
22+
import {
23+
isQueryLanguage,
24+
tryGetQueryLanguage,
25+
} from "../../common/query-language";
2326
import { existsSync } from "fs";
2427
import { QlPackGenerator } from "../../local-queries/qlpack-generator";
2528
import { asError, getErrorMessage } from "../../common/helpers-pure";
@@ -30,6 +33,7 @@ import { containsPath } from "../../common/files";
3033
import { DatabaseChangedEvent, DatabaseEventKind } from "./database-events";
3134
import { DatabaseResolver } from "./database-resolver";
3235
import { telemetryListener } from "../../common/vscode/telemetry";
36+
import { LanguageContextStore } from "../../language-context-store";
3337

3438
/**
3539
* The name of the key in the workspaceState dictionary in which we
@@ -100,11 +104,25 @@ export class DatabaseManager extends DisposableObject {
100104
private readonly app: App,
101105
private readonly qs: QueryRunner,
102106
private readonly cli: cli.CodeQLCliServer,
107+
private readonly languageContext: LanguageContextStore,
103108
public logger: Logger,
104109
) {
105110
super();
106111

107112
qs.onStart(this.reregisterDatabases.bind(this));
113+
114+
this.push(
115+
this.languageContext.onLanguageContextChanged(async () => {
116+
if (
117+
this.currentDatabaseItem !== undefined &&
118+
!this.languageContext.isSelectedLanguage(
119+
tryGetQueryLanguage(this.currentDatabaseItem.language),
120+
)
121+
) {
122+
await this.setCurrentDatabaseItem(undefined);
123+
}
124+
}),
125+
);
108126
}
109127

110128
/**

0 commit comments

Comments
 (0)