MRVA repositories panel not behind canary
This commit is contained in:
@@ -1281,8 +1281,7 @@
|
||||
},
|
||||
{
|
||||
"id": "codeQLVariantAnalysisRepositories",
|
||||
"name": "Variant Analysis Repositories",
|
||||
"when": "config.codeQL.canary"
|
||||
"name": "Variant Analysis Repositories"
|
||||
},
|
||||
{
|
||||
"id": "codeQLQueryHistory",
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import { window } from "vscode";
|
||||
import { App, AppMode } from "../common/app";
|
||||
import { App } 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;
|
||||
@@ -19,24 +18,12 @@ export class DbModule extends DisposableObject {
|
||||
this.dbManager = new DbManager(app, this.dbConfigStore);
|
||||
}
|
||||
|
||||
public static async initialize(app: App): Promise<DbModule | undefined> {
|
||||
if (DbModule.shouldEnableModule(app.mode)) {
|
||||
const dbModule = new DbModule(app);
|
||||
app.subscriptions.push(dbModule);
|
||||
public static async initialize(app: App): Promise<DbModule> {
|
||||
const dbModule = new DbModule(app);
|
||||
app.subscriptions.push(dbModule);
|
||||
|
||||
await dbModule.initialize(app);
|
||||
return dbModule;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private static shouldEnableModule(app: AppMode): boolean {
|
||||
if (app === AppMode.Development || app === AppMode.Test) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return isCanary();
|
||||
await dbModule.initialize(app);
|
||||
return dbModule;
|
||||
}
|
||||
|
||||
private async initialize(app: App): Promise<void> {
|
||||
|
||||
@@ -637,7 +637,7 @@ async function activateWithInstalledDistribution(
|
||||
cliServer,
|
||||
variantAnalysisStorageDir,
|
||||
variantAnalysisResultsManager,
|
||||
dbModule?.dbManager,
|
||||
dbModule.dbManager,
|
||||
);
|
||||
ctx.subscriptions.push(variantAnalysisManager);
|
||||
ctx.subscriptions.push(variantAnalysisResultsManager);
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user