Skip to content

Commit c5a6e64

Browse files
authored
Revert "Remove canary requirement for GitHub database download"
1 parent 178d626 commit c5a6e64

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

extensions/ql-vscode/CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
## [UNRELEASED]
44

5-
- Add ability for users to download databases directly from GitHub. [#1466](https://github.com/github/vscode-codeql/pull/1466)
6-
75
## 1.6.10 - 9 August 2022
86

97
No user facing changes.

extensions/ql-vscode/package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@
664664
},
665665
{
666666
"command": "codeQLDatabases.chooseDatabaseGithub",
667-
"when": "view == codeQLDatabases",
667+
"when": "config.codeQL.canary && view == codeQLDatabases",
668668
"group": "navigation"
669669
},
670670
{
@@ -878,6 +878,10 @@
878878
}
879879
],
880880
"commandPalette": [
881+
{
882+
"command": "codeQL.authenticateToGitHub",
883+
"when": "config.codeQL.canary"
884+
},
881885
{
882886
"command": "codeQL.runQuery",
883887
"when": "resourceLangId == ql && resourceExtname == .ql"
@@ -922,6 +926,10 @@
922926
"command": "codeQL.viewCfg",
923927
"when": "resourceScheme == codeql-zip-archive && config.codeQL.canary"
924928
},
929+
{
930+
"command": "codeQL.chooseDatabaseGithub",
931+
"when": "config.codeQL.canary"
932+
},
925933
{
926934
"command": "codeQLDatabases.setCurrentDatabase",
927935
"when": "false"
@@ -1167,7 +1175,7 @@
11671175
},
11681176
{
11691177
"view": "codeQLDatabases",
1170-
"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)"
1178+
"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)"
11711179
},
11721180
{
11731181
"view": "codeQLEvalLogViewer",

extensions/ql-vscode/src/extension.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,16 +1018,19 @@ async function activateWithInstalledDistribution(
10181018
}
10191019
};
10201020

1021+
// The "authenticateToGitHub" command is internal-only.
10211022
ctx.subscriptions.push(
10221023
commandRunner('codeQL.authenticateToGitHub', async () => {
1023-
/**
1024-
* Credentials for authenticating to GitHub.
1025-
* These are used when making API calls.
1026-
*/
1027-
const credentials = await Credentials.initialize(ctx);
1028-
const octokit = await credentials.getOctokit();
1029-
const userInfo = await octokit.users.getAuthenticated();
1030-
void showAndLogInformationMessage(`Authenticated to GitHub as user: ${userInfo.data.login}`);
1024+
if (isCanary()) {
1025+
/**
1026+
* Credentials for authenticating to GitHub.
1027+
* These are used when making API calls.
1028+
*/
1029+
const credentials = await Credentials.initialize(ctx);
1030+
const octokit = await credentials.getOctokit();
1031+
const userInfo = await octokit.users.getAuthenticated();
1032+
void showAndLogInformationMessage(`Authenticated to GitHub as user: ${userInfo.data.login}`);
1033+
}
10311034
}));
10321035

10331036
ctx.subscriptions.push(

0 commit comments

Comments
 (0)