Remove canary requirement for GitHub database download

This commit is contained in:
Koen Vlaswinkel
2022-08-23 14:45:38 +02:00
parent 6d7d0ca41a
commit 95438bb7e3
2 changed files with 10 additions and 21 deletions

View File

@@ -664,7 +664,7 @@
},
{
"command": "codeQLDatabases.chooseDatabaseGithub",
"when": "config.codeQL.canary && view == codeQLDatabases",
"when": "view == codeQLDatabases",
"group": "navigation"
},
{
@@ -878,10 +878,6 @@
}
],
"commandPalette": [
{
"command": "codeQL.authenticateToGitHub",
"when": "config.codeQL.canary"
},
{
"command": "codeQL.runQuery",
"when": "resourceLangId == ql && resourceExtname == .ql"
@@ -926,10 +922,6 @@
"command": "codeQL.viewCfg",
"when": "resourceScheme == codeql-zip-archive && config.codeQL.canary"
},
{
"command": "codeQL.chooseDatabaseGithub",
"when": "config.codeQL.canary"
},
{
"command": "codeQLDatabases.setCurrentDatabase",
"when": "false"
@@ -1175,7 +1167,7 @@
},
{
"view": "codeQLDatabases",
"contents": "Add a CodeQL database:\n[From a folder](command:codeQLDatabases.chooseDatabaseFolder)\n[From an archive](command:codeQLDatabases.chooseDatabaseArchive)\n[From a URL (as a zip file)](command:codeQLDatabases.chooseDatabaseInternet)\n[From LGTM](command:codeQLDatabases.chooseDatabaseLgtm)"
"contents": "Add a CodeQL database:\n[From a folder](command:codeQLDatabases.chooseDatabaseFolder)\n[From an archive](command:codeQLDatabases.chooseDatabaseArchive)\n[From a URL (as a zip file)](command:codeQLDatabases.chooseDatabaseInternet)\n[From GitHub](command:codeQLDatabases.chooseDatabaseGithub)\n[From LGTM](command:codeQLDatabases.chooseDatabaseLgtm)"
},
{
"view": "codeQLEvalLogViewer",

View File

@@ -1018,19 +1018,16 @@ async function activateWithInstalledDistribution(
}
};
// The "authenticateToGitHub" command is internal-only.
ctx.subscriptions.push(
commandRunner('codeQL.authenticateToGitHub', async () => {
if (isCanary()) {
/**
* Credentials for authenticating to GitHub.
* These are used when making API calls.
*/
const credentials = await Credentials.initialize(ctx);
const octokit = await credentials.getOctokit();
const userInfo = await octokit.users.getAuthenticated();
void showAndLogInformationMessage(`Authenticated to GitHub as user: ${userInfo.data.login}`);
}
/**
* Credentials for authenticating to GitHub.
* These are used when making API calls.
*/
const credentials = await Credentials.initialize(ctx);
const octokit = await credentials.getOctokit();
const userInfo = await octokit.users.getAuthenticated();
void showAndLogInformationMessage(`Authenticated to GitHub as user: ${userInfo.data.login}`);
}));
ctx.subscriptions.push(