Skip to content

Commit 277da3c

Browse files
authored
Rename feature flag (#1961)
1 parent 78e01e6 commit 277da3c

9 files changed

Lines changed: 27 additions & 28 deletions

File tree

extensions/ql-vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@
12941294
{
12951295
"id": "codeQLVariantAnalysisRepositories",
12961296
"name": "Variant Analysis Repositories",
1297-
"when": "config.codeQL.canary && config.codeQL.newQueryRunExperience"
1297+
"when": "config.codeQL.canary && config.codeQL.variantAnalysis.repositoriesPanel"
12981298
},
12991299
{
13001300
"id": "codeQLQueryHistory",

extensions/ql-vscode/src/config.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ export const NO_CACHE_AST_VIEWER = new Setting(
476476
);
477477

478478
// Settings for variant analysis
479-
const REMOTE_QUERIES_SETTING = new Setting("variantAnalysis", ROOT_SETTING);
479+
const VARIANT_ANALYSIS_SETTING = new Setting("variantAnalysis", ROOT_SETTING);
480480

481481
/**
482482
* Lists of GitHub repositories that you want to query remotely via the "Run Variant Analysis" command.
@@ -487,7 +487,7 @@ const REMOTE_QUERIES_SETTING = new Setting("variantAnalysis", ROOT_SETTING);
487487
*/
488488
const REMOTE_REPO_LISTS = new Setting(
489489
"repositoryLists",
490-
REMOTE_QUERIES_SETTING,
490+
VARIANT_ANALYSIS_SETTING,
491491
);
492492

493493
export function getRemoteRepositoryLists():
@@ -513,7 +513,7 @@ export async function setRemoteRepositoryLists(
513513
*/
514514
const REPO_LISTS_PATH = new Setting(
515515
"repositoryListsPath",
516-
REMOTE_QUERIES_SETTING,
516+
VARIANT_ANALYSIS_SETTING,
517517
);
518518

519519
export function getRemoteRepositoryListsPath(): string | undefined {
@@ -528,7 +528,7 @@ export function getRemoteRepositoryListsPath(): string | undefined {
528528
*/
529529
const REMOTE_CONTROLLER_REPO = new Setting(
530530
"controllerRepo",
531-
REMOTE_QUERIES_SETTING,
531+
VARIANT_ANALYSIS_SETTING,
532532
);
533533

534534
export function getRemoteControllerRepo(): string | undefined {
@@ -544,7 +544,7 @@ export async function setRemoteControllerRepo(repo: string | undefined) {
544544
* Default value is "main".
545545
* Note: This command is only available for internal users.
546546
*/
547-
const ACTION_BRANCH = new Setting("actionBranch", REMOTE_QUERIES_SETTING);
547+
const ACTION_BRANCH = new Setting("actionBranch", VARIANT_ANALYSIS_SETTING);
548548

549549
export function getActionBranch(): string {
550550
return ACTION_BRANCH.getValue<string>() || "main";
@@ -559,16 +559,15 @@ export function isVariantAnalysisLiveResultsEnabled(): boolean {
559559
}
560560

561561
/**
562-
* A flag indicating whether to use the new query run experience which involves
563-
* using a new database panel.
562+
* A flag indicating whether to use the new "variant analysis repositories" panel.
564563
*/
565-
const NEW_QUERY_RUN_EXPERIENCE = new Setting(
566-
"newQueryRunExperience",
567-
ROOT_SETTING,
564+
const VARIANT_ANALYSIS_REPOS_PANEL = new Setting(
565+
"repositoriesPanel",
566+
VARIANT_ANALYSIS_SETTING,
568567
);
569568

570-
export function isNewQueryRunExperienceEnabled(): boolean {
571-
return !!NEW_QUERY_RUN_EXPERIENCE.getValue<boolean>();
569+
export function isVariantAnalysisReposPanelEnabled(): boolean {
570+
return !!VARIANT_ANALYSIS_REPOS_PANEL.getValue<boolean>();
572571
}
573572

574573
// Settings for mocking the GitHub API.

extensions/ql-vscode/src/databases/db-module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { DbConfigStore } from "./config/db-config-store";
66
import { DbManager } from "./db-manager";
77
import { DbPanel } from "./ui/db-panel";
88
import { DbSelectionDecorationProvider } from "./ui/db-selection-decoration-provider";
9-
import { isCanary, isNewQueryRunExperienceEnabled } from "../config";
9+
import { isCanary, isVariantAnalysisReposPanelEnabled } from "../config";
1010

1111
export class DbModule extends DisposableObject {
1212
public readonly dbManager: DbManager;
@@ -36,7 +36,7 @@ export class DbModule extends DisposableObject {
3636
return true;
3737
}
3838

39-
return isCanary() && isNewQueryRunExperienceEnabled();
39+
return isCanary() && isVariantAnalysisReposPanelEnabled();
4040
}
4141

4242
private async initialize(): Promise<void> {

extensions/ql-vscode/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ async function activateWithInstalledDistribution(
642642
cliServer,
643643
variantAnalysisStorageDir,
644644
variantAnalysisResultsManager,
645-
dbModule?.dbManager, // the dbModule is only needed when the newQueryRunExperience is enabled
645+
dbModule?.dbManager, // the dbModule is only needed when variantAnalysisReposPanel is enabled
646646
);
647647
ctx.subscriptions.push(variantAnalysisManager);
648648
ctx.subscriptions.push(variantAnalysisResultsManager);

extensions/ql-vscode/src/remote-queries/repository-selection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { extLogger } from "../common";
44
import {
55
getRemoteRepositoryLists,
66
getRemoteRepositoryListsPath,
7-
isNewQueryRunExperienceEnabled,
7+
isVariantAnalysisReposPanelEnabled,
88
} from "../config";
99
import { OWNER_REGEX, REPO_REGEX } from "../pure/helpers-pure";
1010
import { UserCancellationException } from "../commandRunner";
@@ -36,7 +36,7 @@ interface RepoList {
3636
export async function getRepositorySelection(
3737
dbManager?: DbManager,
3838
): Promise<RepositorySelection> {
39-
if (isNewQueryRunExperienceEnabled()) {
39+
if (isVariantAnalysisReposPanelEnabled()) {
4040
const selectedDbItem = dbManager?.getSelectedDbItem();
4141
if (selectedDbItem) {
4242
switch (selectedDbItem.kind) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export async function prepareRemoteQueryRun(
225225
uri: Uri | undefined,
226226
progress: ProgressCallback,
227227
token: CancellationToken,
228-
dbManager?: DbManager, // the dbManager is only needed when the newQueryRunExperience is enabled
228+
dbManager?: DbManager, // the dbManager is only needed when variantAnalysisReposPanel is enabled
229229
): Promise<PreparedRemoteQuery> {
230230
if (!(await cliServer.cliConstraints.supportsRemoteQueries())) {
231231
throw new Error(

extensions/ql-vscode/src/remote-queries/variant-analysis-manager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ import {
6161
} from "../pure/variant-analysis-filter-sort";
6262
import { URLSearchParams } from "url";
6363
import { DbManager } from "../databases/db-manager";
64-
import { isNewQueryRunExperienceEnabled } from "../config";
64+
import { isVariantAnalysisReposPanelEnabled } from "../config";
6565

6666
export class VariantAnalysisManager
6767
extends DisposableObject
@@ -103,7 +103,7 @@ export class VariantAnalysisManager
103103
private readonly cliServer: CodeQLCliServer,
104104
private readonly storagePath: string,
105105
private readonly variantAnalysisResultsManager: VariantAnalysisResultsManager,
106-
private readonly dbManager?: DbManager, // the dbManager is only needed when the newQueryRunExperience is enabled
106+
private readonly dbManager?: DbManager, // the dbManager is only needed when variantAnalysisReposPanel is enabled
107107
) {
108108
super();
109109
this.variantAnalysisMonitor = this.push(
@@ -622,7 +622,7 @@ export class VariantAnalysisManager
622622
}
623623

624624
let text: string[];
625-
if (isNewQueryRunExperienceEnabled()) {
625+
if (isVariantAnalysisReposPanelEnabled()) {
626626
text = [
627627
"{",
628628
` "name": "new-repo-list",`,

extensions/ql-vscode/test/vscode-tests/cli-integration/remote-queries/variant-analysis-manager.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,10 +1009,10 @@ describe("Variant Analysis Manager", () => {
10091009
expect(writeTextStub).toBeCalledTimes(1);
10101010
});
10111011

1012-
describe("newQueryRunExperience true", () => {
1012+
describe("variantAnalysisReposPanel true", () => {
10131013
beforeEach(() => {
10141014
jest
1015-
.spyOn(config, "isNewQueryRunExperienceEnabled")
1015+
.spyOn(config, "isVariantAnalysisReposPanelEnabled")
10161016
.mockReturnValue(true);
10171017
});
10181018

@@ -1077,7 +1077,7 @@ describe("Variant Analysis Manager", () => {
10771077
});
10781078
});
10791079
});
1080-
describe("newQueryRunExperience false", () => {
1080+
describe("variantAnalysisReposPanel false", () => {
10811081
it("should be valid JSON when put in object", async () => {
10821082
await variantAnalysisManager.copyRepoListToClipboard(
10831083
variantAnalysis.id,

extensions/ql-vscode/test/vscode-tests/no-workspace/remote-queries/repository-selection.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import {
1212
} from "../../../../src/databases/db-item";
1313

1414
describe("repository selection", () => {
15-
describe("newQueryRunExperience true", () => {
15+
describe("variantAnalysisReposPanel true", () => {
1616
beforeEach(() => {
1717
jest
18-
.spyOn(config, "isNewQueryRunExperienceEnabled")
18+
.spyOn(config, "isVariantAnalysisReposPanelEnabled")
1919
.mockReturnValue(true);
2020
});
2121

@@ -115,7 +115,7 @@ describe("repository selection", () => {
115115
}
116116
});
117117

118-
describe("newQueryRunExperience false", () => {
118+
describe("variantAnalysisReposPanel false", () => {
119119
let quickPickSpy: jest.SpiedFunction<typeof window.showQuickPick>;
120120
let showInputBoxSpy: jest.SpiedFunction<typeof window.showInputBox>;
121121

0 commit comments

Comments
 (0)