microsoft / sarif-vscode-extension

SARIF Microsoft Visual Studio Code extension
MIT License
107 stars 48 forks source link

Add functionality to download analysis on startup #522

Closed aeisenberg closed 10 months ago

aeisenberg commented 11 months ago

If the sarif-viewer.githubCodeScanningInitialAlert setting has a value, use the contents of the value as the alert to apply. This is meant as a way to automatically apply fixes from a codescanning alert.

Additionally, if this alert has any fixes in it, they are automatically applied. We also need to handle some slight differences in the SARIF format. The fix objects that we are receiving are non-standard. We expect that for each fix, there is a diff in its property bag that contains a git-patch formatted version of the diff to apply.

Lastly, this adds some simple telemetry. It collects that the autofix was applied, whether or not it was successful, and (if unsuccessful) a failure message.

aeisenberg commented 11 months ago

@nickfyson, this should work for downloading autofixes on startup, but of course I can't really test this until we have some sample autofix data to play with.

aeisenberg commented 10 months ago

This PR is ready for review now. I've confirmed that it is working. However, there may need to be some tweaks as we formalize the feature on the code scanning side.

aeisenberg commented 10 months ago

@EasyRhinoMSFT @50Wliu would one of you be able to take a look at this PR? I'm happy to chat about this to explain some of the changes.

aeisenberg commented 10 months ago

I just added two more commits. When reviewing this PR, it will be helpful to review commit-by-commit.