test: expand Forgejo review fixtures #18
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/forgejo-auto-pr-review!18
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-8-fixture-coverage"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements #8.\n\nAdds realistic mocked Forgejo PR, files, comments, and API-error fixtures, plus a fixture-driven end-to-end review test.\n\nCloses #8.
Automated code review
Reviewed commit:
e120ada67201e1968e02fc478992fec53c946b40Verdict: Ready to merge
No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.
Overall assessment
Refactors reviewer tests to consume JSON fixtures and introduces a mock API handler. Adds a targeted assertion verifying that API secrets are not leaked in HTTP error messages.
Blocking findings
None.
Important findings
None.
Suggestions
if url.endswith("/pulls/42"): ... if url.endswith("/issues/42/comments"):
Impact: Mock may fail to match expected endpoints if API routing changes, base URLs are updated, or query parameters are appended in production.
Suggested fix: Use
urllib.parse.urlparseto extract and compare exact path components, or define explicit route constants for maintainability.Tests and validation
Questions
fixture_apifunction need to handle pagination tokens or additional query parameters that might be appended to Forgejo API URLs in production?max_diff_bytes, or rate-limit responses?Review limitations
reviewer.pyfunctions likeapi_requestandollama_reviewwas not reviewed.Diff coverage
tests/fixtures/forgejo_api_error.json: reviewed — included in a context-limited batchtests/fixtures/pull_request.json: reviewed — included in a context-limited batchtests/fixtures/pull_request_comments.json: reviewed — included in a context-limited batchtests/fixtures/pull_request_files.json: reviewed — included in a context-limited batchtests/test_reviewer.py: reviewed — included in a context-limited batchReview metadata