Revert "Remove canary requirement for GitHub database download"

This commit is contained in:
Koen Vlaswinkel
2022-08-24 11:51:44 +02:00
committed by GitHub
parent 178d626062
commit c5a6e64df8
3 changed files with 21 additions and 12 deletions

View File

@@ -2,8 +2,6 @@
## [UNRELEASED]
- Add ability for users to download databases directly from GitHub. [#1466](https://github.com/github/vscode-codeql/pull/1466)
## 1.6.10 - 9 August 2022
No user facing changes.

View File

@@ -664,7 +664,7 @@
},
{
"command": "codeQLDatabases.chooseDatabaseGithub",
"when": "view == codeQLDatabases",
"when": "config.codeQL.canary && view == codeQLDatabases",
"group": "navigation"
},
{
@@ -878,6 +878,10 @@
}
],
"commandPalette": [
{
"command": "codeQL.authenticateToGitHub",
"when": "config.codeQL.canary"
},
{
"command": "codeQL.runQuery",
"when": "resourceLangId == ql && resourceExtname == .ql"
@@ -922,6 +926,10 @@
"command": "codeQL.viewCfg",
"when": "resourceScheme == codeql-zip-archive && config.codeQL.canary"
},
{
"command": "codeQL.chooseDatabaseGithub",
"when": "config.codeQL.canary"
},
{
"command": "codeQLDatabases.setCurrentDatabase",
"when": "false"
@@ -1167,7 +1175,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 GitHub](command:codeQLDatabases.chooseDatabaseGithub)\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 LGTM](command:codeQLDatabases.chooseDatabaseLgtm)"
},
{
"view": "codeQLEvalLogViewer",

View File

@@ -1018,16 +1018,19 @@ async function activateWithInstalledDistribution(
}
};
// The "authenticateToGitHub" command is internal-only.
ctx.subscriptions.push(
commandRunner('codeQL.authenticateToGitHub', async () => {
/**
* 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}`);
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}`);
}
}));
ctx.subscriptions.push(