github / vscode-codeql Public
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multiple analyses for same repo to be downloaded #1163
Conversation
Removes the limitation specified in #1089 where analyses for the same repo and different queries will overwrite each other.
@@ -139,6 +146,6 @@ export class AnalysesResultsManager { | |||
} | |||
|
|||
private isAnalysisDownloaded(analysis: AnalysisSummary): boolean { | |||
return this.analysesResults.some(x => x.nwo === analysis.nwo); | |||
return (this.analysesResults.get(analysis.downloadLink.queryId) || []).some(x => x.nwo === analysis.nwo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and in a few other places we do this.analysesResults.get(queryId)
.. I think it'd be easier to read if we had a getQueryResults
and did
return (this.analysesResults.get(analysis.downloadLink.queryId) || []).some(x => x.nwo === analysis.nwo); | |
return this.getQueryResults(queryId).some(x => x.nwo === analysis.nwo); |
where getQueryResults
is:
private getQueryResults(queryId: string) {
return this.analysesResults.get(analysis.downloadLink.queryId) || []
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already the getAnalysesResults
, which is public. It makes a copy of the array before returning it. I can't use this method internally, since there is one place that relies on using the original array. Instead, I will make a internalGetAnalysesResults
method that returns the results without copying them.
@@ -302,7 +302,7 @@ export async function runRemoteQuery( | |||
message: 'Sending request' | |||
}); | |||
|
|||
const workflowRunId = await runRemoteQueriesApiRequest(credentials, 'main', language, repositories, owner, repo, base64Pack, dryRun); | |||
const workflowRunId = await runRemoteQueriesApiRequest(credentials, 'better-errors', language, repositories, owner, repo, base64Pack, dryRun); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking we're intentionally checking this in. Fine if we decided to do that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is broken unless we point to the better-errors
branch. When that branch is merged on qc-run2, then we can change this back to main
. I'll add a comment to that effect.
Removes the limitation specified in #1089 where analyses for the same
repo and different queries will overwrite each other.
This PR does not save analysis results across restarts. After restarting, results will need to be re-downloaded. That is what I will work on next.
Checklist
ready-for-doc-review
label there.The text was updated successfully, but these errors were encountered: