Skip to content

Report progress during MRVA results download#1803

Closed
robertbrignull wants to merge 3 commits intomainfrom
robertbrignull/downloadProgress
Closed

Report progress during MRVA results download#1803
robertbrignull wants to merge 3 commits intomainfrom
robertbrignull/downloadProgress

Conversation

@robertbrignull
Copy link
Copy Markdown
Contributor

[Draft / work in progress]

Report the progress of the download of results. See internal issue for more info.

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

@robertbrignull robertbrignull force-pushed the robertbrignull/downloadProgress branch from 2805714 to f813b5a Compare December 14, 2022 15:52
@robertbrignull
Copy link
Copy Markdown
Contributor Author

The code in this PR is updated for the jest migration, but it still has the bug with the mocked fetch:

TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received type number (80)
    at new NodeError (node:internal/errors:371:5)
    at Function.from (node:buffer:325:9)
    at VariantAnalysisResultsManager.download (/Users/robertbrignull/github/vscode-codeql/extensions/ql-vscode/src/remote-queries/variant-analysis-results-manager.ts:101:42)
    at async VariantAnalysisManager.autoDownloadVariantAnalysisResult (/Users/robertbrignull/github/vscode-codeql/extensions/ql-vscode/src/remote-queries/variant-analysis-manager.ts:538:9)
    at async Object.<anonymous> (/Users/robertbrignull/github/vscode-codeql/extensions/ql-vscode/src/vscode-tests/cli-integration/remote-queries/variant-analysis-manager.test.ts:470:11)

const response = await fetch(repoTask.artifactUrl);
let amountDownloaded = 0;
for await (const chunk of response.body) {
appendFileSync(zipFilePath, Buffer.from(chunk));

Check warning

Code scanning / CodeQL

Network data written to file

Write to file system depends on [Untrusted data](1).
@koesie10
Copy link
Copy Markdown
Member

See #2014 for fixed tests and some other fixes.

@koesie10 koesie10 closed this Jan 26, 2023
@robertbrignull robertbrignull deleted the robertbrignull/downloadProgress branch February 2, 2023 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants