Skip to content

Commit 175f8ea

Browse files
committed
Merge remote-tracking branch 'origin/main' into koesie10/split-remote-query-flows
2 parents 65641e3 + 8b360f3 commit 175f8ea

File tree

7 files changed

+24
-11
lines changed

7 files changed

+24
-11
lines changed

extensions/ql-vscode/package-lock.json

Lines changed: 1 addition & 0 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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,7 @@
14211421
"proxyquire": "~2.1.3",
14221422
"sinon": "~14.0.0",
14231423
"sinon-chai": "~3.5.0",
1424+
"tar-stream": "^2.2.0",
14241425
"through2": "^4.0.2",
14251426
"ts-jest": "^29.0.1",
14261427
"ts-json-schema-generator": "^1.1.2",

extensions/ql-vscode/src/databases/ui/db-tree-view-item.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
export class DbTreeViewItem extends vscode.TreeItem {
1717
constructor(
1818
public readonly dbItem: DbItem | undefined,
19-
public readonly iconPath: vscode.ThemeIcon | undefined,
19+
public readonly icon: vscode.ThemeIcon | undefined,
2020
public readonly label: string,
2121
public readonly tooltip: string | undefined,
2222
public readonly collapsibleState: vscode.TreeItemCollapsibleState,

extensions/ql-vscode/src/pure/date.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
* Contains an assortment of helper constants and functions for working with dates.
33
*/
44

5-
const dateWithoutYearFormatter = new Intl.DateTimeFormat(undefined, {
5+
const dateWithoutYearFormatter = new Intl.DateTimeFormat('en-US', {
66
month: 'short',
77
day: 'numeric',
88
hour: 'numeric',
99
minute: '2-digit',
1010
});
1111

12-
const dateFormatter = new Intl.DateTimeFormat(undefined, {
12+
const dateFormatter = new Intl.DateTimeFormat('en-US', {
1313
year: 'numeric',
1414
month: 'short',
1515
day: 'numeric',

extensions/ql-vscode/src/remote-queries/run-remote-query.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { RequestError } from '@octokit/types/dist-types';
1919
import { QueryMetadata } from '../pure/interface-types';
2020
import { REPO_REGEX } from '../pure/helpers-pure';
2121
import * as ghApiClient from './gh-api/gh-api-client';
22-
import { getRepositorySelection, isValidSelection } from './repository-selection';
22+
import { getRepositorySelection, isValidSelection, RepositorySelection } from './repository-selection';
2323
import { Repository } from './shared/repository';
2424

2525
export interface QlPack {
@@ -166,13 +166,24 @@ async function getPackedBundlePath(queryPackDir: string) {
166166
});
167167
}
168168

169+
export interface PreparedRemoteQuery {
170+
actionBranch: string;
171+
base64Pack: string;
172+
repoSelection: RepositorySelection;
173+
queryFile: string;
174+
queryMetadata: QueryMetadata | undefined;
175+
controllerRepo: Repository;
176+
queryStartTime: number;
177+
language: string;
178+
}
179+
169180
export async function prepareRemoteQueryRun(
170181
cliServer: cli.CodeQLCliServer,
171182
credentials: Credentials,
172183
uri: Uri | undefined,
173184
progress: ProgressCallback,
174185
token: CancellationToken,
175-
) {
186+
): Promise<PreparedRemoteQuery> {
176187
if (!(await cliServer.cliConstraints.supportsRemoteQueries())) {
177188
throw new Error(`Variant analysis is not supported by this version of CodeQL. Please upgrade to v${cli.CliVersionConstraint.CLI_VERSION_REMOTE_QUERIES
178189
} or later.`);

extensions/ql-vscode/src/vscode-tests/minimal-workspace/databases/db-panel.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ describe('db panel', async () => {
214214
): void {
215215
expect(item.label).to.equal(`Top ${n} repositories`);
216216
expect(item.tooltip).to.equal(`Top ${n} repositories of a language`);
217-
expect(item.iconPath).to.deep.equal(new vscode.ThemeIcon('github'));
217+
expect(item.icon).to.deep.equal(new vscode.ThemeIcon('github'));
218218
expect(item.collapsibleState).to.equal(vscode.TreeItemCollapsibleState.None);
219219
}
220220

@@ -225,7 +225,7 @@ describe('db panel', async () => {
225225
): void {
226226
expect(item.label).to.equal(listName);
227227
expect(item.tooltip).to.be.undefined;
228-
expect(item.iconPath).to.be.undefined;
228+
expect(item.icon).to.be.undefined;
229229
expect(item.collapsibleState).to.equal(vscode.TreeItemCollapsibleState.Collapsed);
230230
expect(item.children).to.be.ok;
231231
expect(item.children.length).to.equal(repos.length);
@@ -241,7 +241,7 @@ describe('db panel', async () => {
241241
): void {
242242
expect(item.label).to.equal(ownerName);
243243
expect(item.tooltip).to.be.undefined;
244-
expect(item.iconPath).to.deep.equal(new vscode.ThemeIcon('organization'));
244+
expect(item.icon).to.deep.equal(new vscode.ThemeIcon('organization'));
245245
expect(item.collapsibleState).to.equal(vscode.TreeItemCollapsibleState.None);
246246
expect(item.children).to.be.ok;
247247
expect(item.children.length).to.equal(0);
@@ -253,7 +253,7 @@ describe('db panel', async () => {
253253
): void {
254254
expect(item.label).to.equal(repoName);
255255
expect(item.tooltip).to.be.undefined;
256-
expect(item.iconPath).to.deep.equal(new vscode.ThemeIcon('database'));
256+
expect(item.icon).to.deep.equal(new vscode.ThemeIcon('database'));
257257
expect(item.collapsibleState).to.equal(vscode.TreeItemCollapsibleState.None);
258258
}
259259
});

extensions/ql-vscode/src/vscode-tests/utils/bundled-pack-helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface QueryPackFS {
1010
directoryContents: (name: string) => string[];
1111
}
1212

13-
export const readBundledPack = async (base64Pack: string): Promise<QueryPackFS> => {
13+
export async function readBundledPack(base64Pack: string): Promise<QueryPackFS> {
1414
const buffer = Buffer.from(base64Pack, 'base64');
1515
const stream = Readable.from(buffer);
1616

@@ -73,4 +73,4 @@ export const readBundledPack = async (base64Pack: string): Promise<QueryPackFS>
7373
.map(dir => dir.substring(name.length + 1));
7474
},
7575
};
76-
};
76+
}

0 commit comments

Comments
 (0)