Skip to content

Allow viewing SARIF from query history view #407

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

Merged
merged 4 commits into from
May 28, 2020

Conversation

jcreedcmu
Copy link
Contributor

Addresses the SARIF part of #342. Could still use CSV export.

@github/product-docs-dsp any need for docs for this?

@jcreedcmu jcreedcmu changed the title Jcreed/view sarif Allow viewing SARIF from query history view May 27, 2020
Copy link
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

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

Not a huge deal to keep the function synchronous since file existence is a quick operation, but generally a good idea.

// Mark this query history item according to whether it has a
// SARIF file so that we can make context menu items conditionally
// available.
it.contextValue = element.query.hasInterpretedResults() ? 'interpretedResultsItem' : 'rawResultsItem';
Copy link
Contributor

Choose a reason for hiding this comment

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

Neat.

* Holds if this query actually has produced interpreted results.
*/
hasInterpretedResults(): boolean {
return fs.existsSync(this.resultsPaths.interpretedResultsPath);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this function async? Otherwise, this is blocking.

Copy link
Contributor Author

@jcreedcmu jcreedcmu May 27, 2020

Choose a reason for hiding this comment

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

Ah, I was afraid the getTreeItem had to be synchronous, but it looks like vscode permits it to return a Promise. Happy to make it async then.

@aeisenberg
Copy link
Contributor

And looks like the unit tests caught a legitimate issue that would have been hard to find otherwise. Nice. :)

@jcreedcmu
Copy link
Contributor Author

And looks like the unit tests caught a legitimate issue that would have been hard to find otherwise. Nice. :)

Ah, right, I did leave out the command palette exclusion to see if it would trigger that, then promptly forgot that I had done so. Thankfully, unit tests don't forget :)

@jcreedcmu jcreedcmu merged commit dd9fafc into github:master May 28, 2020
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.

2 participants