Repository navigation
feat: support every forges provider for Git connections - #46
Merged
Merged
Conversation
Git connections talk to GitHub, GitLab, Gitea, Forgejo, Bitbucket, Gitee, GitCafe, Pushin and Upstream through the forges client. Its requests go through the existing pinned HTTPS transport, and it verifies each forge's webhooks. Generic servers keep the hand-rolled HMAC check.
forges follows next-page links even from empty pages, so cap each forge client at 110 requests. It also wraps our fetch errors, so unwrap them to keep BAD_REQUEST, TIMEOUT and PAYLOAD_TOO_LARGE. Share one OAuth-kind check in the connection dialog.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Uses forges for Git connections, so the provider picker now offers Forgejo, GitHub, GitLab, Gitea, Bitbucket, Gitee, GitCafe, Pushin, Upstream and Generic Git, each with its own icon.
What changed
packages/api/src/git/provider.ts: account lookup, repo listing and webhook setup go throughforges. Itsfetchis our pinned HTTPS transport (public addresses only, no redirects, time and size limits), so the SSRF protections still apply. Clone URLs must still sit on the connection's server.forgesfor each forge, including GitLab's plain token. Generic connections keep the old GitHub/Forgejo HMAC check, so hooks set up by hand keep working. Existing Forgejo hooks (x-forgejo-signature) still verify; there is a test for it.packages/api/src/git/providers.ts: one client-safe provider list drives the API picklists, the connection dialog, labels and default server URLs. Theprovidercolumns are plain text, so no migration is needed./login/oauthendpoints. Other forges use access tokens.x-access-token(GitHub),oauth2(GitLab),x-token-auth(Bitbucket), the account login elsewhere.Notes
forges@0.4.1was added tominimumReleaseAgeExclude, because it was published on 2026-11-22.Not tested against real forges
/2.0/user.Tests
pnpm test,pnpm checkandpnpm check-typesall pass. The worker bundle builds.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.