Skip to content

feat: let API clients ask for fewer replies a page - #1594

Draft
simonhamp wants to merge 1 commit into
dev-null-sh:productionfrom
simonhamp:feat/api-replies-limit
Draft

simonhamp wants to merge 1 commit into
dev-null-sh:productionfrom
simonhamp:feat/api-replies-limit

Conversation

@simonhamp

Copy link
Copy Markdown
Contributor

Summary

GET /api/v1/commits/{commit}/replies always sends up to 50 replies and ignores limit. The mobile app shows a thread's replies ten at a time (NativePHP/dev-null-app#179), so it fetches 50 and throws most away. The web's replies endpoint already takes limit.

Changes

ListApiCommitRepliesRequest accepts limit from 1 to 50, the same rule as ListCommitRepliesRequest, and the controller passes it to CommitRepliesQuery::paginate(). 50 stays the default. withQueryString() already carries limit onto the next cursor link. One sentence in KNOWLEDGE_BASE.md under the signed API.

Validation

Local, PHP 8.5.12, PostgreSQL with its own test database:

  • vendor/bin/pint --test on the changed files: pass
  • phpstan: pass, no errors
  • tests/Feature/Controllers/Api/CommitReplyControllerTest.php and tests/Feature/Controllers/CommitReplyControllerTest.php: pass. New tests cover a page of 10, the next page keeping the limit, and 0, 51 and a non-number getting 422.
  • Whole suite, serially with --ci: 6126 tests, 6107 passed and 19 failed. All 19 are in tests/Feature/CommitScriptTest.php and fail the same way on unchanged production here (the shell script sandbox doesn't run on this machine), so they are not from this change. The suite ran with all three of my API PRs merged together.
  • Coverage: not run, there is no coverage driver (pcov or Xdebug) on this machine.

Independent review

A read-only Claude review agent with the repo's .ai/guidelines and the diff against production at 2ef29e7, head 9494578: CODE: PASS.

Limitations

None.

GET /api/v1/commits/{commit}/replies always sent up to 50 replies and
ignored limit. It now takes limit from 1 to 50, as the web's replies
endpoint does, and keeps 50 as the default. The cursor links keep the limit.
@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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