MRVA execution not behind canary
This commit is contained in:
@@ -16,10 +16,6 @@ choose to go through some of the Optional Test Cases.
|
|||||||
|
|
||||||
## Required 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
|
### 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).
|
1. Open the [UnsafeJQueryPlugin query](https://github.com/github/codeql/blob/main/javascript/ql/src/Security/CWE-079/UnsafeJQueryPlugin.ql).
|
||||||
|
|||||||
@@ -978,11 +978,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.runVariantAnalysis",
|
"command": "codeQL.runVariantAnalysis",
|
||||||
"when": "config.codeQL.canary && editorLangId == ql && resourceExtname == .ql"
|
"when": "editorLangId == ql && resourceExtname == .ql"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.exportSelectedVariantAnalysisResults",
|
"command": "codeQL.exportSelectedVariantAnalysisResults"
|
||||||
"when": "config.codeQL.canary"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.runQueries",
|
"command": "codeQL.runQueries",
|
||||||
@@ -1236,7 +1235,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.runVariantAnalysis",
|
"command": "codeQL.runVariantAnalysis",
|
||||||
"when": "config.codeQL.canary && editorLangId == ql && resourceExtname == .ql"
|
"when": "editorLangId == ql && resourceExtname == .ql"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "codeQL.viewAst",
|
"command": "codeQL.viewAst",
|
||||||
|
|||||||
@@ -1121,23 +1121,17 @@ async function activateWithInstalledDistribution(
|
|||||||
token: CancellationToken,
|
token: CancellationToken,
|
||||||
uri: Uri | undefined,
|
uri: Uri | undefined,
|
||||||
) => {
|
) => {
|
||||||
if (isCanary()) {
|
progress({
|
||||||
progress({
|
maxStep: 5,
|
||||||
maxStep: 5,
|
step: 0,
|
||||||
step: 0,
|
message: "Getting credentials",
|
||||||
message: "Getting credentials",
|
});
|
||||||
});
|
|
||||||
|
|
||||||
await variantAnalysisManager.runVariantAnalysis(
|
await variantAnalysisManager.runVariantAnalysis(
|
||||||
uri || window.activeTextEditor?.document.uri,
|
uri || window.activeTextEditor?.document.uri,
|
||||||
progress,
|
progress,
|
||||||
token,
|
token,
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
throw new Error(
|
|
||||||
"Variant analysis requires the CodeQL Canary version to run.",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Run Variant Analysis",
|
title: "Run Variant Analysis",
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { resolve } from "path";
|
|||||||
import {
|
import {
|
||||||
authentication,
|
authentication,
|
||||||
commands,
|
commands,
|
||||||
ConfigurationTarget,
|
|
||||||
extensions,
|
extensions,
|
||||||
QuickPickItem,
|
QuickPickItem,
|
||||||
TextDocument,
|
TextDocument,
|
||||||
@@ -13,10 +12,7 @@ import {
|
|||||||
|
|
||||||
import { CodeQLExtensionInterface } from "../../../../src/extension";
|
import { CodeQLExtensionInterface } from "../../../../src/extension";
|
||||||
import { MockGitHubApiServer } from "../../../../src/mocks/mock-gh-api-server";
|
import { MockGitHubApiServer } from "../../../../src/mocks/mock-gh-api-server";
|
||||||
import {
|
import { setRemoteControllerRepo } from "../../../../src/config";
|
||||||
CANARY_FEATURES,
|
|
||||||
setRemoteControllerRepo,
|
|
||||||
} from "../../../../src/config";
|
|
||||||
|
|
||||||
jest.setTimeout(30_000);
|
jest.setTimeout(30_000);
|
||||||
|
|
||||||
@@ -39,7 +35,6 @@ describe("Variant Analysis Submission Integration", () => {
|
|||||||
let showErrorMessageSpy: jest.SpiedFunction<typeof window.showErrorMessage>;
|
let showErrorMessageSpy: jest.SpiedFunction<typeof window.showErrorMessage>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await CANARY_FEATURES.updateValue(true, ConfigurationTarget.Global);
|
|
||||||
await setRemoteControllerRepo("github/vscode-codeql");
|
await setRemoteControllerRepo("github/vscode-codeql");
|
||||||
|
|
||||||
jest.spyOn(authentication, "getSession").mockResolvedValue({
|
jest.spyOn(authentication, "getSession").mockResolvedValue({
|
||||||
|
|||||||
Reference in New Issue
Block a user