From e3625c982f44303d6beeccb644fe1957c2014833 Mon Sep 17 00:00:00 2001 From: Charis Kyriakou Date: Fri, 24 Feb 2023 13:57:18 +0000 Subject: [PATCH] MRVA execution not behind canary --- docs/test-plan.md | 4 --- extensions/ql-vscode/package.json | 7 +++-- extensions/ql-vscode/src/extension.ts | 26 +++++++------------ ...nt-analysis-submission-integration.test.ts | 7 +---- 4 files changed, 14 insertions(+), 30 deletions(-) diff --git a/docs/test-plan.md b/docs/test-plan.md index b131580ed..290adc755 100644 --- a/docs/test-plan.md +++ b/docs/test-plan.md @@ -18,10 +18,6 @@ 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). diff --git a/extensions/ql-vscode/package.json b/extensions/ql-vscode/package.json index 57e3065b1..1d2a4de2c 100644 --- a/extensions/ql-vscode/package.json +++ b/extensions/ql-vscode/package.json @@ -978,11 +978,10 @@ }, { "command": "codeQL.runVariantAnalysis", - "when": "config.codeQL.canary && editorLangId == ql && resourceExtname == .ql" + "when": "editorLangId == ql && resourceExtname == .ql" }, { - "command": "codeQL.exportSelectedVariantAnalysisResults", - "when": "config.codeQL.canary" + "command": "codeQL.exportSelectedVariantAnalysisResults" }, { "command": "codeQL.runQueries", @@ -1236,7 +1235,7 @@ }, { "command": "codeQL.runVariantAnalysis", - "when": "config.codeQL.canary && editorLangId == ql && resourceExtname == .ql" + "when": "editorLangId == ql && resourceExtname == .ql" }, { "command": "codeQL.viewAst", diff --git a/extensions/ql-vscode/src/extension.ts b/extensions/ql-vscode/src/extension.ts index 4ec6b2858..2d6349939 100644 --- a/extensions/ql-vscode/src/extension.ts +++ b/extensions/ql-vscode/src/extension.ts @@ -1134,23 +1134,17 @@ async function activateWithInstalledDistribution( token: CancellationToken, uri: Uri | undefined, ) => { - if (isCanary()) { - progress({ - maxStep: 5, - step: 0, - message: "Getting credentials", - }); + progress({ + maxStep: 5, + step: 0, + message: "Getting credentials", + }); - await variantAnalysisManager.runVariantAnalysis( - uri || window.activeTextEditor?.document.uri, - progress, - token, - ); - } else { - throw new Error( - "Variant analysis requires the CodeQL Canary version to run.", - ); - } + await variantAnalysisManager.runVariantAnalysis( + uri || window.activeTextEditor?.document.uri, + progress, + token, + ); }, { title: "Run Variant Analysis", diff --git a/extensions/ql-vscode/test/vscode-tests/cli-integration/variant-analysis/variant-analysis-submission-integration.test.ts b/extensions/ql-vscode/test/vscode-tests/cli-integration/variant-analysis/variant-analysis-submission-integration.test.ts index 284a61638..060245e12 100644 --- a/extensions/ql-vscode/test/vscode-tests/cli-integration/variant-analysis/variant-analysis-submission-integration.test.ts +++ b/extensions/ql-vscode/test/vscode-tests/cli-integration/variant-analysis/variant-analysis-submission-integration.test.ts @@ -3,7 +3,6 @@ import { resolve } from "path"; import { authentication, commands, - ConfigurationTarget, extensions, TextDocument, window, @@ -13,10 +12,7 @@ import { import { CodeQLExtensionInterface } from "../../../../src/extension"; import { MockGitHubApiServer } from "../../../../src/mocks/mock-gh-api-server"; import { mockedQuickPickItem } from "../../utils/mocking.helpers"; -import { - CANARY_FEATURES, - setRemoteControllerRepo, -} from "../../../../src/config"; +import { setRemoteControllerRepo } from "../../../../src/config"; jest.setTimeout(30_000); @@ -39,7 +35,6 @@ describe("Variant Analysis Submission Integration", () => { let showErrorMessageSpy: jest.SpiedFunction; beforeEach(async () => { - await CANARY_FEATURES.updateValue(true, ConfigurationTarget.Global); await setRemoteControllerRepo("github/vscode-codeql"); jest.spyOn(authentication, "getSession").mockResolvedValue({