GeezerVison is showing github.com — fix(forgejo): share complete Gitea PR scans across branch lookups by Zheruel · Pull Request #24853 · pingdotgg/t3code
Conversation
Zheruel
commented
Oct 25, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Gitea branch-status lookups now share complete repository scans across branches and worktrees. Gitea 28.2.0 ignores head, so each branch previously paged through every PR.
A snapshot is reusable for one minute, scoped to the resolved server, account, CLI and repository. Explicit refreshes and creation checks bypass it. Pagination completes before results are cached; source identity, arbitrary bases and open/closed/merged selection stay intact. Forgejo servers honoring head keep their existing path.
The direct base/head endpoint cannot replace discovery: local Gitea returned closed PR #1 even while open PR #63 existed for the same base/head.
vp run check:changed passes: 143 tests plus format, lint, knip, affected-package typechecks and generated GraphQL checks. The regression failed on unchanged main; another regression verifies that an explicit refresh finds a newly opened PR after warming the cache.
Measured local QA
Runtime evidence and synthetic fixture.
Both exercised the production provider and CLI HTTP adapter. Installed tea/fj commands and WSL were not tested. No production forge, credentials or T3 state was used. The temporary Gitea container was removed after testing.
Important Cold/expired lookups still require a complete scan. Sharing removes repeated scans across branches. A snapshot can add up to one minute of staleness to the existing branch cache; explicit refreshes remain authoritative.
Closes #23551.
Implemented with GPT-6.1-Sol through the Codex harness in T3 Code.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between e57c093 and 0f65b27.
Files selected for processing: 5
-
apps/server/src/git/GitManager.test.ts
apps/server/src/git/GitManager.ts
packages/source-control-core/src/server/SourceControlProvider.ts
packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts
packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.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
-
Forgejo now caches complete repository pull-request scans for one minute and filters cached results for branch lookups. GitManager passes cache permission to providers and disables provider-cached results on refresh paths.
Changes: Forgejo pull-request lookups
| Layer / File(s) |
Summary |
Repository scan cache and filtering packages/source-control-core/src/server/SourceControlProvider.ts, packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.ts, packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts |
The provider accepts an allowCached option and caches successful complete scans for one minute, with capacity for 16 entries. It filters results by branch, optional source repository and owner, and state. Tests cover cache expiry and bypass, cache identity, pagination, failures, and concurrent lookups. |
GitManager cache policy apps/server/src/git/GitManager.ts, apps/server/src/git/GitManager.test.ts |
GitManager passes cache permission through pull-request lookups and disables provider-cached results when refreshing or retrying after a repository identity change. A Gitea test covers paginated branch lookup and refreshed results. |
Priority: Normal
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Medium
Sequence Diagram(s)
sequenceDiagram
participant GitManager
participant ForgejoSourceControlProvider
participant ForgejoAPI
GitManager->>ForgejoSourceControlProvider: Request pull requests with allowCached
ForgejoSourceControlProvider->>ForgejoSourceControlProvider: Check cached scan and filter results
ForgejoSourceControlProvider->>ForgejoAPI: Fetch pull-request pages when a scan is needed
ForgejoAPI-->>ForgejoSourceControlProvider: Return pull-request pages
ForgejoSourceControlProvider-->>GitManager: Return matching pull requests
Loading
Suggested reviewers: juliusmarminge, saphid
Merge Risk: Minimal · up to 0f65b
-
No merge-blocking issue is established; branch lookups can share a scan, while explicit refreshes can request fresh results.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Description check |
 |
The description explains the problem, the caching approach, scope, issue reference, verification results, limitations, and agent usage. It does not use the template headings, but it provides the requi… |
| Title check |
 |
The title is concise, specific, and accurately describes the main change: sharing complete Gitea pull-request scans across branch lookups in the Forgejo provider. |
| Linked Issues check |
 |
Issue #23551 requires lower request cost for Gitea branch pull-request lookups. The provider now shares a complete repository scan by resolved server, account, CLI, and repository. The scan completes … |
| Out of Scope Changes check |
 |
The changes stay within issue #23551. They add provider scan caching, cache-control propagation, and focused regression tests. The tests support the lookup-cost objective and verify preserved lookup b… |
Full details: Description check
-
Explanation
The description explains the problem, the caching approach, scope, issue reference, verification results, limitations, and agent usage. It does not use the template headings, but it provides the required information in a clear, focused format.
Full details: Linked Issues check
-
Explanation
Issue #23551 requires lower request cost for Gitea branch pull-request lookups. The provider now shares a complete repository scan by resolved server, account, CLI, and repository. The scan completes before caching, joins in-flight scans, and does not retain failed scans. Filtered Forgejo requests keep their existing path. GitManager disables provider caching for refresh and missing-PR refresh paths. Tests cover pagination, branch and source filtering, arbitrary bases, PR states, cache isolation, expiry, refresh, failures, and concurrent scans.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within issue #23551. They add provider scan caching, cache-control propagation, and focused regression tests. The tests support the lookup-cost objective and verify preserved lookup behavior. No unrelated production feature or unrelated test change is demonstrated.
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Note Written by gpt-6.1-sol on behalf of Maria
thanks @Zheruel. your implementation correctly shares only complete scans, preserves source identity and arbitrary bases, and keeps explicit refreshes authoritative.
i rebuilt this as #25568 because maintainer edits are disabled on your fork. it covers the same branch/worktree scan sharing on current main and retains your release credit.
i compared your full original diff against the replacement. no production logic or regression cases were dropped or moved. the pagination fixture now uses 75 prs instead of 3,089, still finding a match beyond page one.
verification: both sharing regressions failed on current main; blacksmith vp run check:changed passed format, lint, knip, generated graphql, 17 affected package typechecks, and 143 tests. a real gitea 1.25.2 instance through installed tea 0.16.0 confirmed warm branch sharing and a fresh explicit refresh after closure. installed fj, wsl, and production credentials remain unverified. no ui changes apply.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Closing in favour of #25569, which makes the same change. Thanks for the work here!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 10, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:M
30-99 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
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.
|