Skip to content

fix(pull-requests): preserve native Gitea review pagination - #20

Open
kalvenschraut wants to merge 2 commits into
gitea/encoded-urlsfrom
gitea/review-pagination
Open

fix(pull-requests): preserve native Gitea review pagination#20
kalvenschraut wants to merge 2 commits into
gitea/encoded-urlsfrom
gitea/review-pagination

Conversation

@kalvenschraut

@kalvenschraut kalvenschraut commented Sep 5, 2026

Copy link
Copy Markdown
Member

Review activity now reports when nested Gitea review comments exceed its safety bound. Older Gitea endpoints that return an unpaginated array are read once; explicit pagination headers allow bounded traversal without duplicating comments.

Focused cases cover truncated paginated results, an unpaginated full page, and exactly the safety-bound count. Included in the final 228 passing focused T3 tests. The final integrated server typecheck and targeted lint pass with the stack follow-up #22.

Final stack validation at 256fd6fe5: 228 focused tests passed, followed by 61 API/workflow cases and the final team-recovery regression; server typecheck and targeted lint passed. The live settle-on-merge E2E previously passed with fixture cleanup. Companion Gitea backend and focused integration tests passed, including native revert across all five merge styles.

Model: GPT-5.6 Terra and GPT-6 Astra. Harness: Codex; reviewed with Fable 5.1.

Summary by CodeRabbit

  • Bug Fixes
    • Improved pull request review-comment retrieval with bounded pagination.
    • Prevented duplicate pagination requests when responses lack pagination indicators.
    • Correctly reports when nested review comments are truncated.
    • Preserved complete results when responses fall exactly within the conversation limit.

@kalvenschraut

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 53653e98-802b-4246-8d80-46432d91e3db

📥 Commits

Reviewing files that changed from the base of the PR and between 010e69b and a09a525.

📒 Files selected for processing (3)
  • apps/server/src/pullRequest/GiteaPullRequestApi.test.ts
  • apps/server/src/pullRequest/GiteaPullRequestApi.ts
  • apps/server/src/pullRequest/GiteaPullRequestProvider.activity.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Review comment retrieval now uses bounded pagination with required pagination evidence. The API propagates truncation status and processes returned rows. Tests cover truncation, unpaginated responses, exact safety-bound responses, and updated request parameters.

Changes

Review comment pagination

Layer / File(s) Summary
Bounded review comment retrieval
apps/server/src/pullRequest/GiteaPullRequestApi.ts
readUnknownSlice can require pagination evidence from response headers. listReviews uses bounded comment retrieval, propagates truncation, and processes returned rows.
Pagination behavior validation
apps/server/src/pullRequest/GiteaPullRequestApi.test.ts, apps/server/src/pullRequest/GiteaPullRequestProvider.activity.test.ts
Tests cover paginated requests, truncation after the safety bound, unpaginated responses, exact-boundary responses, and updated request mocks.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to a09a5

Gitea review comments now use bounded pagination and report truncation when necessary, while preserving complete unpaginated responses. The covered behavior has no remaining actionable merge risk.

Sequence Diagram(s)

sequenceDiagram
  participant listReviews
  participant readUnknownSlice
  participant Gitea review-comments endpoint
  listReviews->>readUnknownSlice: Request bounded review comments
  readUnknownSlice->>Gitea review-comments endpoint: Fetch page with page=1 and limit=50
  Gitea review-comments endpoint-->>readUnknownSlice: Return rows and pagination headers
  readUnknownSlice-->>listReviews: Return rows and truncation state
  listReviews->>listReviews: Process returned rows
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: preserving native Gitea review pagination.
Description check ✅ Passed The description explains the change, rationale, test coverage, and validation results. It does not use the template headings or include the required checklist, but the content is sufficiently complete…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gitea/review-pagination

Comment @coderabbitai help to get the list of available commands.

@kalvenschraut
kalvenschraut marked this pull request as ready for review September 5, 2026 05:57
@kalvenschraut

Copy link
Copy Markdown
Member Author

@coderabbitai approve

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved. Approval is disabled; enable reviews.request_changes_workflow to allow explicit top-level @coderabbitai resolve or @coderabbitai approve commands.

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