diff --git a/extensions/ql-vscode/src/remote-queries/remote-queries-interface.ts b/extensions/ql-vscode/src/remote-queries/remote-queries-interface.ts index 1be7653b9..f5c168bdf 100644 --- a/extensions/ql-vscode/src/remote-queries/remote-queries-interface.ts +++ b/extensions/ql-vscode/src/remote-queries/remote-queries-interface.ts @@ -77,6 +77,7 @@ export class RemoteQueriesInterfaceManager { queryFileName: queryFileName, queryFilePath: query.queryFilePath, queryText: query.queryText, + language: query.language, workflowRunUrl: `https://github.com/${query.controllerRepository.owner}/${query.controllerRepository.name}/actions/runs/${query.actionsWorkflowRunId}`, totalRepositoryCount: query.repositories.length, affectedRepositoryCount: affectedRepositories.length, diff --git a/extensions/ql-vscode/src/remote-queries/remote-query.ts b/extensions/ql-vscode/src/remote-queries/remote-query.ts index 033e03f42..1310656b1 100644 --- a/extensions/ql-vscode/src/remote-queries/remote-query.ts +++ b/extensions/ql-vscode/src/remote-queries/remote-query.ts @@ -4,6 +4,7 @@ export interface RemoteQuery { queryName: string; queryFilePath: string; queryText: string; + language: string; controllerRepository: Repository; repositories: Repository[]; executionStartTime: number; // Use number here since it needs to be serialized and desserialized. diff --git a/extensions/ql-vscode/src/remote-queries/run-remote-query.ts b/extensions/ql-vscode/src/remote-queries/run-remote-query.ts index 84d9740f6..432223fb7 100644 --- a/extensions/ql-vscode/src/remote-queries/run-remote-query.ts +++ b/extensions/ql-vscode/src/remote-queries/run-remote-query.ts @@ -314,7 +314,15 @@ export async function runRemoteQuery( return; } - const remoteQuery = await buildRemoteQueryEntity(repositories, queryFile, queryMetadata, owner, repo, queryStartTime, workflowRunId); + const remoteQuery = await buildRemoteQueryEntity( + repositories, + queryFile, + queryMetadata, + owner, + repo, + queryStartTime, + workflowRunId, + language); // don't return the path because it has been deleted return { query: remoteQuery }; @@ -437,7 +445,8 @@ async function buildRemoteQueryEntity( controllerRepoOwner: string, controllerRepoName: string, queryStartTime: number, - workflowRunId: number + workflowRunId: number, + language: string ): Promise { // The query name is either the name as specified in the query metadata, or the file name. const queryName = queryMetadata?.name ?? path.basename(queryFilePath); @@ -453,6 +462,7 @@ async function buildRemoteQueryEntity( queryName, queryFilePath, queryText, + language, controllerRepository: { owner: controllerRepoOwner, name: controllerRepoName, diff --git a/extensions/ql-vscode/src/remote-queries/sample-data.ts b/extensions/ql-vscode/src/remote-queries/sample-data.ts index d12f7f3d3..8b8056593 100644 --- a/extensions/ql-vscode/src/remote-queries/sample-data.ts +++ b/extensions/ql-vscode/src/remote-queries/sample-data.ts @@ -6,6 +6,7 @@ export const sampleRemoteQuery: RemoteQuery = { queryName: 'Inefficient regular expression', queryFilePath: '/Users/foo/dev/vscode-codeql-starter/ql/javascript/ql/src/Performance/ReDoS.ql', queryText: '/**\n * @name Inefficient regular expression\n * @description A regular expression that requires exponential time to match certain inputs\n * can be a performance bottleneck, and may be vulnerable to denial-of-service\n * attacks.\n * @kind problem\n * @problem.severity error\n * @security-severity 7.5\n * @precision high\n * @id js/redos\n * @tags security\n * external/cwe/cwe-1333\n * external/cwe/cwe-730\n * external/cwe/cwe-400\n */\n\nimport javascript\nimport semmle.javascript.security.performance.ReDoSUtil\nimport semmle.javascript.security.performance.ExponentialBackTracking\n\nfrom RegExpTerm t, string pump, State s, string prefixMsg\nwhere hasReDoSResult(t, pump, s, prefixMsg)\nselect t,\n "This part of the regular expression may cause exponential backtracking on strings " + prefixMsg +\n "containing many repetitions of \'" + pump + "\'."\n', + language: 'javascript', controllerRepository: { owner: 'big-corp', name: 'controller-repo' diff --git a/extensions/ql-vscode/src/remote-queries/shared/remote-query-result.ts b/extensions/ql-vscode/src/remote-queries/shared/remote-query-result.ts index 403a5a886..445afdf3d 100644 --- a/extensions/ql-vscode/src/remote-queries/shared/remote-query-result.ts +++ b/extensions/ql-vscode/src/remote-queries/shared/remote-query-result.ts @@ -6,6 +6,7 @@ export interface RemoteQueryResult { queryFileName: string; queryFilePath: string; queryText: string; + language: string; workflowRunUrl: string; totalRepositoryCount: number; affectedRepositoryCount: number; diff --git a/extensions/ql-vscode/src/remote-queries/view/RemoteQueries.tsx b/extensions/ql-vscode/src/remote-queries/view/RemoteQueries.tsx index 1baf345fc..36d1c0ca6 100644 --- a/extensions/ql-vscode/src/remote-queries/view/RemoteQueries.tsx +++ b/extensions/ql-vscode/src/remote-queries/view/RemoteQueries.tsx @@ -25,6 +25,7 @@ const emptyQueryResult: RemoteQueryResult = { queryFileName: '', queryFilePath: '', queryText: '', + language: '', workflowRunUrl: '', totalRepositoryCount: 0, affectedRepositoryCount: 0,