MRVA repositories panel not behind canary
This commit is contained in:
@@ -1281,8 +1281,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "codeQLVariantAnalysisRepositories",
|
"id": "codeQLVariantAnalysisRepositories",
|
||||||
"name": "Variant Analysis Repositories",
|
"name": "Variant Analysis Repositories"
|
||||||
"when": "config.codeQL.canary"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "codeQLQueryHistory",
|
"id": "codeQLQueryHistory",
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { window } from "vscode";
|
import { window } from "vscode";
|
||||||
import { App, AppMode } from "../common/app";
|
import { App } from "../common/app";
|
||||||
import { extLogger } from "../common";
|
import { extLogger } from "../common";
|
||||||
import { DisposableObject } from "../pure/disposable-object";
|
import { DisposableObject } from "../pure/disposable-object";
|
||||||
import { DbConfigStore } from "./config/db-config-store";
|
import { DbConfigStore } from "./config/db-config-store";
|
||||||
import { DbManager } from "./db-manager";
|
import { DbManager } from "./db-manager";
|
||||||
import { DbPanel } from "./ui/db-panel";
|
import { DbPanel } from "./ui/db-panel";
|
||||||
import { DbSelectionDecorationProvider } from "./ui/db-selection-decoration-provider";
|
import { DbSelectionDecorationProvider } from "./ui/db-selection-decoration-provider";
|
||||||
import { isCanary } from "../config";
|
|
||||||
|
|
||||||
export class DbModule extends DisposableObject {
|
export class DbModule extends DisposableObject {
|
||||||
public readonly dbManager: DbManager;
|
public readonly dbManager: DbManager;
|
||||||
@@ -19,24 +18,12 @@ export class DbModule extends DisposableObject {
|
|||||||
this.dbManager = new DbManager(app, this.dbConfigStore);
|
this.dbManager = new DbManager(app, this.dbConfigStore);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async initialize(app: App): Promise<DbModule | undefined> {
|
public static async initialize(app: App): Promise<DbModule> {
|
||||||
if (DbModule.shouldEnableModule(app.mode)) {
|
const dbModule = new DbModule(app);
|
||||||
const dbModule = new DbModule(app);
|
app.subscriptions.push(dbModule);
|
||||||
app.subscriptions.push(dbModule);
|
|
||||||
|
|
||||||
await dbModule.initialize(app);
|
await dbModule.initialize(app);
|
||||||
return dbModule;
|
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> {
|
private async initialize(app: App): Promise<void> {
|
||||||
|
|||||||
@@ -644,7 +644,7 @@ async function activateWithInstalledDistribution(
|
|||||||
cliServer,
|
cliServer,
|
||||||
variantAnalysisStorageDir,
|
variantAnalysisStorageDir,
|
||||||
variantAnalysisResultsManager,
|
variantAnalysisResultsManager,
|
||||||
dbModule?.dbManager,
|
dbModule.dbManager,
|
||||||
);
|
);
|
||||||
ctx.subscriptions.push(variantAnalysisManager);
|
ctx.subscriptions.push(variantAnalysisManager);
|
||||||
ctx.subscriptions.push(variantAnalysisResultsManager);
|
ctx.subscriptions.push(variantAnalysisResultsManager);
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ export interface RepositorySelection {
|
|||||||
* @returns The user selection.
|
* @returns The user selection.
|
||||||
*/
|
*/
|
||||||
export async function getRepositorySelection(
|
export async function getRepositorySelection(
|
||||||
dbManager?: DbManager,
|
dbManager: DbManager,
|
||||||
): Promise<RepositorySelection> {
|
): Promise<RepositorySelection> {
|
||||||
const selectedDbItem = dbManager?.getSelectedDbItem();
|
const selectedDbItem = dbManager.getSelectedDbItem();
|
||||||
if (selectedDbItem) {
|
if (selectedDbItem) {
|
||||||
switch (selectedDbItem.kind) {
|
switch (selectedDbItem.kind) {
|
||||||
case DbItemKind.LocalDatabase || DbItemKind.LocalList:
|
case DbItemKind.LocalDatabase || DbItemKind.LocalList:
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ export async function prepareRemoteQueryRun(
|
|||||||
uri: Uri | undefined,
|
uri: Uri | undefined,
|
||||||
progress: ProgressCallback,
|
progress: ProgressCallback,
|
||||||
token: CancellationToken,
|
token: CancellationToken,
|
||||||
dbManager?: DbManager,
|
dbManager: DbManager,
|
||||||
): Promise<PreparedRemoteQuery> {
|
): Promise<PreparedRemoteQuery> {
|
||||||
if (!uri?.fsPath.endsWith(".ql")) {
|
if (!uri?.fsPath.endsWith(".ql")) {
|
||||||
throw new UserCancellationException("Not a CodeQL query file.");
|
throw new UserCancellationException("Not a CodeQL query file.");
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ export class VariantAnalysisManager
|
|||||||
private readonly cliServer: CodeQLCliServer,
|
private readonly cliServer: CodeQLCliServer,
|
||||||
private readonly storagePath: string,
|
private readonly storagePath: string,
|
||||||
private readonly variantAnalysisResultsManager: VariantAnalysisResultsManager,
|
private readonly variantAnalysisResultsManager: VariantAnalysisResultsManager,
|
||||||
private readonly dbManager?: DbManager,
|
private readonly dbManager: DbManager,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
this.variantAnalysisMonitor = this.push(
|
this.variantAnalysisMonitor = this.push(
|
||||||
|
|||||||
Reference in New Issue
Block a user