Code Review
Last updated
What reviewers check, how to review, responder etiquette, and when a maintainer merges.
On this page
comic-dl’s reviews are shaped by three constraints that generic review culture misses:
- Every outbound fetch passes an SSRF guard (
validate_request_urlviaBaseScraper._timeout_get/_open_streamin architecture). A newrequests.get()waved past this is a SSRF hole. - Rate limiting and retry cooldowns are load-bearing. New scraping paths
must ride the existing throttle (
rate.py) and cooldown, never bypass them. - Tests are offline-only. A live-request test corrupts deterministic CI.
The checklist
Structure and scope
- PR targets
dev, notmain/staging. - One concern per PR; reviewable in one sitting.
-
Fixes #NNpresent when the PR closes an issue. - Template’s Type and Site(s) affected filled in.
Correctness
- Code does what the issue says, not just what the diff shows.
- Partial failures (some chapters fail, others pass) don’t abort the run.
- Reuses existing abstractions (scraper contract, download pipeline, archiver) rather than a new parallel implementation.
Safety (non-negotiable)
- New fetches go through SSRF-guarded helpers; redirects re-validated.
- No loosening of
rate.pyor the shared retry cooldown. - New writes stay inside the output path; archives stay atomic
(
.tmp+ rename). - No new hardcoded credentials or cookie keys.
- Challenge-solving stays opt-in (
solverdefaults tooff). - No real-work URLs or series identifiers in tests/examples/docs.
Tests
- Bug fixes have a regression test failing on the old code.
- New sites have a parser test under
tests/scrapers/sites/(offline). - Assertions use
output.replace("\n", ""), never raw capture (Rich folds at 80 cols on CI); machine JSON prints withsoft_wrap=True. - No
Path()whileos.nameis mocked. - New tests actually run in CI (not skipped).
Docs
- Site/CLI changes regenerated docs (
update-sites-docs.pyfor tables,docs.shfor mirror + lint). - No aspirational claims — docs describe exact output.
Reviewing a site scraper PR
- Registered —
--list-sourcesshows it. - URL routing: supported shapes accepted, others rejected with clear error.
- Pagination/chapter numbering follows the site’s actual pattern.
- Tests cover a parsed fixture: chapter list, series page, pagination, and an edge case (missing title, empty list).
How to review
- Read the PR title and issue first; read the diff as a story (routing → scraper → download → archive → library).
- Comment inline and specific — quote the line.
- Run the checklist mechanically; a blank field is a comment.
- Run
./scripts/test.shand./scripts/lint.shlocally if you can. - Approve with scope stated.
Responding to reviews
Treat comments as questions first. Fix what the checklist flags, re-run the gates, push new commits. Never force-push away the conversation while review is in flight.
When to merge (maintainers)
Squash-merge only when the checklist is green and CI is green. main advances
only by release commits — a direct push to main is a release decision
(releasing).