Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,26 @@ if outcome.status != "COMPLETED":

`head_commit_sha` is a full SHA of 40 or 64 hexadecimal characters; any other value raises `ValueError` before a request. A review pinned to another head ends the wait on the read that names it. Its outcome is `INCOMPLETE` whatever the review's own status, its last gap has the reason code `HEAD_COMMIT_MISMATCH`, and `reason` says that the review is pinned to another head commit. A settled review that names no head has `HEAD_COMMIT_UNAVAILABLE` instead and is not `COMPLETED` either. `outcome.review.head_commit_sha` is the commit the review is pinned to. A patch review's head is a derived revision ID, so no commit matches it. In a GitHub Actions `pull_request` job, `GITHUB_SHA` is the merge commit; pass the pull request's head.

## Comparing two reviews

Use `diff_reviews(baseline, current)` to compare two `CustomerReviewDetail` records or `ReviewOutcome` results across matching environment and code scopes. Findings correlate only by retained `finding_fingerprint`; missing or incomplete scopes and un-fingerprinted findings appear explicitly in `scope_gaps` and `uncorrelated_baseline` / `uncorrelated_current` instead of guessing resolution.

```python
from proofline import ProoflineClient, diff_reviews

with ProoflineClient() as client:
baseline = client.get_review(organization_id, baseline_review_id)
current = client.get_review(organization_id, current_review_id)

diff = diff_reviews(baseline, current)
for item in diff.introduced:
print("NEW:", item.scope_name, item.finding.severity, item.finding.claim)
for item in diff.escalated:
print("ESCALATED:", item.scope_name, item.fingerprint)
if not diff.complete:
print("Gaps:", diff.scope_gaps)
```

## Review exports

`export_reviews` reads one CSV or NDJSON page over the bounded transport. Export tokens require `analytics:read`.
Expand Down
18 changes: 18 additions & 0 deletions proofline/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@
from ._transport import VERSION as __version__
from ._transport import ProoflineError, RunNowRefusal
from .client import AsyncProoflineClient, ProoflineClient, ReviewFilters
from .diff import (
FindingDelta,
ReviewDiff,
ScopedFinding,
ScopeGap,
ScopeGapKind,
ScopeKind,
UncorrelatedReason,
diff_reviews,
)
from .exports import ExportDataset, ExportFormat, ExportPage
from .knowledge import KnowledgeResult
from .outcomes import AssessmentGap, CheckGap, ReviewOutcome
Expand All @@ -56,6 +66,7 @@
"ExportPage",
"FileReviewRequest",
"FileReviewResponse",
"FindingDelta",
"KnowledgeResult",
"PatchReviewRequest",
"PatchReviewResponse",
Expand All @@ -65,6 +76,7 @@
"RepositoryGuidance",
"RepositoryNames",
"RerunResponse",
"ReviewDiff",
"ReviewFilters",
"ReviewOutcome",
"ReviewPage",
Expand All @@ -74,10 +86,16 @@
"RunNowResponse",
"ScanRequestBody",
"ScanResponse",
"ScopeGap",
"ScopeGapKind",
"ScopeKind",
"ScopedFinding",
"SecretStr",
"StartSession",
"StopResponse",
"UncorrelatedReason",
"UploadedReport",
"__version__",
"diff_reviews",
"models",
]
Loading