Skip to content

feat(pull-requests): support native Gitea team reviewers - #21

Merged
kalvenschraut merged 9 commits into
gitea/review-paginationfrom
gitea/team-reviewers
Sep 8, 2026
Merged

kalvenschraut merged 9 commits into
gitea/review-paginationfrom
gitea/team-reviewers

Conversation

@kalvenschraut

@kalvenschraut kalvenschraut commented Sep 5, 2026 •

Copy link
Copy Markdown
Member

Gitea reviewer selection now includes repository teams and sends native team-name review requests. The reviewing list includes PRs requested from the viewer’s teams, using paginated membership reads cached for one minute. Personal repositories continue listing user reviewers.

Keeps team membership inside the Gitea adapter and preserves shared user-reviewer models. Focused cases cover requested teams, native request payloads, personal repositories, and membership pagination; included in 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

  • New Features

    • Added support for team-based pull request reviewers and review requests.
    • Team review requests now appear in “reviewing” filters and reviewer candidate lists.
    • Pull request details include requested team names and IDs.
    • Team membership data is loaded efficiently and supports paginated results.
  • Bug Fixes

    • Improved compatibility with Gitea instances where team endpoints are unavailable.
    • Updated pagination and reviewer handling for more reliable results.

@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: 40ffc930-6ab6-4fec-a537-d40b803ace2d

📥 Commits

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

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

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


📝 Walkthrough

Walkthrough

Changes

Gitea team reviewer support

Layer / File(s) Summary
Team reviewer contract and matching
apps/server/src/pullRequest/GiteaPullRequestApi.ts, apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts
The API decodes team reviewers and exposes their IDs and names. Reviewing matches include requested teams. Fixtures include the new fields.
Viewer team retrieval and filtering
apps/server/src/pullRequest/GiteaPullRequestApi.ts, apps/server/src/pullRequest/GiteaPullRequestApi.test.ts
Cached, paginated viewer-team retrieval supports search-backed and native reviewing listings. Tests cover pagination and team-based matches.
Reviewer candidate loading and fallback
apps/server/src/pullRequest/GiteaPullRequestApi.ts, apps/server/src/pullRequest/GiteaPullRequestApi.test.ts
Reviewer candidates include teams and users. HTTP 405 team endpoints return user candidates without failure. Tests cover requested team selection and fallback behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: 🟡 Moderate · up to bf2bd

This adds native Gitea team reviewer support, but unresolved server schema-inference/typecheck corrections remain in the current change. Merge after those corrections are included or explicitly accepted.

Sequence Diagram(s)

sequenceDiagram
  participant Viewer
  participant GiteaPullRequestApi
  participant GiteaTeamsEndpoint
  participant GiteaPullRequestsEndpoint
  Viewer->>GiteaPullRequestApi: Request reviewing pull requests
  GiteaPullRequestApi->>GiteaTeamsEndpoint: Fetch paginated viewer teams
  GiteaTeamsEndpoint-->>GiteaPullRequestApi: Return viewer team IDs
  GiteaPullRequestApi->>GiteaPullRequestsEndpoint: Fetch pull requests
  GiteaPullRequestsEndpoint-->>GiteaPullRequestApi: Return requested team reviewers
  GiteaPullRequestApi-->>Viewer: Return matching reviewing pull requests
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 2 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 the primary change: native Gitea team reviewer support.
Description check ✅ Passed The description clearly explains the change, rationale, implementation scope, tests, and validation results. It does not use the template headings or include the checklist, but the required informatio…
  • 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/team-reviewers

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: bf2bdc7622c2f328af84409e8d4ca6df2e8c1750.

  • 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/review-pagination.
  • 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.

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 approve

The maintainer requests formal approval for the remaining PRs. Please assess the exact current head bf2bdc7622c2f328af84409e8d4ca6df2e8c1750 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.

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

Tip

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== HEAD =='
git rev-parse HEAD
printf '%s\n' '== STATUS =='
git status --short
printf '%s\n' '== DIFF STAT AGAINST BASE =='
git diff --stat gitea/review-pagination...HEAD
printf '%s\n' '== DIFF =='
git diff --find-renames --find-copies --unified=80 gitea/review-pagination...HEAD -- \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts

printf '%s\n' '== SOURCE OUTLINE =='
ast-grep outline apps/server/src/pullRequest/GiteaPullRequestApi.ts --items all
printf '%s\n' '== TEST OUTLINE =='
ast-grep outline apps/server/src/pullRequest/GiteaPullRequestApi.test.ts --items all

Length of output: 1361


⚙️ CodeRabbit configuration inspected

Length of output: 5505


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== REFS =='
git branch -a
printf '%s\n' '== PARENTS =='
git show --no-patch --format='commit=%H%nparents=%P%nsubject=%s' HEAD
printf '%s\n' '== CHANGED FILES IN HEAD COMMIT =='
git diff-tree --no-commit-id --name-status -r HEAD
printf '%s\n' '== COMMIT DIFF =='
git show --format=fuller --find-renames --find-copies --unified=100 HEAD -- \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts

printf '%s\n' '== SOURCE OUTLINE =='
ast-grep outline apps/server/src/pullRequest/GiteaPullRequestApi.ts --items all
printf '%s\n' '== TEST OUTLINE =='
ast-grep outline apps/server/src/pullRequest/GiteaPullRequestApi.test.ts --items all

Length of output: 21586


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="$(git merge-base origin/main HEAD)"
printf 'merge_base=%s\n' "$base"
printf '%s\n' '== COMMITS SINCE MERGE BASE =='
git log --reverse --format='%H %s' "${base}..HEAD"
printf '%s\n' '== COMPLETE PR DIFF =='
git diff --find-renames --find-copies --unified=60 "${base}...HEAD" -- \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts

printf '%s\n' '== SOURCE: PARSING AND PAGINATION HELPERS =='
sed -n '58,490p' apps/server/src/pullRequest/GiteaPullRequestApi.ts
printf '%s\n' '== SOURCE: API IMPLEMENTATION =='
sed -n '666,1260p' apps/server/src/pullRequest/GiteaPullRequestApi.ts
printf '%s\n' '== SOURCE: REVIEWER OPERATIONS =='
sed -n '1960,2070p' apps/server/src/pullRequest/GiteaPullRequestApi.ts
printf '%s\n' '== FOCUSED TESTS =='
sed -n '1,520p' apps/server/src/pullRequest/GiteaPullRequestApi.test.ts

Length of output: 214707


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== TEAM REVIEWER COMMIT =='
git show --format=fuller --find-renames --find-copies --unified=45 de4d24c535f7bd6a73ae358b099c5ce3419fda91 -- \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts
printf '%s\n' '== ERROR-DECODING FIX COMMIT =='
git show --format=fuller --unified=30 bf2bdc7622c2f328af84409e8d4ca6df2e8c1750 -- \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts

printf '%s\n' '== TEAM-REVIEWER TEST LOCATIONS =='
rg -n -C 8 'requested_reviewers_teams|team_reviewers|user/teams|listTeamReviewerCandidates|viewer team' \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts

Length of output: 71518


🤖 web_search executed:

Gitea OpenAPI documentation API v1: add or remove pull request reviewers with team_reviewers, list repository teams, list authenticated user teams. Confirm the endpoint paths and whether team_reviewers accepts team names or IDs.

Length of output: 16048


@kalvenschraut No formal approval can be submitted.

I reviewed bf2bdc7622c2f328af84409e8d4ca6df2e8c1750. One blocker remains.

  • apps/server/src/pullRequest/GiteaPullRequestApi.ts Line 2006 reads /repos/{owner}/{repo}/teams with readUnknownArray. That helper reads one response page only. The request does not send page or limit. Gitea paginates repository team lists. A repository with more teams than the server default page size omits later teams from reviewer selection. The returned truncated flag also does not report this omission.

Use the paginated reader for repository teams. Include page and limit. Propagate team-list truncation with the user-reviewer truncation state. Add a test where the requested team is on the second repository-team page.

Gitea documents paginated team lists and accepts team names in team_reviewers: review requests and viewer teams.

The repository configuration sets reviews.request_changes_workflow: false. This setting disables formal @coderabbitai approve actions.

You are interacting with an AI system.

@kalvenschraut

Copy link
Copy Markdown
Member Author

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

Reviewed head: bf2bdc7622c2f328af84409e8d4ca6df2e8c1750; declared destination: gitea/review-pagination.

  • Codex: NO-GO. Mandatory getViewerTeamIDs calls make the whole Reviewing list fail when /user/teams fails. Target Gitea explicitly rejects public-only tokens on that route, although public PR reads/user matching can work. Degrade optional team enrichment to an empty set so user-requested reviews remain visible; test a rejected team read. Corrections to other reviews: repository GET /teams uses reqAnyRepoReader, not reqAdmin, and ListTeams returns all repository teams without pagination. Fable’s admin-only claim and CodeRabbit’s missing-pagination claim are therefore not valid for v1.27.3. Router, team handler.
  • Fable 5.1 / Claude CLI: NO-GO, completed independent review of bf2bdc7622c2.
  • 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.

@coderabbitai Please withdraw the repository-team pagination finding using the linked native handler; retain the separate public-only-token failure finding until fixed.

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.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Tip

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

🧩 Analysis chain

🤖 web_search executed:

Gitea v1.27.3 routers/api/v1/repo/teams.go ListTeams GET /repos/{owner}/{repo}/teams pagination implementation

Length of output: 10604


@kalvenschraut The repository-team pagination finding is withdrawn.

Gitea v1.27.3 GET /repos/{owner}/{repo}/teams calls organization.GetRepoTeams and returns the complete team list. The handler does not support page or limit. The prior request to paginate this endpoint was incorrect.

The separate /user/teams public-only-token failure concern remains unresolved.


✏️ Learnings added
Learnt from: kalvenschraut
URL: https://github.com/RTVision/t3code/pull/21

Timestamp: 2026-09-07T05:50:09.507Z
Learning: For Gitea v1.27.3, `GET /repos/{owner}/{repo}/teams` is protected by `reqAnyRepoReader`, not `reqAdmin`. Its `repo.ListTeams` handler calls `organization.GetRepoTeams` without pagination and returns all repository teams. Do not require client-side pagination for this endpoint.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

You are interacting with an AI system.

@kalvenschraut

Copy link
Copy Markdown
Member Author

NO-GO — scoped tokens can lose the Reviewing list

Reviewed commit: bf2bdc7622c2f328af84409e8d4ca6df2e8c1750.

Codex and Claude Fable 5.1 both block this change. GiteaPullRequestApi.ts makes getViewerTeamIDs mandatory at the Reviewing-list call sites. When a token can read PRs but /user/teams is denied, the entire list fails, including directly assigned review requests. The same behavior remains in #36.

Handle unavailable team membership without discarding direct review assignments; represent partial coverage where appropriate. Add a focused test for a denied team lookup with readable directly assigned PRs, then re-review.

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 146d2c6b6b8c2bb525628f6df879ee07fee686ed 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

requested='146d2c6b6b8c2bb525628f6df879ee07fee686ed'

printf '%s\n' '== HEAD AND REQUESTED COMMIT =='
git rev-parse HEAD
git show --no-patch --format='commit=%H%nparents=%P%nsubject=%s' "$requested"

printf '%s\n' '== STATUS =='
git status --short

printf '%s\n' '== DIFF FOR REQUESTED COMMIT =='
git show --find-renames --find-copies --unified=80 --format=fuller "$requested" -- \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts

printf '%s\n' '== CHANGED FILES SINCE PR BASE =='
base="$(git merge-base origin/gitea/review-pagination "$requested")"
printf 'base=%s\n' "$base"
git diff --name-status "$base...$requested"

printf '%s\n' '== SOURCE OUTLINE =='
ast-grep outline apps/server/src/pullRequest/GiteaPullRequestApi.ts --items all

printf '%s\n' '== VIEWER TEAM CALL SITES AND ERROR HANDLING =='
rg -n -C 12 --glob 'GiteaPullRequestApi.ts' \
  'getViewerTeamIDs|user/teams|reviewRequestTeamIDs|reviewRequestTeamNames|Promise\.allSettled|catch\s*\(' \
  apps/server/src/pullRequest

printf '%s\n' '== RELEVANT IMPLEMENTATION =='
sed -n '360,520p' apps/server/src/pullRequest/GiteaPullRequestApi.ts
sed -n '880,1220p' apps/server/src/pullRequest/GiteaPullRequestApi.ts
sed -n '1940,2090p' apps/server/src/pullRequest/GiteaPullRequestApi.ts

printf '%s\n' '== TEST OUTLINE =='
ast-grep outline apps/server/src/pullRequest/GiteaPullRequestApi.test.ts --items all

printf '%s\n' '== RELEVANT TESTS =='
rg -n -C 18 --glob 'GiteaPullRequestApi.test.ts' \
  'user/teams|viewer team|reviewing|requested_reviewers_teams|team_reviewers|405|denied|forbidden|partial' \
  apps/server/src/pullRequest

printf '%s\n' '== CODERABBIT CONFIGURATION FILES =='
fd -HI 'coderabbit\.ya?ml|\.coderabbit\.ya?ml' . -x sh -c 'echo "== $1 =="; cat "$1"' sh {} \;

Length of output: 7535


🏁 Script executed:

#!/bin/bash
set -euo pipefail

requested='146d2c6b6b8c2bb525628f6df879ee07fee686ed'
parent_one='ca97a942a068039ad27cd7ecb080deed93dc958c'
parent_two='ef4238824778653c9dba037c4fc7032232ca8e54'

printf '%s\n' '== MERGE DIFF VS FIRST PARENT =='
git diff --find-renames --find-copies --unified=80 "$parent_one" "$requested" -- \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts

printf '%s\n' '== MERGE DIFF VS SECOND PARENT =='
git diff --find-renames --find-copies --unified=80 "$parent_two" "$requested" -- \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts

printf '%s\n' '== ALL COMMITS REACHABLE FROM HEAD NOT FIRST PARENT =='
git log --reverse --format='%H %s' "$parent_one..$requested"

printf '%s\n' '== SOURCE OUTLINE =='
ast-grep outline apps/server/src/pullRequest/GiteaPullRequestApi.ts --items all

printf '%s\n' '== VIEWER-TEAM IMPLEMENTATION AND CALL SITES =='
rg -n -C 16 --glob 'GiteaPullRequestApi.ts' \
  'getViewerTeamIDs|user/teams|reviewRequestTeamIDs|reviewRequestTeamNames|reviewing|catchAll|catch\s*\(' \
  apps/server/src/pullRequest

printf '%s\n' '== REVIEWER CANDIDATE IMPLEMENTATION =='
sed -n '1930,2105p' apps/server/src/pullRequest/GiteaPullRequestApi.ts

printf '%s\n' '== FOCUSED TEST LOCATIONS =='
rg -n -C 22 --glob 'GiteaPullRequestApi.test.ts' \
  'user/teams|viewer team|reviewing|requested_reviewers_teams|team_reviewers|denied|forbidden|partial|GiteaApiError' \
  apps/server/src/pullRequest

printf '%s\n' '== ACTIVE CODERABBIT CONFIGURATION =='
fd -HI -t f -g 'coderabbit.yaml' -g 'coderabbit.yml' -g '.coderabbit.yaml' -g '.coderabbit.yml' . \
  -x sh -c 'echo "== $1 =="; cat "$1"' sh {}

printf '%s\n' '== GITHUB PR STATE =='
gh pr view 21 --repo RTVision/t3code --json number,headRefName,headRefOid,baseRefName,state,isDraft,reviewDecision,reviews,comments \
  --jq '{number, headRefName, headRefOid, baseRefName, state, isDraft, reviewDecision, reviews: [.reviews[] | {author: .author.login, state, commit: .commit.oid}], comments: [.comments[] | {author: .author.login, body}]}'

Length of output: 180358


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== CODERABBIT CONFIGURATION =='
if [ -f .coderabbit.yaml ]; then
  cat .coderabbit.yaml
elif [ -f .coderabbit.yml ]; then
  cat .coderabbit.yml
else
  echo 'No root CodeRabbit configuration file found.'
fi

printf '%s\n' '== PULL REQUEST LIST PAGE CONTRACT =='
rg -n -C 12 --glob '*.ts' \
  'truncated:\s*(boolean|true|false)|readonly truncated|interface .*Page|type .*Page' \
  apps packages

printf '%s\n' '== TRUNCATION CONSUMERS =='
rg -n -C 10 --glob '*.ts' \
  '\.truncated\b|truncated\b' \
  apps/server/src apps/web/src apps/desktop/src packages

printf '%s\n' '== LIST PULL REQUEST SERVICE SIGNATURE =='
sed -n '490,680p' apps/server/src/pullRequest/GiteaPullRequestApi.ts

printf '%s\n' '== FULL TEAM-LOOKUP FALLBACK AND LIST RETURNS =='
sed -n '1000,1048p' apps/server/src/pullRequest/GiteaPullRequestApi.ts
sed -n '940,992p' apps/server/src/pullRequest/GiteaPullRequestApi.ts
sed -n '1210,1275p' apps/server/src/pullRequest/GiteaPullRequestApi.ts

Length of output: 201517


@kalvenschraut No formal approval is submitted for 146d2c6b6b8c2bb525628f6df879ee07fee686ed.

The direct-review regression is fixed. The new test verifies that a denied /user/teams request does not remove directly assigned Reviewing items.

One blocker remains:

  • apps/server/src/pullRequest/GiteaPullRequestApi.ts Line 1010 converts every getViewerTeamIDs failure to an empty set. The Reviewing list then omits team-requested pull requests, but it can return truncated: false. This reports complete coverage when team membership was unavailable. The fallback also suppresses malformed responses, pagination-limit failures, and transient failures for the one-minute cache period.

Keep direct-review matches. Also preserve partial coverage. Return team-membership availability with the cached result, and set truncated: true in both Reviewing-list paths when team membership could not be read. Add focused tests for native and search-backed Reviewing lists that assert direct matches are returned and truncated is true after a denied /user/teams request.


🧠 Learnings used
Learnt from: kalvenschraut
URL: https://github.com/RTVision/t3code/pull/21

Timestamp: 2026-09-07T05:50:09.516Z
Learning: For Gitea v1.27.3, `GET /repos/{owner}/{repo}/teams` is protected by `reqAnyRepoReader`, not `reqAdmin`. Its `repo.ListTeams` handler calls `organization.GetRepoTeams` without pagination and returns all repository teams. Do not require client-side pagination for this endpoint.

You are interacting with an AI system.

@kalvenschraut

Copy link
Copy Markdown
Member Author

Re-review: NO-GO — team lookup failure loses coverage information

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

Denied team lookup now preserves directly assigned Reviewing items, which repairs the original all-or-nothing failure. The fallback also converts every failure to an empty team set without retaining availability information; team-assigned items disappear while the list may report complete coverage. CodeRabbit withholds approval, and Codex verified the loss of availability information.

Fable 5.1: GO; accepts the direct-review fallback and warns that truncated is a pagination flag. Codex and CodeRabbit still require honest team-coverage information.

Keep the direct matches and represent unavailable team membership honestly in both native and search-backed Reviewing results. Distinguish partial coverage from a usable next-page cursor; simply forcing a continuation flag can create another pagination problem. Cover denied and failed team reads.

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: bf4b4ec1fbb7917896ea0f8110c8fd19daaec5c0. This supersedes my previous decision on the older head.

Team lookup failures retain direct review requests and expose partial-coverage warnings through API, provider, service, web listing, continuation pages, and cached snapshots. Partial coverage does not fabricate a pagination cursor or disable the project filter.

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:55Z. 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