Skip to content

Commit b079690

Browse files
Add useful information to MRVA gist titles
All exported MRVA gists are given the name `CodeQL variant analysis results', which makes it hard to work out what it contains at a glance. We're adding more information in the gist title to make it more useful. Example of new title: `Empty Block (Go) x results (y repositories)` This translates to: `<query name> (<query language>) <number of results> results (<number of repositories> repositories)` Co-authored-by: Shati Patel <shati-patel@github.com>
1 parent 4e863e9 commit b079690

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

extensions/ql-vscode/src/remote-queries/export-results.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ async function exportResultsToGist(
8080
analysesResults: AnalysisResults[]
8181
): Promise<void> {
8282
const credentials = await Credentials.initialize(ctx);
83-
const description = 'CodeQL Variant Analysis Results';
83+
const description = buildGistDescription(query, analysesResults);
8484
const markdownFiles = generateMarkdown(query, analysesResults, 'gist');
8585
// Convert markdownFiles to the appropriate format for uploading to gist
8686
const gistFiles = markdownFiles.reduce((acc, cur) => {
@@ -100,6 +100,15 @@ async function exportResultsToGist(
100100
}
101101
}
102102

103+
/**
104+
* Builds Gist description
105+
* Ex: Empty Block (Go) x results (y repositories)
106+
*/
107+
const buildGistDescription = (query: RemoteQuery, analysesResults: AnalysisResults[]) => {
108+
const resultCount = sumAnalysesResults(analysesResults);
109+
return `${query.queryName} (${query.language}) ${resultCount} results (${query.numRepositoriesQueried} repositories)`;
110+
};
111+
103112
/**
104113
* Converts the results of a remote query to markdown and saves the files locally
105114
* in the query directory (where query results and metadata are also saved).

0 commit comments

Comments
 (0)