Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Forgejo pull requests report their head commit #18463

Mergedflamboh(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/18463/headmerged by maria-rcks View on GitHub

Note

🤖 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.

After: tapping line 2 of a Forgejo pull request diff opens the review comment composer

Validation

  • vp test run src/server/ForgejoSourceControlProvider.test.ts: the new assertion fails without the fix and passes with it
  • vp lint and tsc --noEmit for packages/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

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at 9de75e7

      Macroscope'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.
      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Review in Change Stack →

      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.ts
      • packages/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.ts
      getChangeRequest returns the pull request head SHA. The test checks that the detailed pull-request result contains head.

      Priority: ➖ Normal

      Estimated code review effort: 2 (Simple) | ~8 minutes

      Change: Bug fix

      Suggested reviewers: juliusmarminge


      Merge Risk: ⚪ Minimal · up to 9de75

      The 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 9de75

      The change affects 1 system.

      Changed systems: packages/source-control-forgejo

      Architecture 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: getChangeRequest adds 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 | Passed 4
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title checkPassedThe title is concise, uses a conventional commit format, and clearly identifies the main change: Forgejo pull requests now report their head commit.
      Description checkPassedThe 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 checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck 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.
    4. juliusmarminge added labelsmacroscope-review

    5. maria-rcks merged thisb3871d5

    6. maria-rcks closed this

Sign in to join this conversation.