Skip to content

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

Merged
kalvenschraut merged 5 commits into
gitea/encoded-urlsfrom
gitea/review-pagination
Sep 8, 2026
Merged

kalvenschraut merged 5 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 and concisely describes preserving native Gitea review pagination, which is the main change in the pull request.
Description check ✅ Passed The description explains the pagination behavior, safety-bound handling, backward compatibility, test coverage, and validation results. It does not use the template headings or include the checklist, …
  • 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.

@kalvenschraut

Copy link
Copy Markdown
Member Author

Merge verdict: NO-GO (review gates incomplete).

Head: a09a525142247cd748df67026c1b374ba2d2888f.

  • Codex: NO-GO for merging under the requested two-reviewer gate. Merge readiness and review history were checked; the full dual code review is incomplete, and this comment is not a code approval.
  • Fable 5.1 / Claude CLI: BLOCKED. The requested claude-fable-5-1 review was attempted, but the CLI reached its session limit before returning a completed verdict. Its reported reset is midnight America/Chicago. There is no fresh Fable GO from this pass.
  • CodeRabbit: No formal APPROVED review. The successful CodeRabbit status check does not satisfy the requested approval gate. This branch has not enabled reviews.request_changes_workflow; the existing CodeRabbit replies on this series identify that configuration as preventing formal approvals.
  • GitHub merge state: MERGEABLE / CLEAN against gitea/encoded-urls.
  • Checks: the current rollup contains a successful CodeRabbit status only; it contains no build/test check result. No new tests or browser verification are claimed by this audit.

Confirmed code blocker at apps/server/src/pullRequest/GiteaPullRequestApi.ts:982-992: with requirePaginationEvidence, a full headerless inline-comment page forces paginationNext to null and returns truncated: false. That reports an uncertain/capped response as complete. Carry the conservative truncation correction from #36 and its regression coverage when preparing this slice.

No merge performed. Resume the independent code reviews when Fable is available, obtain the missing/current CodeRabbit approval where applicable, and recheck the exact head and base before merging.

@kalvenschraut

Copy link
Copy Markdown
Member Author

@coderabbitai review

The maintainer requests formal approval for the remaining PRs. Please assess the exact current head a09a525142247cd748df67026c1b374ba2d2888f and submit APPROVED only if your review has no remaining blockers. If there is a blocker, leave its concrete reason and the fix required instead. A successful status check alone does not meet this merge gate.

Known NO-GO reason to verify: The full headerless inline-comment page can still be reported complete; #36 contains the conservative truncation correction. Please do not approve while it remains unresolved.

If branch configuration prevents formal approval, please state that explicitly. Independent Codex/Fable code verdicts are being refreshed separately; this request does not authorize merging or bypassing their findings.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== HEAD =='
git rev-parse HEAD
git status --short

echo '== Source outline =='
ast-grep outline apps/server/src/pullRequest/GiteaPullRequestApi.ts --items all --match 'readUnknownSlice|review|comment' --view expanded || true

echo '== Pagination implementation and caller context =='
rg -n -C 12 'readUnknownSlice|requirePaginationEvidence|paginationNext|truncated' \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts

echo '== Focused test outline =='
ast-grep outline apps/server/src/pullRequest/GiteaPullRequestApi.test.ts --items all --match 'review|pagination|truncat' --view expanded || true

echo '== Focused test cases =='
rg -n -C 10 'truncat|pagination|Link|X-Total-Count|review.*comment|comment.*review' \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts

echo '== PR 36 metadata and changed-file patches =='
gh pr view 36 --repo RTVision/t3code --json number,state,title,headRefOid,baseRefName,url 2>&1 || true
gh pr diff 36 --repo RTVision/t3code -- apps/server/src/pullRequest/GiteaPullRequestApi.ts apps/server/src/pullRequest/GiteaPullRequestApi.test.ts 2>&1 || true

Length of output: 40539


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== Pagination constants and helper definitions =='
rg -n -C 12 'PAGE_SIZE|CONVERSATION_PAGES|const nextPagePath|function nextPagePath|const nextLink|const totalCount' \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts

echo '== Current ambiguous-response test bodies =='
sed -n '940,1080p' apps/server/src/pullRequest/GiteaPullRequestApi.test.ts

echo '== PR 20 changed-file patch =='
gh api 'repos/RTVision/t3code/pulls/20/files?per_page=100' \
  --jq '.[] | select(.filename == "apps/server/src/pullRequest/GiteaPullRequestApi.ts" or .filename == "apps/server/src/pullRequest/GiteaPullRequestApi.test.ts") | "FILE: \(.filename)\n\(.patch // "<patch unavailable>")\n"' \
  2>&1 || true

echo '== PR 36 relevant patches =='
gh api 'repos/RTVision/t3code/pulls/36/files?per_page=100' \
  --jq '.[] | select(.filename == "apps/server/src/pullRequest/GiteaPullRequestApi.ts" or .filename == "apps/server/src/pullRequest/GiteaPullRequestApi.test.ts") | "FILE: \(.filename)\n\(.patch // "<patch unavailable>")\n"' \
  2>&1 || true

echo '== CodeRabbit review workflow configuration =='
gh api 'repos/RTVision/t3code/contents/.coderabbit.yaml?ref=a09a525142247cd748df67026c1b374ba2d2888f' --jq '.content' 2>/dev/null | base64 --decode 2>/dev/null || true
gh api 'repos/RTVision/t3code/contents/.coderabbit.yml?ref=a09a525142247cd748df67026c1b374ba2d2888f' --jq '.content' 2>/dev/null | base64 --decode 2>/dev/null || true

Length of output: 82498


@kalvenschraut I reviewed commit a09a525142247cd748df67026c1b374ba2d2888f.

I cannot approve this PR. One blocker remains.

readUnknownSlice identifies a possible next page for a headerless 50-row response. It then removes that next page when requirePaginationEvidence is enabled. At Line 992, it returns truncated: false.

listReviews enables requirePaginationEvidence for nested inline review comments. Therefore, a full headerless inline-comment page can be incomplete but is reported as complete.

The current tests do not cover this case. They cover headerless responses with 51 and 200 rows. Those responses are not the ambiguous single-page case because PAGE_SIZE is 50.

Apply the conservative correction from #36:

  • When a nested inline-comment response has exactly PAGE_SIZE rows and has no Link or total-count header, set truncated: true.
  • Preserve the current behavior that avoids a duplicate request for an unpaginated response.
  • Add regression tests for a headerless first page and a headerless final bounded page.

Formal approval is also unavailable for this PR configuration. .coderabbit.yaml does not enable reviews.request_changes_workflow, and the prior command response confirms that approval is disabled.

⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

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.

@kalvenschraut

Copy link
Copy Markdown
Member Author

Merge verdict: NO-GO. This supersedes the earlier quota-only readiness comment.

Reviewed head: a09a525142247cd748df67026c1b374ba2d2888f; declared destination: gitea/encoded-urls.

  • Codex: NO-GO. GiteaPullRequestApi.ts:992 reports truncated: false for exactly 50 headerless inline comments after discarding the inferred next page. Completeness is unknown. Keep the single request but report this ambiguous full page as truncated, with first-page and final-page regressions as in fix(pull-requests): reconcile Gitea and dependency stack integration #36. Codex and CodeRabbit independently confirmed this; Fable’s GO missed the exactly-50 case.
  • Fable 5.1 / Claude CLI: GO, completed independent review of a09a52514224.
  • CodeRabbit: No formal GitHub APPROVED review on this head. Approval was requested. Some bot replies say “Approved” or contain [approve], but the GitHub review records do not contain an approval; this does not pass the requested gate. The original branch configuration does not enable reviews.request_changes_workflow.

Where Fable returned GO, the concrete Codex blocker above still prevents merging. The follow-up request to reconcile findings hit the CLI session limit; no revised Fable verdict is claimed.

Validation: 339 focused integrated PR tests plus 502 cross-provider tests passed at integration head 6114cf39; the integrated server typecheck passed. These checks validate the integrated implementation, not every earlier PR snapshot. The original #12 compiler failure was reproduced separately.

No merge is authorized while any blocker or required approval is outstanding. Recheck the resulting head and current base after corrections or stack merges.

@kalvenschraut

Copy link
Copy Markdown
Member Author

NO-GO now — pagination completeness and type fixes required

Reviewed commit: a09a525142247cd748df67026c1b374ba2d2888f.

Exactly 50 rows without pagination headers can be reported as truncated: false, although completeness is unknown. #36 corrects that ambiguity; #22 fixes the inherited type errors. Fable gives conditional GO with both; Codex holds this head.

Include the conservative completeness handling and inference fixes. #36 itself retains separate blockers, so it is not currently an approved merge vehicle.

Validation by Codex: the exact #36 integration head 6114cf39dac017bd665908effd538e5f4f8d5764 passed 1,002 tests across 39 affected files, scoped server/web/desktop typechecks, and targeted lint (warnings, no errors). These are integration results, not a claim that this standalone head passed those checks. Fable independently reviewed source and diffs via Claude CLI; it did not run the tests.

Reviewers: Codex and Claude Fable 5.1 (Claude CLI).

@kalvenschraut

Copy link
Copy Markdown
Member Author

@coderabbitai review

Please independently review the newly pushed fixes at ef4238824778653c9dba037c4fc7032232ca8e54 and submit a formal GitHub approval on this head only if no blockers remain. Otherwise report the remaining actionable findings. The maintainer requested fresh CodeRabbit approval before merging; an older approval or a green skipped-review status does not satisfy that gate. Codex and Claude Fable 5.1 are separately re-reviewing the changes, including the prior no-go findings in this PR.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

expected='ef4238824778653c9dba037c4fc7032232ca8e54'

echo '== checked-out head =='
git rev-parse HEAD
git status --short
git show -s --format='%H%n%P%n%s' HEAD

echo '== PR metadata =='
gh pr view 20 --repo RTVision/t3code --json number,state,isDraft,headRefOid,baseRefName,url,changedFiles 2>&1 || true

echo '== changes from prior reviewed head =='
git diff --stat a09a525142247cd748df67026c1b374ba2d2888f "$expected" -- \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestProvider.activity.test.ts
git diff --find-renames --unified=80 a09a525142247cd748df67026c1b374ba2d2888f "$expected" -- \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestProvider.activity.test.ts

echo '== pagination definitions, control flow, and callers =='
rg -n -C 16 'PAGE_SIZE|CONVERSATION_PAGES|readUnknownSlice|requirePaginationEvidence|paginationNext|truncated|listReviews' \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts

echo '== relevant test locations =='
rg -n -C 10 'headerless|pagination|truncat|PAGE_SIZE|review comments|inline comments|X-Total-Count|Link' \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts

echo '== type-related changes in the new commits =='
git log --oneline a09a525142247cd748df67026c1b374ba2d2888f.."$expected"
git diff --name-status a09a525142247cd748df67026c1b374ba2d2888f "$expected"

echo '== CodeRabbit review workflow configuration at requested commit =='
for f in .coderabbit.yaml .coderabbit.yml; do
  if git cat-file -e "$expected:$f" 2>/dev/null; then
    echo "--- $f ---"
    git show "$expected:$f"
  fi
done

Length of output: 185459


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='ef4238824778653c9dba037c4fc7032232ca8e54'
base=$(gh pr view 20 --repo RTVision/t3code --json baseRefOid --jq .baseRefOid)
echo "== base and merge-base =="
printf 'base=%s\n' "$base"
merge_base=$(git merge-base "$base" "$head")
printf 'merge-base=%s\n' "$merge_base"

echo '== complete changed files and whitespace check =='
git diff --name-status "$merge_base" "$head"
git diff --check "$merge_base" "$head"

echo '== maps for modified Gitea provider and contract adapter files =='
for f in \
  apps/server/src/pullRequest/GiteaPullRequestProvider.ts \
  apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts \
  apps/server/src/pullRequest/PullRequestProvider.ts \
  apps/server/src/pullRequest/GiteaConversation.ts \
  apps/server/src/pullRequest/GiteaWorkflows.ts; do
  if [ -f "$f" ]; then
    echo "--- outline: $f ---"
    ast-grep outline "$f" --items all --view expanded || true
  fi
done

echo '== GiteaPullRequest model consumers =='
rg -n -C 5 'relationshipHeadBranch|headBranchAvailable|baseRepositoryNameWithOwner|baseRepositoryId|headRepositoryId|relationshipOnly' \
  apps/server/src

echo '== complete current pagination and relationship implementation =='
sed -n '975,1195p' apps/server/src/pullRequest/GiteaPullRequestApi.ts
sed -n '1265,1415p' apps/server/src/pullRequest/GiteaPullRequestApi.ts

echo '== provider use of added Gitea pull request fields =='
rg -n -C 12 'GiteaPullRequestApi|relationshipHeadBranch|headBranchAvailable|baseRepository|headRepository|relationshipOnly' \
  apps/server/src/pullRequest/GiteaPullRequestProvider.ts \
  apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts

echo '== configuration change =='
git diff --unified=30 "$merge_base" "$head" -- .coderabbit.yaml

Length of output: 112325


@kalvenschraut I reviewed commit ef4238824778653c9dba037c4fc7032232ca8e54.

The prior pagination blocker is fixed. A headerless nested inline-comment page with exactly 50 rows now reports truncated: true. The code does not send a duplicate pagination request. The tests cover both the first ambiguous page and the final bounded page.

I found no remaining actionable blocker.

The current PR head has no net changed files against gitea/encoded-urls. Its base commit is a parent of the reviewed merge commit. I could not run tests, builds, or typechecks in this review environment.

The current .coderabbit.yaml enables reviews.request_changes_workflow. Formal approval is available.

[approve]

You are interacting with an AI system.

@kalvenschraut

Copy link
Copy Markdown
Member Author

Re-review: GO on the pagination repair; NO-GO for merging now

Reviewed head: ef4238824778653c9dba037c4fc7032232ca8e54. This updates my earlier go/no-go comment for the newly pushed repairs.

The headerless full-page completeness fix is now present. This head has the same tree as its declared base, so it adds no net code. CodeRabbit approves the reviewed result.

Fable 5.1: GO on the individual change.

Clear the inherited #9/#10/#12 behavior defects and the #5 integration conflict before merging the native-stack prefix.

Validation by Codex: 308 focused tests across 9 files passed on integration head 73dd9c33ab15db71748beb6f0485ec212e6682f8; scoped server, web, and client-runtime typechecks passed, and targeted lint of 21 changed files passed with warnings. A separate single-worker reproduction exposed the native comment-reaction bug (100 reads and no reactions for a 50-reaction comment). These are integration results, not a claim that every standalone head passed the checks. Fable reviewed source and diffs through Claude CLI; it did not run tests.

The remaining native-stack merges must clear their predecessors and the actual target branch. CodeRabbit’s commit-specific comments are distinguished from formal GitHub review records; rate-limited requests are not approvals.

@kalvenschraut

kalvenschraut commented Sep 8, 2026 •

Copy link
Copy Markdown
Member Author

GO — merged after Codex, Fable 5.1, and CodeRabbit review.

Reviewed head: c5f5e62d094faef54c42dd7d43b860aa2221c72e. This supersedes my previous decision on the older head.

The new regression verifies that later reviews share the remaining 200-row inline-comment budget rather than resetting it.

CodeRabbit reviewed every exact head and cleared the combined integration. Its commit-specific approval is recorded in that comment; this is not a claim of a new formal GitHub APPROVED review on each PR. All three reviewers require #26 to land with #27 or later; they merged together in the dependency batch.

Validation by Codex: 490 focused tests across 13 files passed on integration head 2e156ad621fb32b241abd4614a367aea7943d12e, including the previously failing native comment-reaction reproduction. Scoped server, web, and client-runtime typechecks passed; targeted lint of 24 changed files passed with warnings. Checks ran sequentially with one test worker. These validate the integration, not separate test runs on every component head. Fable independently reviewed source and diffs via Claude CLI.

Merged: f787a611cffccbdf0fd5e593bba8f615c607f532 at 2026-09-08T04:42:54Z. This PR merged in the 17-member Gitea batch into rtvision; the six dependency PRs followed as one reviewed batch. Final rtvision commit is 20926b20ed4ea72618f7608f70b1d4cea8e40053; its tree 9a0e0253b515456f6a117be5ebccf2cd8e911b01 exactly matches tested integration head #36.

@kalvenschraut
kalvenschraut merged commit f787a61 into rtvision Sep 8, 2026
1 check passed
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