Skip to content

Commit 9bb60c9

Browse files
committed
Link to workflow + fix incorrect comment
1 parent 0b2ce7a commit 9bb60c9

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

extensions/ql-vscode/src/remote-queries/remote-queries-manager.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ export class RemoteQueriesManager extends DisposableObject {
145145
void showAndLogErrorMessage(`Variant analysis execution failed. Error: ${queryWorkflowResult.error}`);
146146
}
147147
} else if (queryWorkflowResult.status === 'Cancelled') {
148-
// workflow was cancelled from within VS Code
149148
queryItem.failureReason = 'Cancelled';
150149
queryItem.status = QueryStatus.Failed;
151-
void showAndLogErrorMessage('Variant analysis was cancelled');
150+
await this.downloadAvailableResults(queryItem, credentials, executionEndTime);
151+
void showAndLogInformationMessage('Variant analysis was cancelled');
152152
} else if (queryWorkflowResult.status === 'InProgress') {
153153
// Should not get here. Only including this to ensure `assertNever` uses proper type checking.
154154
void showAndLogErrorMessage(`Unexpected status: ${queryWorkflowResult.status}`);
@@ -268,7 +268,11 @@ export class RemoteQueriesManager extends DisposableObject {
268268
* Checks whether there's a result index artifact available for the given query.
269269
* If so, set the query status to `Completed` and auto-download the results.
270270
*/
271-
private async downloadAvailableResults(queryItem: RemoteQueryHistoryItem, credentials: Credentials, executionEndTime: number): Promise<void> {
271+
private async downloadAvailableResults(
272+
queryItem: RemoteQueryHistoryItem,
273+
credentials: Credentials,
274+
executionEndTime: number
275+
): Promise<void> {
272276
const resultIndex = await getRemoteQueryIndex(credentials, queryItem.remoteQuery);
273277
if (resultIndex) {
274278
queryItem.completed = true;
@@ -289,7 +293,11 @@ export class RemoteQueriesManager extends DisposableObject {
289293
}
290294
);
291295
} else {
292-
void showAndLogErrorMessage(`There was an issue retrieving the result for the query ${queryItem.remoteQuery.queryName}`);
296+
const controllerRepo = `${queryItem.remoteQuery.controllerRepository.owner}/${queryItem.remoteQuery.controllerRepository.name}`;
297+
const workflowRunUrl = `https://github.com/${controllerRepo}/actions/runs/${queryItem.remoteQuery.actionsWorkflowRunId}`;
298+
void showAndLogErrorMessage(
299+
`There was an issue retrieving the result for the query [${queryItem.remoteQuery.queryName}](${workflowRunUrl}).`
300+
);
293301
queryItem.status = QueryStatus.Failed;
294302
}
295303
}

0 commit comments

Comments
 (0)