Repository navigation
Conversation
Project a review the caller already holds with the same closed rules as the CLI findings --sarif command, including locations, gaps, and refusals. Co-authored-by: Edmundo Sanchez <eddi@heyeddi.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
review_sarifprojects one retained pull-request review into a SARIF 2.1.0 document. Both clients already return the review; this is the closed projection the CLI writes withproofline findings --sarif.Why
The CLI already defines this document for GitHub code scanning and other SARIF 2.1.0 consumers, and neither SDK exposes it, so every Python caller would have to rebuild the projection. The rules are easy to get wrong: a location counts only when it is a verified file at the reviewed head, an unknown severity or risk domain is refused, a partial CODE record still contributes findings but makes the invocation unsuccessful, and a withheld or off-commit CODE record contributes none.
The projection follows the CLI rather than inventing a second one:
errorandwarning. Anything else, including a severity this build does not know, refuses the export.executionSuccessfulis true only for a complete review with no notifications.SUPERSEDEDis an incomplete result, matching the CLI.wait_for_reviewstill reports that status asSTOPPED.A deployment, patch, or other subject, a head that is not a 40- or 64-character commit SHA, or a review id that does not match the record raises
SarifExportErrorand returns no document.No generated client, OpenAPI document, or workflow file is changed.
How it's tested
tests/test_sarif.pycovers:ProoflineClient.get_reviewpython3 scripts/check.pypassed: generation freshness, operation contracts,ruff check,ruff format --check,mypy,pytest(143 passed), and wheel plus sdist install smoke tests.