You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(forgejo): fork pull requests are found whatever letter case the remote URL uses - #49358
When a local git remote URL uses different letter casing than Forgejo or Gitea's canonical owner name (for example alice vs Alice), the owner:branch lookup drops the fork pull request on both head=-filtered servers and servers that ignore head= (Gitea and older Forgejo). A lone pull request on that branch is still found through GitManager's bare-branch fallback. The miss shows when another pull request with the same branch name was updated more recently, because the open lookup asks for one result (limit: 1). This was found by code inspection of ForgejoSourceControlProvider.listChangeRequests alongside the existing case-insensitive owner and repository comparisons in GitManager, forgejoPullRequests.ts, and createRepository.
ForgejoSourceControlProvider.listChangeRequests now normalizes expected and returned head repository full names and owner logins with .toLowerCase() before comparing, while keeping branch names (headRefName) case-sensitive.
Verification
Updated the fork fixture in the existing reads only the changed front of a Gitea pull request list it has read before test in packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts to use mixed-case Alice/renamed / Alice against the existing alice:feature lookups.
Before fix on 5a0ef1a848 (vp test run packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts -t "reads only the changed front of a Gitea pull request list it has read before"): failed at find("alice:feature") with AssertionError: expected [] to deeply equal [ [ 5, 'open' ] ].
After fix on b00b3e25e5 (vp test run packages/source-control-forgejo): passed (7 test files, 41 tests).
vp run check:changed on b00b3e25e5: passed (format, lint, knip, i18n, typecheck across 12 packages, test across 2 files / 23 tests).
Tests kept: updated existing fixture casing in packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts (0 added cases, 0 net test lines).
Macroscope's review found this PR approvable — Forgejo fork pull requests can now match remote repository and owner names regardless of letter case. The change is limited to listing filters and preserves existing branch and state constraints.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between b00b3e2 and d524b38.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
listChangeRequests now matches source repository and owner names without regard to case. Branch matching remains case-sensitive, and repository and owner checks remain conditional on their source values being present.
listChangeRequests compares lowercased source repository and owner names. The test fixture uses uppercase Alice while retaining the alice:feature selector assertions.
Fork pull requests are now matched even when the owner or repository name differs in casing from the server's canonical form. No actionable merge risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the Forgejo fix: fork pull requests are now found regardless of the letter case in the remote URL. This matches the main change in ForgejoSourceControlProvider.listChangeRequests, whic…
Description check
The description follows the template structure with Problem, Change, Scope, and Verification sections, and it fills in each one. The Problem section explains the casing mismatch and the limit: 1 looku…
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.
Full details: Title check
Explanation
The title names the Forgejo fix: fork pull requests are now found regardless of the letter case in the remote URL. This matches the main change in ForgejoSourceControlProvider.listChangeRequests, which compares source repository and owner names case-insensitively. The title follows conventional commit style and is specific.
Full details: Description check
Explanation
The description follows the template structure with Problem, Change, Scope, and Verification sections, and it fills in each one. The Problem section explains the casing mismatch and the limit: 1 lookup miss. The Change section states the case-insensitive owner and repository comparison with branch names kept case-sensitive. The Scope section does not link an issue or state why no issue is needed, and the template asks for that. The Verification section gives before/after test results, check results, and the tests kept. Minor gaps: no linked issue or explanation for its absence, and the template's note on agent model and harness is partly covered by the 'Generated with' line.
Resolution
Optional: add a Scope note that links the bug report or explains why no issue is needed. Verification is otherwise complete.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Seeded real Forgejo maria/project and Alice/project and Bob/project forks; both forks have feature branches. Opened Alice PR #1, then 21 newer Bob PRs (#2–#22), closing #2–#21 and leaving #22 open. On each commit, created a fresh app project, fetched upstream and the lowercase alice/project.git remote, checked out feature tracking alice/feature, seeded one Replay thread, opened it directly, and inspected Version Control. Base displayed Create PR; head displayed #1: Alice feature.
Environment: scenarios:prove drove the real web dev app and server on both commits with fresh isolated databases, a 1280×800 browser viewport and light theme. Real Docker Forgejo 14.0.5, real Gitea CLI 2.1.0 authenticated as Alice, identical seeded forge data, and Replay (dev) for the thread. No mocked forge responses. Final runner exit 0; screenshots and recordings inspected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a local git remote URL uses different letter casing than Forgejo or Gitea's canonical owner name (for example
alicevsAlice), theowner:branchlookup drops the fork pull request on bothhead=-filtered servers and servers that ignorehead=(Gitea and older Forgejo). A lone pull request on that branch is still found throughGitManager's bare-branch fallback. The miss shows when another pull request with the same branch name was updated more recently, because the open lookup asks for one result (limit: 1). This was found by code inspection ofForgejoSourceControlProvider.listChangeRequestsalongside the existing case-insensitive owner and repository comparisons inGitManager,forgejoPullRequests.ts, andcreateRepository.ForgejoSourceControlProvider.listChangeRequestsnow normalizes expected and returned head repository full names and owner logins with.toLowerCase()before comparing, while keeping branch names (headRefName) case-sensitive.Verification
reads only the changed front of a Gitea pull request list it has read beforetest inpackages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.tsto use mixed-caseAlice/renamed/Aliceagainst the existingalice:featurelookups.5a0ef1a848(vp test run packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts -t "reads only the changed front of a Gitea pull request list it has read before"): failed atfind("alice:feature")withAssertionError: expected [] to deeply equal [ [ 5, 'open' ] ].b00b3e25e5(vp test run packages/source-control-forgejo): passed (7test files,41tests).vp run check:changedonb00b3e25e5: passed (format,lint,knip,i18n,typecheckacross 12 packages,testacross 2 files / 23 tests).packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts(0 added cases, 0 net test lines).Generated with Gemini 4 Neon in T3 Code Nightly