Revert "Move MRVA out of canary "
This commit is contained in:
@@ -15,7 +15,6 @@ To see what has changed in the last few versions of the extension, see the [Chan
|
||||
* Shows the flow of data through the results of path queries, which is essential for triaging security results.
|
||||
* Provides an easy way to run queries from the large, open source repository of [CodeQL security queries](https://github.com/github/codeql).
|
||||
* Adds IntelliSense to support you writing and editing your own CodeQL query and library files.
|
||||
* Supports you running CodeQL queries against thousands of repositories on GitHub using multi-repository variant analysis.
|
||||
|
||||
## Project goals and scope
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
## [UNRELEASED]
|
||||
|
||||
- Enable multi-repository variant analysis. [#2121](https://github.com/github/vscode-codeql/pull/2121)
|
||||
- Enable collection of telemetry concerning interactions with UI elements, including buttons, links, and other inputs. [#2114](https://github.com/github/vscode-codeql/pull/2114)
|
||||
|
||||
# 1.7.10 - 23 February 2023
|
||||
|
||||
@@ -16,6 +16,10 @@ choose to go through some of the Optional Test Cases.
|
||||
|
||||
## Required Test Cases
|
||||
|
||||
### Pre-requisites
|
||||
|
||||
- Flip the `codeQL.canary` flag. This will enable MRVA in the extension.
|
||||
|
||||
### Test Case 1: MRVA - Running a problem path query and viewing results
|
||||
|
||||
1. Open the [UnsafeJQueryPlugin query](https://github.com/github/codeql/blob/main/javascript/ql/src/Security/CWE-079/UnsafeJQueryPlugin.ql).
|
||||
|
||||
@@ -978,10 +978,11 @@
|
||||
},
|
||||
{
|
||||
"command": "codeQL.runVariantAnalysis",
|
||||
"when": "editorLangId == ql && resourceExtname == .ql"
|
||||
"when": "config.codeQL.canary && editorLangId == ql && resourceExtname == .ql"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.exportSelectedVariantAnalysisResults"
|
||||
"command": "codeQL.exportSelectedVariantAnalysisResults",
|
||||
"when": "config.codeQL.canary"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.runQueries",
|
||||
@@ -1235,7 +1236,7 @@
|
||||
},
|
||||
{
|
||||
"command": "codeQL.runVariantAnalysis",
|
||||
"when": "editorLangId == ql && resourceExtname == .ql"
|
||||
"when": "config.codeQL.canary && editorLangId == ql && resourceExtname == .ql"
|
||||
},
|
||||
{
|
||||
"command": "codeQL.viewAst",
|
||||
@@ -1280,7 +1281,8 @@
|
||||
},
|
||||
{
|
||||
"id": "codeQLVariantAnalysisRepositories",
|
||||
"name": "Variant Analysis Repositories"
|
||||
"name": "Variant Analysis Repositories",
|
||||
"when": "config.codeQL.canary"
|
||||
},
|
||||
{
|
||||
"id": "codeQLQueryHistory",
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { window } from "vscode";
|
||||
import { App } from "../common/app";
|
||||
import { App, AppMode } from "../common/app";
|
||||
import { extLogger } from "../common";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { DbConfigStore } from "./config/db-config-store";
|
||||
import { DbManager } from "./db-manager";
|
||||
import { DbPanel } from "./ui/db-panel";
|
||||
import { DbSelectionDecorationProvider } from "./ui/db-selection-decoration-provider";
|
||||
import { isCanary } from "../config";
|
||||
|
||||
export class DbModule extends DisposableObject {
|
||||
public readonly dbManager: DbManager;
|
||||
@@ -18,7 +19,8 @@ export class DbModule extends DisposableObject {
|
||||
this.dbManager = new DbManager(app, this.dbConfigStore);
|
||||
}
|
||||
|
||||
public static async initialize(app: App): Promise<DbModule> {
|
||||
public static async initialize(app: App): Promise<DbModule | undefined> {
|
||||
if (DbModule.shouldEnableModule(app.mode)) {
|
||||
const dbModule = new DbModule(app);
|
||||
app.subscriptions.push(dbModule);
|
||||
|
||||
@@ -26,6 +28,17 @@ export class DbModule extends DisposableObject {
|
||||
return dbModule;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private static shouldEnableModule(app: AppMode): boolean {
|
||||
if (app === AppMode.Development || app === AppMode.Test) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return isCanary();
|
||||
}
|
||||
|
||||
private async initialize(app: App): Promise<void> {
|
||||
void extLogger.log("Initializing database module");
|
||||
|
||||
|
||||
@@ -637,7 +637,7 @@ async function activateWithInstalledDistribution(
|
||||
cliServer,
|
||||
variantAnalysisStorageDir,
|
||||
variantAnalysisResultsManager,
|
||||
dbModule.dbManager,
|
||||
dbModule?.dbManager,
|
||||
);
|
||||
ctx.subscriptions.push(variantAnalysisManager);
|
||||
ctx.subscriptions.push(variantAnalysisResultsManager);
|
||||
@@ -1121,6 +1121,7 @@ async function activateWithInstalledDistribution(
|
||||
token: CancellationToken,
|
||||
uri: Uri | undefined,
|
||||
) => {
|
||||
if (isCanary()) {
|
||||
progress({
|
||||
maxStep: 5,
|
||||
step: 0,
|
||||
@@ -1132,6 +1133,11 @@ async function activateWithInstalledDistribution(
|
||||
progress,
|
||||
token,
|
||||
);
|
||||
} else {
|
||||
throw new Error(
|
||||
"Variant analysis requires the CodeQL Canary version to run.",
|
||||
);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "Run Variant Analysis",
|
||||
|
||||
@@ -13,9 +13,9 @@ export interface RepositorySelection {
|
||||
* @returns The user selection.
|
||||
*/
|
||||
export async function getRepositorySelection(
|
||||
dbManager: DbManager,
|
||||
dbManager?: DbManager,
|
||||
): Promise<RepositorySelection> {
|
||||
const selectedDbItem = dbManager.getSelectedDbItem();
|
||||
const selectedDbItem = dbManager?.getSelectedDbItem();
|
||||
if (selectedDbItem) {
|
||||
switch (selectedDbItem.kind) {
|
||||
case DbItemKind.LocalDatabase || DbItemKind.LocalList:
|
||||
|
||||
@@ -223,7 +223,7 @@ export async function prepareRemoteQueryRun(
|
||||
uri: Uri | undefined,
|
||||
progress: ProgressCallback,
|
||||
token: CancellationToken,
|
||||
dbManager: DbManager,
|
||||
dbManager?: DbManager,
|
||||
): Promise<PreparedRemoteQuery> {
|
||||
if (!uri?.fsPath.endsWith(".ql")) {
|
||||
throw new UserCancellationException("Not a CodeQL query file.");
|
||||
|
||||
@@ -105,7 +105,7 @@ export class VariantAnalysisManager
|
||||
private readonly cliServer: CodeQLCliServer,
|
||||
private readonly storagePath: string,
|
||||
private readonly variantAnalysisResultsManager: VariantAnalysisResultsManager,
|
||||
private readonly dbManager: DbManager,
|
||||
private readonly dbManager?: DbManager,
|
||||
) {
|
||||
super();
|
||||
this.variantAnalysisMonitor = this.push(
|
||||
|
||||
@@ -3,6 +3,7 @@ import { resolve } from "path";
|
||||
import {
|
||||
authentication,
|
||||
commands,
|
||||
ConfigurationTarget,
|
||||
extensions,
|
||||
QuickPickItem,
|
||||
TextDocument,
|
||||
@@ -12,7 +13,10 @@ import {
|
||||
|
||||
import { CodeQLExtensionInterface } from "../../../../src/extension";
|
||||
import { MockGitHubApiServer } from "../../../../src/mocks/mock-gh-api-server";
|
||||
import { setRemoteControllerRepo } from "../../../../src/config";
|
||||
import {
|
||||
CANARY_FEATURES,
|
||||
setRemoteControllerRepo,
|
||||
} from "../../../../src/config";
|
||||
|
||||
jest.setTimeout(30_000);
|
||||
|
||||
@@ -35,6 +39,7 @@ describe("Variant Analysis Submission Integration", () => {
|
||||
let showErrorMessageSpy: jest.SpiedFunction<typeof window.showErrorMessage>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await CANARY_FEATURES.updateValue(true, ConfigurationTarget.Global);
|
||||
await setRemoteControllerRepo("github/vscode-codeql");
|
||||
|
||||
jest.spyOn(authentication, "getSession").mockResolvedValue({
|
||||
|
||||
Reference in New Issue
Block a user