Repository navigation
fix(server): keep Gitea PR diffs consistent after branch updates - #77
Conversation
|
@coderabbitai review |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: RTVision/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (10)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughOpen pull-request diffs can use recorded base and current head revisions. Diff-file loading now carries blob IDs through content requests and cache keys. Gitea verifies returned file contents against those IDs and can try the pull-request base ref for old contents. ChangesGitea pull-request diffs
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change keeps Gitea pull-request diffs and context expansion tied to the revisions shown to the reviewer. Fallbacks to the existing endpoints are preserved, and tests cover them. No concrete merge-blocking risk was found. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change strengthens consistency between displayed diffs and expanded file contents without showing an increase in write privileges or repository access. Older clients and patches without revision identifiers can receive expansion errors. Remaining uncertainty prevents an unconditional minimal-risk assessment. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
|
Problem
Updating a Gitea PR branch can temporarily leave its saved merge base behind the current branch. T3 then displays incoming base-branch files that Gitea excludes from its current PR diff, and marking those files viewed fails with HTTP 422.
Change
Use the fork's raw comparison API with the current base commit and mirrored PR head. Keep historical diffs for closed and merged PRs and existing behavior on hosts without raw comparisons.
Carry the rendered patch's blob IDs into full-file context requests and their cache keys. Gitea accepts only contents matching those IDs, including a bounded fallback to the updated base commit. Context expansion returns an error when the patch lacks required IDs or matching contents are unavailable, so it cannot mix a fresh patch with stale lines. This includes pure renames and mode-only patches that omit index hashes.
Scope and approval
Requested maintainer fix for the RTVision fork, targeting
rtvision. The adapter, contract, and hydration changes address the same comparison mismatch. Web and desktop use the shared loader; other providers retain their existing content requests, and the new wire fields are optional.Verification
vp test run apps/server/src/pullRequest/GiteaPullRequestApi.test.ts apps/web/src/lib/diffFileContents.test.ts packages/client-runtime/src/state/pullRequests.test.ts: 171 tests passed. Coverage includes stale merge bases, source heads ahead of mirrored heads, exact context blobs, missing revision identities, historical/commit diffs, and concurrent expansion requests.Implemented with GPT-6.1 Sol through the Codex harness.