Merge branch 'main' into robertbrignull/telemetry
This commit is contained in:
2
.github/workflows/cli-test.yml
vendored
2
.github/workflows/cli-test.yml
vendored
@@ -62,7 +62,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16.17.1'
|
||||
node-version: '18.15.0'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: extensions/ql-vscode/package-lock.json
|
||||
|
||||
|
||||
10
.github/workflows/main.yml
vendored
10
.github/workflows/main.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16.17.1'
|
||||
node-version: '18.15.0'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: extensions/ql-vscode/package-lock.json
|
||||
|
||||
@@ -64,7 +64,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16.17.1'
|
||||
node-version: '18.15.0'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: extensions/ql-vscode/package-lock.json
|
||||
|
||||
@@ -113,7 +113,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16.17.1'
|
||||
node-version: '18.15.0'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: extensions/ql-vscode/package-lock.json
|
||||
|
||||
@@ -147,7 +147,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16.17.1'
|
||||
node-version: '18.15.0'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: extensions/ql-vscode/package-lock.json
|
||||
|
||||
@@ -215,7 +215,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16.17.1'
|
||||
node-version: '18.15.0'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: extensions/ql-vscode/package-lock.json
|
||||
|
||||
|
||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16.17.1'
|
||||
node-version: '18.15.0'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
|
||||
@@ -145,8 +145,6 @@ Run one of the above MRVAs, but cancel it from within VS Code:
|
||||
|
||||
### CodeQL Model Editor
|
||||
|
||||
Note the tests here require the feature flag: `codeQL.model.editor`
|
||||
|
||||
#### Test Case 1: Opening the model editor
|
||||
|
||||
1. Download the `sofastack/sofa-jraft` java database from GitHub.
|
||||
|
||||
@@ -1 +1 @@
|
||||
v16.17.1
|
||||
v18.15.0
|
||||
|
||||
@@ -5,7 +5,15 @@ import { action } from "@storybook/addon-actions";
|
||||
// Allow all stories/components to use Codicons
|
||||
import "@vscode/codicons/dist/codicon.css";
|
||||
|
||||
(window as any).acquireVsCodeApi = () => ({
|
||||
import type { VsCodeApi } from "../src/view/vscode-api";
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
acquireVsCodeApi: () => VsCodeApi;
|
||||
}
|
||||
}
|
||||
|
||||
window.acquireVsCodeApi = () => ({
|
||||
postMessage: action("post-vscode-message"),
|
||||
setState: action("set-vscode-state"),
|
||||
});
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
## [UNRELEASED]
|
||||
|
||||
## 1.9.0 - 19 September 2023
|
||||
|
||||
- Release the [CodeQL model editor](https://codeql.github.com/docs/codeql/codeql-for-visual-studio-code/using-the-codeql-model-editor) to create CodeQL model packs for Java frameworks. Open the editor using the "CodeQL: Open CodeQL Model Editor (Beta)" command. [#2823](https://github.com/github/vscode-codeql/pull/2823)
|
||||
|
||||
## 1.8.12 - 11 September 2023
|
||||
|
||||
- Fix a bug where variant analysis queries would fail for queries in the `codeql/java-queries` query pack. [#2786](https://github.com/github/vscode-codeql/pull/2786)
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
} from "fs-extra";
|
||||
import { resolve, join } from "path";
|
||||
import { isDevBuild } from "./dev";
|
||||
import type * as packageJsonType from "../package.json";
|
||||
|
||||
export interface DeployedPackage {
|
||||
distPath: string;
|
||||
@@ -46,12 +47,10 @@ async function copyPackage(
|
||||
);
|
||||
}
|
||||
|
||||
export async function deployPackage(
|
||||
packageJsonPath: string,
|
||||
): Promise<DeployedPackage> {
|
||||
export async function deployPackage(): Promise<DeployedPackage> {
|
||||
try {
|
||||
const packageJson: any = JSON.parse(
|
||||
await readFile(packageJsonPath, "utf8"),
|
||||
const packageJson: typeof packageJsonType = JSON.parse(
|
||||
await readFile(resolve(__dirname, "../package.json"), "utf8"),
|
||||
);
|
||||
|
||||
const distDir = join(__dirname, "../../../dist");
|
||||
|
||||
@@ -3,9 +3,7 @@ import { deployPackage } from "./deploy";
|
||||
import { spawn } from "child-process-promise";
|
||||
|
||||
export async function packageExtension(): Promise<void> {
|
||||
const deployedPackage = await deployPackage(
|
||||
resolve(__dirname, "../package.json"),
|
||||
);
|
||||
const deployedPackage = await deployPackage();
|
||||
console.log(
|
||||
`Packaging extension '${deployedPackage.name}@${deployedPackage.version}'...`,
|
||||
);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "."
|
||||
"rootDir": ".."
|
||||
},
|
||||
"include": ["*.ts"]
|
||||
}
|
||||
|
||||
6
extensions/ql-vscode/package-lock.json
generated
6
extensions/ql-vscode/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "vscode-codeql",
|
||||
"version": "1.8.13",
|
||||
"version": "1.9.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "vscode-codeql",
|
||||
"version": "1.8.13",
|
||||
"version": "1.9.1",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -147,7 +147,7 @@
|
||||
"webpack-cli": "^5.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.17.1",
|
||||
"node": "^18.15.0",
|
||||
"npm": ">=7.20.6",
|
||||
"vscode": "^1.67.0"
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "CodeQL for Visual Studio Code",
|
||||
"author": "GitHub",
|
||||
"private": true,
|
||||
"version": "1.8.13",
|
||||
"version": "1.9.1",
|
||||
"publisher": "GitHub",
|
||||
"license": "MIT",
|
||||
"icon": "media/VS-marketplace-CodeQL-icon.png",
|
||||
@@ -14,7 +14,7 @@
|
||||
},
|
||||
"engines": {
|
||||
"vscode": "^1.67.0",
|
||||
"node": "^16.17.1",
|
||||
"node": "^18.15.0",
|
||||
"npm": ">=7.20.6"
|
||||
},
|
||||
"categories": [
|
||||
@@ -1436,8 +1436,7 @@
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.openModelEditor",
|
||||
"when": "config.codeQL.canary && config.codeQL.model.editor"
|
||||
"command": "codeQL.openModelEditor"
|
||||
},
|
||||
{
|
||||
"command": "codeQLQueries.runLocalQueryContextMenu",
|
||||
|
||||
@@ -6,6 +6,7 @@ import { exit } from "process";
|
||||
function ignoreFile(file: string): boolean {
|
||||
return (
|
||||
containsPath("gulpfile.ts", file) ||
|
||||
containsPath(".storybook", file) ||
|
||||
containsPath(join("src", "stories"), file) ||
|
||||
pathsEqual(
|
||||
join("test", "vscode-tests", "jest-runner-installed-extensions.ts"),
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
} from "./distribution";
|
||||
import {
|
||||
assertNever,
|
||||
getChildProcessErrorMessage,
|
||||
getErrorMessage,
|
||||
getErrorStack,
|
||||
} from "../common/helpers-pure";
|
||||
@@ -547,9 +548,7 @@ export class CodeQLCliServer implements Disposable {
|
||||
yield JSON.parse(event) as EventType;
|
||||
} catch (err) {
|
||||
throw new Error(
|
||||
`Parsing output of ${description} failed: ${
|
||||
(err as any).stderr || getErrorMessage(err)
|
||||
}`,
|
||||
`Parsing output of ${description} failed: ${getErrorMessage(err)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -647,9 +646,7 @@ export class CodeQLCliServer implements Disposable {
|
||||
return JSON.parse(result) as OutputType;
|
||||
} catch (err) {
|
||||
throw new Error(
|
||||
`Parsing output of ${description} failed: ${
|
||||
(err as any).stderr || getErrorMessage(err)
|
||||
}`,
|
||||
`Parsing output of ${description} failed: ${getErrorMessage(err)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1647,7 +1644,7 @@ export async function runCodeQlCliCommand(
|
||||
return result.stdout;
|
||||
} catch (err) {
|
||||
throw new Error(
|
||||
`${description} failed: ${(err as any).stderr || getErrorMessage(err)}`,
|
||||
`${description} failed: ${getChildProcessErrorMessage(err)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,3 +67,26 @@ export function asError(e: unknown): Error {
|
||||
|
||||
return e instanceof Error ? e : new Error(String(e));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get error message when the error may have come from a method from the `child_process` module.
|
||||
*/
|
||||
export function getChildProcessErrorMessage(e: unknown): string {
|
||||
return isChildProcessError(e) ? e.stderr : getErrorMessage(e);
|
||||
}
|
||||
|
||||
/**
|
||||
* Error thrown from methods from the `child_process` module.
|
||||
*/
|
||||
interface ChildProcessError {
|
||||
readonly stderr: string;
|
||||
}
|
||||
|
||||
function isChildProcessError(e: unknown): e is ChildProcessError {
|
||||
return (
|
||||
typeof e === "object" &&
|
||||
e !== null &&
|
||||
"stderr" in e &&
|
||||
typeof e.stderr === "string"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -54,9 +54,7 @@ export async function sarifParser(
|
||||
});
|
||||
} catch (e) {
|
||||
throw new Error(
|
||||
`Parsing output of interpretation failed: ${
|
||||
(e as any).stderr || getErrorMessage(e)
|
||||
}`,
|
||||
`Parsing output of interpretation failed: ${getErrorMessage(e)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import { writeFile } from "fs-extra";
|
||||
import { dump } from "js-yaml";
|
||||
import { prepareExternalApiQuery } from "./external-api-usage-queries";
|
||||
import { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
import { showLlmGeneration } from "../config";
|
||||
|
||||
/**
|
||||
* setUpPack sets up a directory to use for the data extension editor queries.
|
||||
@@ -40,7 +41,10 @@ export async function setUpPack(
|
||||
|
||||
// Install the other needed query packs
|
||||
await cliServer.packDownload([`codeql/${language}-queries`]);
|
||||
await cliServer.packDownload([`codeql/${language}-automodel-queries`]);
|
||||
|
||||
if (language === "java" && showLlmGeneration()) {
|
||||
await cliServer.packDownload([`codeql/${language}-automodel-queries`]);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
VariantAnalysisState,
|
||||
} from "../common/interface-types";
|
||||
|
||||
interface VsCodeApi {
|
||||
export interface VsCodeApi {
|
||||
/**
|
||||
* Post message back to vscode extension.
|
||||
*/
|
||||
|
||||
@@ -21,7 +21,7 @@ const controllerRepoId = variantAnalysisJson_response.body.controller_repo.id;
|
||||
const variantAnalysisId = variantAnalysisJson_response.body.id;
|
||||
const repoTaskId = variantAnalysisRepoJson_response.body.repository.id;
|
||||
|
||||
describe("submitVariantAnalysis", () => {
|
||||
describe.skip("submitVariantAnalysis", () => {
|
||||
it("returns the submitted variant analysis", async () => {
|
||||
await mockServer.loadScenario("mrva-problem-query-success");
|
||||
|
||||
@@ -35,7 +35,7 @@ describe("submitVariantAnalysis", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("getVariantAnalysis", () => {
|
||||
describe.skip("getVariantAnalysis", () => {
|
||||
it("returns the variant analysis", async () => {
|
||||
await mockServer.loadScenario("mrva-problem-query-success");
|
||||
|
||||
@@ -50,7 +50,7 @@ describe("getVariantAnalysis", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("getVariantAnalysisRepo", () => {
|
||||
describe.skip("getVariantAnalysisRepo", () => {
|
||||
it("returns the variant analysis repo task", async () => {
|
||||
await mockServer.loadScenario("mrva-problem-query-success");
|
||||
|
||||
@@ -66,7 +66,7 @@ describe("getVariantAnalysisRepo", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("getRepositoryFromNwo", () => {
|
||||
describe.skip("getRepositoryFromNwo", () => {
|
||||
it("returns the repository", async () => {
|
||||
await mockServer.loadScenario("mrva-problem-query-success");
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": ["**/*.ts*"],
|
||||
"include": ["**/*.ts*", ".storybook/**/*.ts*"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user