Skip to content

refactor(source-control): Forgejo lives in @t3tools/source-control-forgejo - #17581

Merged
juliusmarminge merged 2 commits into
t3/source-control-packagesfrom
t3/source-control-forgejo
Oct 9, 2026
Merged

juliusmarminge merged 2 commits into
t3/source-control-packagesfrom
t3/source-control-forgejo

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Adding or changing a source control host means editing modules spread across apps/server/src/sourceControl and apps/server/src/pullRequest, and both registries name every host. This is the second layer of moving each host into its own package. It stacks on #17573.

  • Forgejo's CLI client (ForgejoCli), repository provider, pull request provider, and JSON decoding move into @t3tools/source-control-forgejo, one subpath per module. The package depends only on @t3tools/source-control-core and reaches the server through SourceControlHost.
  • source-control-core/server/driver defines SourceControlDriver: a host's kind plus an Effect that yields its repository provider, discovery spec, and pull request provider. The package exports driver.
  • The server lists drivers in BUILT_IN_SOURCE_CONTROL_DRIVERS. Both SourceControlProviderRegistry and PullRequestProviderRegistry iterate it, so neither names Forgejo any more. The other hosts join the list one layer at a time.
  • @t3tools/source-control-testing adds TestSourceControlHost for package tests.
  • The diff revision parser that Forgejo and Bitbucket share moves to core as diffFileRevisions.

Tests move with their code, with only imports and wiring changed. The Forgejo tests now run against TestSourceControlHost instead of a mocked VcsProcess. The generic discovery tests and the real-git fj checkout test stay in the server.

Behavior is unchanged. Forgejo still appears last in discovery.

Verified with tsc (apps/server and the three packages), knip, and 59 test files (1405 tests).

🤖 Generated with Claude Code — Claude Opus 5.5 in T3 Code

@juliusmarminge
juliusmarminge added this pull request to stack #17582 October 9, 2026 19:29
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Oct 9, 2026
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 9, 2026
@github-actions github-actions Bot added the size:L 100-499 changed lines (additions + deletions). label Oct 9, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This is a broad cross-package source-control architecture refactor that changes production layer composition and how both provider registries construct Forgejo support. Although the Forgejo implementation and tests are largely relocated, the new driver contract, host boundary, and shared registry wiring warrant human review.

Notes:

  • All code in this push has already been reviewed. Approvability was decided on eligibility alone.

No code changes detected at 6e8ae5b. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 5.0 KiB — 6.8 KiB ✅
Codex Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅
Codex Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Codex Live turn WebSocket decoded — 20.9 KiB — 29.3 KiB ✅
Codex Live turn messages — 2 — 8 ✅
Claude Total thread wire — 5.0 KiB — 6.8 KiB ✅
Claude Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅
Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Claude Live turn WebSocket decoded — 21.2 KiB — 29.3 KiB ✅
Claude Live turn messages — 1 — 8 ✅

Baseline: unavailable · PR result: 6e8ae5b · Source CI: success

Scenario and decoded snapshot size

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

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@juliusmarminge
juliusmarminge force-pushed the t3/source-control-forgejo branch from 46f1cb5 to d60f314 Compare October 9, 2026 19:33
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

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: Team
  • Run ID: 1e356065-a336-437f-920a-5c302236c6c0

📥 Commits

Reviewing files that changed from the base of the PR and between 3208826 and 6e8ae5b.


⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

📒 Files selected for processing (30)
  • apps/server/package.json
  • apps/server/scripts/evaluate-thread-titles.ts
  • apps/server/src/git/GitManager.test.ts
  • apps/server/src/pullRequest/BitbucketPullRequestApi.ts
  • apps/server/src/pullRequest/PullRequestProviderRegistry.ts
  • apps/server/src/pullRequest/PullRequestService.test.ts
  • apps/server/src/server.ts
  • apps/server/src/sourceControl/SourceControlDiscovery.test.ts
  • apps/server/src/sourceControl/SourceControlProviderRegistry.test.ts
  • apps/server/src/sourceControl/SourceControlProviderRegistry.ts
  • apps/server/src/sourceControl/builtInDrivers.ts
  • apps/server/src/ws.ts
  • package.json
  • packages/source-control-core/package.json
  • packages/source-control-core/src/server/diffFileRevisions.test.ts
  • packages/source-control-core/src/server/diffFileRevisions.ts
  • packages/source-control-core/src/server/driver.ts
  • packages/source-control-forgejo/package.json
  • packages/source-control-forgejo/src/server/ForgejoCli.ts
  • packages/source-control-forgejo/src/server/ForgejoPullRequestProvider.ts
  • packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts
  • packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.ts
  • packages/source-control-forgejo/src/server/driver.ts
  • packages/source-control-forgejo/src/server/forgejoPullRequestJson.ts
  • packages/source-control-forgejo/src/server/forgejoPullRequests.ts
  • packages/source-control-forgejo/tsconfig.json
  • packages/source-control-testing/package.json
  • packages/source-control-testing/src/TestSourceControlHost.ts
  • packages/source-control-testing/tsconfig.json
  • scripts/release-smoke.ts

💤 Files with no reviewable changes (3)
  • packages/source-control-forgejo/src/server/forgejoPullRequestJson.ts
  • packages/source-control-core/src/server/diffFileRevisions.ts
  • packages/source-control-forgejo/src/server/forgejoPullRequests.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.



📝 Walkthrough

Walkthrough

The change adds a shared source-control driver contract, moves Forgejo into a workspace package, and updates server registries to construct providers from built-in drivers. It also adds Forgejo provider tests and a reusable source-control host test package.

Changes

Forgejo Driver Package

Layer / File(s) Summary
Shared driver contract and parser
packages/source-control-core/..., apps/server/src/pullRequest/BitbucketPullRequestApi.ts
The source-control core exports a driver contract and package paths for the contract and diff-revision parser. The Bitbucket API and parser test use the shared parser path.
Forgejo package and host integration
packages/source-control-forgejo/*, packages/source-control-testing/*, apps/server/src/sourceControl/SourceControlDiscovery.test.ts, apps/server/src/git/GitManager.test.ts, apps/server/src/pullRequest/PullRequestService.test.ts, apps/server/src/sourceControl/SourceControlProviderRegistry.test.ts, apps/server/package.json, package.json, scripts/release-smoke.ts
Forgejo provider modules use SourceControlHost for process execution and expose a driver. The new package includes provider tests and package configuration. The testing package adds a configurable host layer and process-output helper. Server tests and workspace tooling use the package exports and manifests.
Built-in driver registration
apps/server/src/sourceControl/builtInDrivers.ts, apps/server/src/sourceControl/SourceControlProviderRegistry.ts, apps/server/src/pullRequest/PullRequestProviderRegistry.ts, apps/server/src/server.ts, apps/server/src/ws.ts, apps/server/scripts/evaluate-thread-titles.ts
The source-control and pull-request registries construct providers from built-in drivers. Server, WebSocket, and script layer composition uses the built-in driver layer.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor

Sequence Diagram(s)

sequenceDiagram
  participant Registry as SourceControlProviderRegistry
  participant Drivers as SourceControlBuiltInDrivers
  participant Forgejo as ForgejoDriver
  Registry->>Drivers: make each built-in driver
  Drivers->>Forgejo: construct driver instance
  Forgejo-->>Registry: return provider and discovery
Loading

Suggested reviewers: maria-rcks


Merge Risk: ⚪ Minimal · up to 6e8ae

Forgejo support moves into its own package without any intended behavior change. The server now registers Forgejo through a shared built-in driver list. No concrete defects were identified, so this is ready to merge after normal checks.

Pre-merge checks | Passed 3 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check Warning The description explains the problem, implementation, affected packages, unchanged behavior, and verification results. It does not provide the required scope-and-approval information, such as a triage… Add a Scope and approval section. Link the triaged issue or maintainer discussion and include explicit approval for the direction and scope. If no approval is required, explain why this focused refactor qualifies for an exemption.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the primary change: moving Forgejo source-control support into the dedicated package.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

Full details: Description check

Explanation

The description explains the problem, implementation, affected packages, unchanged behavior, and verification results. It does not provide the required scope-and-approval information, such as a triaged issue with explicit maintainer approval or an exemption rationale.



  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • 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.

juliusmarminge and others added 2 commits October 9, 2026 14:38
…rgejo

Forgejo's CLI client, repository provider, pull request provider and JSON
decoding move into their own package, which depends only on
@t3tools/source-control-core. The package exports a driver; the server
lists it in BUILT_IN_SOURCE_CONTROL_DRIVERS, and both registries iterate
that list, so Forgejo is no longer named in either registry.

- @t3tools/source-control-testing adds TestSourceControlHost for package
  tests.
- The diff revision parser Forgejo and Bitbucket share moves to core as
  diffFileRevisions.
- Forgejo's tests move with it; the generic discovery tests and the
  real-git checkout test stay in the server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… in the release smoke workspace

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge
juliusmarminge force-pushed the t3/source-control-forgejo branch from 3208826 to 6e8ae5b Compare October 9, 2026 21:41
@juliusmarminge
juliusmarminge merged commit f6e4502 into main Oct 9, 2026
34 of 54 checks passed
@juliusmarminge
juliusmarminge deleted the t3/source-control-forgejo branch October 9, 2026 21:50
Moinax added a commit to Moinax/t3code that referenced this pull request Oct 9, 2026
Upstream moved `ForgejoSourceControlProvider` to
`@t3tools/source-control-forgejo` (pingdotgg#17581). The rename carried the fork's
one-line `head=` hunk across, but not the fork's test: it stayed behind in
`apps/server/src/sourceControl/`, importing two siblings that no longer sit
there, and upstream's own test file already owns the package's canonical name.

Moved it next to the provider under a distinct name, and swapped the stale
`VcsProcess` mock for the `TestSourceControlHost` harness the package tests
now use — the provider yields `SourceControlHost`, not `VcsProcess`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Oct 10, 2026
## What's Changed
* chore(deps): upgrade Effect to 4.0.2 by @juliusmarminge in pingdotgg/t3code#17571
* fix(devices): recover stalled video without losing simulator input by @juliusmarminge in pingdotgg/t3code#17566
* fix(web): keep checkout stable while pr actions load by @maria-rcks in pingdotgg/t3code#16625
* fix(mobile): show waiting thread status by @maria-rcks in pingdotgg/t3code#16693
* feat(web): add parent thread breadcrumb navigation by @maria-rcks in pingdotgg/t3code#16666
* fix(server): restart inactivity after snoozed threads wake by @maria-rcks in pingdotgg/t3code#16674
* feat(desktop): passkeys in the in-app browser on macOS by @juliusmarminge in pingdotgg/t3code#16952
* fix(client): load earlier turns works for MCP threads over T3 Connect by @juliusmarminge in pingdotgg/t3code#17599
* refactor(client): sign relay request URLs built from the HttpApi contract by @juliusmarminge in pingdotgg/t3code#17602
* refactor(source-control): add @t3tools/source-control-core by @juliusmarminge in pingdotgg/t3code#17573
* refactor(source-control): Forgejo lives in @t3tools/source-control-forgejo by @juliusmarminge in pingdotgg/t3code#17581
* refactor(source-control): Azure DevOps lives in @t3tools/source-control-azure-devops by @juliusmarminge in pingdotgg/t3code#17592
* refactor(source-control): GitLab lives in @t3tools/source-control-gitlab by @juliusmarminge in pingdotgg/t3code#17594
* refactor(source-control): Bitbucket lives in @t3tools/source-control-bitbucket by @juliusmarminge in pingdotgg/t3code#17597
* refactor(source-control): GitHub lives in @t3tools/source-control-github by @juliusmarminge in pingdotgg/t3code#17607
* refactor(usage): transcript readers come from their drivers by @juliusmarminge in pingdotgg/t3code#17576
* refactor(usage): OpenCode usage comes from provider-opencode by @juliusmarminge in pingdotgg/t3code#17577
* refactor(usage): Cursor account usage comes from provider-cursor by @juliusmarminge in pingdotgg/t3code#17578
* refactor(usage): Antigravity usage is a reader on its driver by @juliusmarminge in pingdotgg/t3code#17579
* refactor(usage): usage readers use Effect FileSystem and SqlClient by @juliusmarminge in pingdotgg/t3code#17615
* fix(web): composer context strip pads both edges evenly by @limineol in pingdotgg/t3code#17562
* test(usage): v4 cache upgrade test waits for the migrated cache write by @Mnigos in pingdotgg/t3code#17553
* feat(mobile): support Duo in the shared iOS app by @juliusmarminge in pingdotgg/t3code#12648
* refactor(source-control): GitManager reads provider resolvers, not host kinds by @juliusmarminge in pingdotgg/t3code#17617
* refactor(source-control): PullRequestService reads GitHub resolvers, not its kind by @juliusmarminge in pingdotgg/t3code#17619
* refactor(source-control): Forgejo identity and Azure DevOps addressing move into their packages by @juliusmarminge in pingdotgg/t3code#17624
* refactor: home directory comes from a HostProcessHomeDirectory reference by @juliusmarminge in pingdotgg/t3code#17628
* refactor(shared): host process references live in a HostProcess module by @juliusmarminge in pingdotgg/t3code#17641
* feat(web): filter PR comments by bots and resolved threads by @juliusmarminge in pingdotgg/t3code#17645
* fix(clients): remove redundant prefix from PR watch status by @extoci in pingdotgg/t3code#17635
* fix(web): pending requests wait until you stop typing by @maria-rcks in pingdotgg/t3code#17637
* fix(models): remove new badges from Claude Opus and Sonnet 5.5 by @extoci in pingdotgg/t3code#17646
* fix(ui): keep focus and selection borders visible across the app by @maria-rcks in pingdotgg/t3code#16675
* fix(mobile): prevent row presses during native back swipes by @juliusmarminge in pingdotgg/t3code#17648
* fix(server): Codex shadow homes replace stray sqlite maintenance locks by @juliusmarminge in pingdotgg/t3code#17663
* feat(desktop): T3 Code can be your default web browser on macOS by @juliusmarminge in pingdotgg/t3code#17587
* test(server): the ACP process-tree test no longer collides with the runner's own pid by @yordis in pingdotgg/t3code#17647
* fix(web): keep branch restore action inline in narrow composers by @Saikrishna1876 in pingdotgg/t3code#14811
* fix(web): composer banner actions stay inline whenever they fit by @maria-rcks in pingdotgg/t3code#17640


**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261009.2886...v0.0.46-nightly.20261010.2908

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261010.2908
github-actions Bot added a commit to davidvanderklay/t3code-flake that referenced this pull request Oct 10, 2026
## What's Changed
* chore(deps): upgrade Effect to 4.0.2 by @juliusmarminge in pingdotgg/t3code#17571
* fix(devices): recover stalled video without losing simulator input by @juliusmarminge in pingdotgg/t3code#17566
* fix(web): keep checkout stable while pr actions load by @maria-rcks in pingdotgg/t3code#16625
* fix(mobile): show waiting thread status by @maria-rcks in pingdotgg/t3code#16693
* feat(web): add parent thread breadcrumb navigation by @maria-rcks in pingdotgg/t3code#16666
* fix(server): restart inactivity after snoozed threads wake by @maria-rcks in pingdotgg/t3code#16674
* feat(desktop): passkeys in the in-app browser on macOS by @juliusmarminge in pingdotgg/t3code#16952
* fix(client): load earlier turns works for MCP threads over T3 Connect by @juliusmarminge in pingdotgg/t3code#17599
* refactor(client): sign relay request URLs built from the HttpApi contract by @juliusmarminge in pingdotgg/t3code#17602
* refactor(source-control): add @t3tools/source-control-core by @juliusmarminge in pingdotgg/t3code#17573
* refactor(source-control): Forgejo lives in @t3tools/source-control-forgejo by @juliusmarminge in pingdotgg/t3code#17581
* refactor(source-control): Azure DevOps lives in @t3tools/source-control-azure-devops by @juliusmarminge in pingdotgg/t3code#17592
* refactor(source-control): GitLab lives in @t3tools/source-control-gitlab by @juliusmarminge in pingdotgg/t3code#17594
* refactor(source-control): Bitbucket lives in @t3tools/source-control-bitbucket by @juliusmarminge in pingdotgg/t3code#17597
* refactor(source-control): GitHub lives in @t3tools/source-control-github by @juliusmarminge in pingdotgg/t3code#17607
* refactor(usage): transcript readers come from their drivers by @juliusmarminge in pingdotgg/t3code#17576
* refactor(usage): OpenCode usage comes from provider-opencode by @juliusmarminge in pingdotgg/t3code#17577
* refactor(usage): Cursor account usage comes from provider-cursor by @juliusmarminge in pingdotgg/t3code#17578
* refactor(usage): Antigravity usage is a reader on its driver by @juliusmarminge in pingdotgg/t3code#17579
* refactor(usage): usage readers use Effect FileSystem and SqlClient by @juliusmarminge in pingdotgg/t3code#17615
* fix(web): composer context strip pads both edges evenly by @limineol in pingdotgg/t3code#17562
* test(usage): v4 cache upgrade test waits for the migrated cache write by @Mnigos in pingdotgg/t3code#17553
* feat(mobile): support Duo in the shared iOS app by @juliusmarminge in pingdotgg/t3code#12648
* refactor(source-control): GitManager reads provider resolvers, not host kinds by @juliusmarminge in pingdotgg/t3code#17617
* refactor(source-control): PullRequestService reads GitHub resolvers, not its kind by @juliusmarminge in pingdotgg/t3code#17619
* refactor(source-control): Forgejo identity and Azure DevOps addressing move into their packages by @juliusmarminge in pingdotgg/t3code#17624
* refactor: home directory comes from a HostProcessHomeDirectory reference by @juliusmarminge in pingdotgg/t3code#17628
* refactor(shared): host process references live in a HostProcess module by @juliusmarminge in pingdotgg/t3code#17641
* feat(web): filter PR comments by bots and resolved threads by @juliusmarminge in pingdotgg/t3code#17645
* fix(clients): remove redundant prefix from PR watch status by @extoci in pingdotgg/t3code#17635
* fix(web): pending requests wait until you stop typing by @maria-rcks in pingdotgg/t3code#17637
* fix(models): remove new badges from Claude Opus and Sonnet 5.5 by @extoci in pingdotgg/t3code#17646
* fix(ui): keep focus and selection borders visible across the app by @maria-rcks in pingdotgg/t3code#16675
* fix(mobile): prevent row presses during native back swipes by @juliusmarminge in pingdotgg/t3code#17648
* fix(server): Codex shadow homes replace stray sqlite maintenance locks by @juliusmarminge in pingdotgg/t3code#17663
* feat(desktop): T3 Code can be your default web browser on macOS by @juliusmarminge in pingdotgg/t3code#17587
* test(server): the ACP process-tree test no longer collides with the runner's own pid by @yordis in pingdotgg/t3code#17647
* fix(web): keep branch restore action inline in narrow composers by @Saikrishna1876 in pingdotgg/t3code#14811
* fix(web): composer banner actions stay inline whenever they fit by @maria-rcks in pingdotgg/t3code#17640


**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261009.2886...v0.0.46-nightly.20261010.2908

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261010.2908
Moinax added a commit to Moinax/t3code that referenced this pull request Oct 10, 2026
Upstream moved `ForgejoSourceControlProvider` to
`@t3tools/source-control-forgejo` (pingdotgg#17581). The rename carried the fork's
one-line `head=` hunk across, but not the fork's test: it stayed behind in
`apps/server/src/sourceControl/`, importing two siblings that no longer sit
there, and upstream's own test file already owns the package's canonical name.

Moved it next to the provider under a distinct name, and swapped the stale
`VcsProcess` mock for the `TestSourceControlHost` harness the package tests
now use — the provider yields `SourceControlHost`, not `VcsProcess`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant