Skip to content

Commit ad4c30e

Browse files
robertbrignullshati-patel
authored andcommitted
Include clickable link to show logs in message
1 parent db7f5f5 commit ad4c30e

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

extensions/ql-vscode/src/extension.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,10 @@ async function activateWithInstalledDistribution(
812812
}
813813
}));
814814

815+
commands.registerCommand('codeQL.showLogs', () => {
816+
logger.show();
817+
});
818+
815819
void logger.log('Starting language server.');
816820
ctx.subscriptions.push(client.start());
817821

extensions/ql-vscode/src/run-remote-query.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,21 @@ async function runRemoteQueriesApiRequest(credentials: Credentials, ref: string,
135135
if (typeof error.message === 'string' && error.message.includes('Some repositories were invalid')) {
136136
const invalidRepos = error?.response?.data?.invalid_repos || [];
137137
const reposWithoutDbUploads = error?.response?.data?.repos_without_db_uploads || [];
138-
void logger.log('Unable to run query on all repositories');
139-
void logger.log('Invalid repos: ' + invalidRepos.join(', '));
140-
void logger.log('Repos without DB uploads: ' + reposWithoutDbUploads.join(', '));
138+
void logger.log('Unable to run query on some of the specified repositories');
139+
if (invalidRepos.length > 0) {
140+
void logger.log('Invalid repos: ' + invalidRepos.join(', '));
141+
}
142+
if (reposWithoutDbUploads.length > 0) {
143+
void logger.log('Repos without DB uploads: ' + reposWithoutDbUploads.join(', '));
144+
}
141145

142146
if (invalidRepos.length + reposWithoutDbUploads.length === repositories.length) {
143147
// Every repo is invalid in some way
144148
void showAndLogErrorMessage('Unable to run query on any of the specified repositories.');
145149
return;
146150
}
147151

148-
const popupMessage = 'Unable to run query on some of the specified repositories. See logs for more details.';
152+
const popupMessage = 'Unable to run query on some of the specified repositories. [See logs for more details](command:codeQL.showLogs)';
149153
const rerunQuery = await showInformationMessageWithAction(popupMessage, 'Rerun on the valid repositories only');
150154
if (rerunQuery) {
151155
const validRepositories = repositories.filter(r => !invalidRepos.includes(r) && !reposWithoutDbUploads.includes(r));

0 commit comments

Comments
 (0)