Skip to content

Add audits to ReviewFilters and check review filter parity - #73

Open
Mc3yohan wants to merge 1 commit into
prooflinedev:mainfrom
Mc3yohan:fix/review-filters-audits
Open

Mc3yohan wants to merge 1 commit into
prooflinedev:mainfrom
Mc3yohan:fix/review-filters-audits

Conversation

@Mc3yohan

@Mc3yohan Mc3yohan commented Nov 20, 2026 •

Copy link
Copy Markdown

Problem

openapi.public.json declares the optional audits query parameter ("only" or "none") on both GET /api/v1/organizations/{org_id}/reviews and GET /api/v1/organizations/{org_id}/reviews/pr/{repository}/{pull_request_number}, and both generated endpoint modules (list_reviews and list_pull_request_reviews) as well as @proofline/sdk expose it.

In proofline/client.py, the hand-written ReviewFilters TypedDict used by list_reviews, iter_reviews, and list_pull_request_reviews on ProoflineClient and AsyncProoflineClient omitted audits: str | None. Typed callers using mypy could not pass audits="none" (for example alongside kind="REVISION_SCAN" to list plain revision scans) or audits="only" without static type errors. scripts/contracts.py checked operation names against openapi.public.json but did not check ReviewFilters against the declared review-list query parameters.

Changes

  • Add audits: str | None to ReviewFilters in proofline/client.py.
  • Extend scripts/contracts.py to verify that ReviewFilters keys and field types match the query parameters declared on both review-list endpoints in openapi.public.json.
  • Add HTTP and pagination tests in tests/test_http.py covering audits="none", audits="only", and audits=None across list_reviews, list_pull_request_reviews, and multi-page iter_reviews for both sync and async clients, plus a mypy check against public consumer calls.

Verification

  • Confirmed both scripts/contracts.py and the mypy consumer test fail before adding audits to ReviewFilters and pass after.
  • Ran python scripts/check.py --artifacts artifacts on Ubuntu 24.04 / Python 3.13.12 (GitHub Actions run): generation check, scripts/contracts.py, Ruff lint and format, mypy proofline scripts (214 source files), pytest -q (221 passed, 8 subtests passed), and wheel/sdist scripts/install_smoke.py all passed.

This branch has not been deployed

No deployments
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.

1 participant