Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c13319d
Use sarif parser for reopened results
angelapwen Aug 9, 2022
b3d7e78
Bump unit test timeout to 3 min
angelapwen Aug 15, 2022
c37c5bf
Bump unit test timeout to 5 min
angelapwen Aug 15, 2022
f0d0017
Merge branch 'main' into handle-sarif-reopen
angelapwen Oct 11, 2022
c5a816d
Use sarif parser for reopened results
angelapwen Aug 9, 2022
c1b3ee1
Remove extra import statement
angelapwen Oct 11, 2022
2b6dd6b
Exit parser when invalid SARIF is parsed
angelapwen Oct 11, 2022
169a88a
Reset test timeout to 2 min
angelapwen Oct 11, 2022
fc32971
Add tests for valid and invalid small SARIF files
angelapwen Oct 11, 2022
ca8f930
Add large SARIF file tests
angelapwen Oct 12, 2022
8c92a19
Delete large valid SARIF before invalid test
angelapwen Oct 13, 2022
438607d
Use `del` rather than `unlink`
angelapwen Oct 13, 2022
a07e549
Update imports
angelapwen Oct 13, 2022
9fe8fd8
Close write stream
angelapwen Oct 13, 2022
d656db0
Improve SARIF parser and interpreter tests
angelapwen Oct 19, 2022
dcc51cc
Move interpretedResultsPath to before hook
angelapwen Oct 19, 2022
badbed9
Use safeDel rather than del
angelapwen Oct 19, 2022
6bd649a
Write valid JSON to large valid SARIF test
angelapwen Oct 20, 2022
05c6efe
Remove file deletion in after block
angelapwen Oct 20, 2022
f75f0b7
Use `safeDel` in after hook
angelapwen Oct 20, 2022
f7dc7b7
Attempt 1000 iterations for large tests
angelapwen Oct 21, 2022
50b3109
Sleep 10ms in tests on Windows
angelapwen Oct 21, 2022
fbe0b98
Add missing import
angelapwen Oct 21, 2022
93bd94c
Change stream listeners to close rather than finish
angelapwen Oct 21, 2022
86eaf9d
Write 1mil times for SARIF files
angelapwen Oct 21, 2022
b849fa9
Write to a new path for last test
angelapwen Oct 21, 2022
262fbee
Refactor timeout to before hook
angelapwen Oct 21, 2022
75c8aa3
Revert "Refactor timeout to before hook"
angelapwen Oct 21, 2022
f37bf65
Rename invalid results path
angelapwen Oct 21, 2022
ca0c863
Update results path var name
angelapwen Oct 24, 2022
671f0e2
Add comment explanation
angelapwen Oct 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions extensions/ql-vscode/src/query-results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
import { DatabaseInfo } from './pure/interface-types';
import { QueryStatus } from './query-status';
import { RemoteQueryHistoryItem } from './remote-queries/remote-query-history-item';
import { sarifParser } from './sarif-parser';

/**
* query-results.ts
Expand Down Expand Up @@ -160,10 +161,12 @@ export async function interpretResultsSarif(
sourceInfo?: cli.SourceInfo
): Promise<SarifInterpretationData> {
const { resultsPath, interpretedResultsPath } = resultsPaths;
let res;
if (await fs.pathExists(interpretedResultsPath)) {
return { ...JSON.parse(await fs.readFile(interpretedResultsPath, 'utf8')), t: 'SarifInterpretationData' };
res = await sarifParser(interpretedResultsPath);
Comment thread
angelapwen marked this conversation as resolved.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought....if this function throws an error because the file is not parseable, should we delete the file and re-run cli.interpretBqrsSarif?

Possibly, we can do this as a followup.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, that's a good point 👍 I'll leave this comment up for now, while we work out the last invalid SARIF test issue..

} else {
res = await cli.interpretBqrsSarif(ensureMetadataIsComplete(metadata), resultsPath, interpretedResultsPath, sourceInfo);
}
const res = await cli.interpretBqrsSarif(ensureMetadataIsComplete(metadata), resultsPath, interpretedResultsPath, sourceInfo);
return { ...res, t: 'SarifInterpretationData' };
}

Expand Down