fix(server): Forgejo pull requests report their head commit #18463
main fromrefs/pull/18463/head·merged by maria-rcks View on GitHubNote
🤖 Claude Opus 5.5 on behalf of Oliver
Problem#
Mobile can't leave line comments on Forgejo or Gitea pull requests. The diff screen ties each line comment to the pull request's head commit, and the Forgejo provider never reported one: getChangeRequest dropped pr.head.sha, even though it already reads it to load commit statuses. With no head commit, tapping a line or choosing Add review comment did nothing.
Fix#
The Forgejo detail read now returns headSha: pr.head.sha, as the GitHub, GitLab, and GitCafe providers already do. The existing detail test asserts it.
Evidence#
iOS simulator against a local Forgejo 11 instance, on a pull request opened by another user.
Before: tapping a diff line, or Add review comment in the diff menu, does nothing. Logging the diff screen showed diffHead.sha: null with every other comment permission true.
After: tapping a line opens the comment composer, and the saved comment submits with the review.

Validation#
vp test run src/server/ForgejoSourceControlProvider.test.ts: the new assertion fails without the fix and passes with itvp lintandtsc --noEmitforpackages/source-control-forgejo- On the simulator, submitted a Request changes review with a line comment to Forgejo, which recorded it with one comment
Related: #18455 handles Forgejo's summary rule for those reviews, which this fix makes reachable on mobile.
Made with Claude Opus 5.5 in Claude Code, running in T3 Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Approved at
9de75e7Macroscope's review found this PR approvable — This is a focused Forgejo bug fix that exposes an already-supported head commit field and adds a regression assertion. Its runtime impact is limited to enabling existing diff-comment behavior for Forgejo pull requests, with no schema or configuration risk.
Notes:
- All code in this push has already been reviewed. Approvability was decided on eligibility alone.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
8fbf5e64-1435-402d-aa4e-d360b8e585a0
📥 Commits
-
Reviewing files that changed from the base of the PR and between 397a46123999ada6b9ddcbe85534631a241bb0ed and 9de75e7e85efd181008d5eec081825a785c97dd1.
📒 Files selected for processing (2)
-
packages/source-control-forgejo/src/server/ForgejoPullRequestProvider.tspackages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
-
📝 Walkthrough
-
Walkthrough#
Forgejo pull-request details now include the head commit SHA. The mergeability test checks that the returned detail contains the expected SHA.
Changes#
Forgejo pull request details
Layer / File(s) Summary Return and verify the head SHA
packages/source-control-forgejo/src/server/ForgejoPullRequestProvider.ts,packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.tsgetChangeRequestreturns the pull request head SHA. The test checks that the detailed pull-request result containshead.Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
Merge Risk: ⚪ Minimal · up to
9de75The Forgejo detail now includes the pull request’s head commit, and the server can include it in the response. No concrete merge-blocking risk is evident.
Architecture Summary#
Architecture risk: 🔵 Low · up to
9de75The change affects 1 system.
Changed systems:
packages/source-control-forgejoArchitecture concerns No architecture-level concerns identified.
Review details
-
Systems and components
- observed — packages/source-control-forgejo (library) was modified; 2 changed files map to changed impact.
Before / after behavior
- observed — Modified behavior in packages/source-control-forgejo/src/server/ForgejoPullRequestProvider.ts:
getChangeRequestadds the pull request’s head SHA to the returned change-request detail. - observed — Modified behavior in packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts: The test now checks that the detailed pull-request result has head SHA
"head".
Pre-merge checks |
4-
✅ Passed checks (4 passed)
-
Check name Status Explanation Title check The title is concise, uses a conventional commit format, and clearly identifies the main change: Forgejo pull requests now report their head commit. Description check The description clearly explains the problem, fix, user impact, evidence, validation steps, and related work. It does not use the template's exact section names and has no separate Scope and approval … Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request.
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment `@coderabbitai help` to get the list of available commands.-
coderabbitai[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge added labelsmacroscope-review
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
maria-rcks merged thisb3871d5
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed