Skip to content

feat: support every forges provider for Git connections - #46

Merged
iRazvan2745 merged 2 commits into
masterfrom
feat/forges-git-providers
Nov 23, 2026
Merged

iRazvan2745 merged 2 commits into
masterfrom
feat/forges-git-providers

Conversation

@iRazvan2745

@iRazvan2745 iRazvan2745 commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

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 through forges. Its fetch is 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.
  • Incoming webhooks are verified by forges for 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. The provider columns are plain text, so no migration is needed.
  • OAuth works with GitHub, Forgejo and Gitea, which share the /login/oauth endpoints. Other forges use access tokens.
  • HTTPS clone usernames: x-access-token (GitHub), oauth2 (GitLab), x-token-auth (Bitbucket), the account login elsewhere.

Notes

  • Left out: Sourcehut and Entire (no HTTPS clone URLs), Tangled (no repo listing), Cursor Origin (no account API), Azure DevOps and Cloudflare Artifacts (need an organization or account ID), GitBucket (no repo listing).
  • Bitbucket means Bitbucket Cloud only, and needs a repository, project or workspace access token.
  • forges@0.4.1 was added to minimumReleaseAgeExclude, because it was published on 2026-11-22.
  • Ignored webhook events now get a 200 instead of a 202.

Not tested against real forges

  • Whether Bitbucket access tokens can read /2.0/user.
  • Whether Gitee, GitCafe, Pushin and Upstream accept the account login as the clone username.

Tests

pnpm test, pnpm check and pnpm check-types all pass. The worker bundle builds.


Get evidence
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

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.
@iRazvan2745
iRazvan2745 merged commit 82966a6 into master Nov 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant