Skip to content

Commit 053a4b0

Browse files
committed
Remove feature flag for loading ML models from packs
This functionality should now be enabled for all users.
1 parent 48ccb27 commit 053a4b0

2 files changed

Lines changed: 2 additions & 21 deletions

File tree

extensions/ql-vscode/src/config.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -343,15 +343,3 @@ export function getRemoteControllerRepo(): string | undefined {
343343
export async function setRemoteControllerRepo(repo: string | undefined) {
344344
await REMOTE_CONTROLLER_REPO.updateValue(repo, ConfigurationTarget.Global);
345345
}
346-
347-
/**
348-
* Whether to insecurely load ML models from CodeQL packs.
349-
*
350-
* This setting is for internal users only.
351-
*/
352-
const SHOULD_INSECURELY_LOAD_MODELS_FROM_PACKS =
353-
new Setting('shouldInsecurelyLoadModelsFromPacks', RUNNING_QUERIES_SETTING);
354-
355-
export function shouldInsecurelyLoadMlModelsFromPacks(): boolean {
356-
return SHOULD_INSECURELY_LOAD_MODELS_FROM_PACKS.getValue<boolean>();
357-
}

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import {
1010
TextDocument,
1111
TextEditor,
1212
Uri,
13-
window,
14-
workspace
13+
window
1514
} from 'vscode';
1615
import { ErrorCodes, ResponseError } from 'vscode-languageclient';
1716

@@ -643,13 +642,7 @@ export async function compileAndRunQueryAgainstDatabase(
643642
const metadata = await tryGetQueryMetadata(cliServer, qlProgram.queryPath);
644643

645644
let availableMlModels: cli.MlModelInfo[] = [];
646-
// The `capabilities.untrustedWorkspaces.restrictedConfigurations` entry in package.json doesn't
647-
// work with hidden settings, so we manually check that the workspace is trusted before looking at
648-
// whether the `shouldInsecurelyLoadMlModelsFromPacks` setting is enabled.
649-
if (workspace.isTrusted &&
650-
config.isCanary() &&
651-
config.shouldInsecurelyLoadMlModelsFromPacks() &&
652-
await cliServer.cliConstraints.supportsResolveMlModels()) {
645+
if (await cliServer.cliConstraints.supportsResolveMlModels()) {
653646
try {
654647
availableMlModels = (await cliServer.resolveMlModels(diskWorkspaceFolders)).models;
655648
void logger.log(`Found available ML models at the following paths: ${availableMlModels.map(x => `'${x.path}'`).join(', ')}.`);

0 commit comments

Comments
 (0)