Skip to content

Review GitLab, Gitea and Bitbucket repositories from Appwrite - #69

Merged
TorstenDittmann merged 1 commit into
mainfrom
claude/project-thread-t8mmqt
Nov 25, 2026
Merged

TorstenDittmann merged 1 commit into
mainfrom
claude/project-thread-t8mmqt

Conversation

@TorstenDittmann

Copy link
Copy Markdown
Contributor

Requested by Torsten · project thread

What

Appwrite now sends review and chat jobs for GitLab, Gitea and Bitbucket installations (appwrite/appwrite#16057). The token endpoint hands back the installation's refreshed OAuth token. This PR makes the clients work with what Appwrite actually sends.

  • Self-hosted GitLab and Gitea. The token response can carry endpoint, the instance's API root (…/api/v4, …/api/v1). AppwriteInstallationTokens passes it on, and the GitLab and Gitea factories use it ahead of the configured default, GitLab.com or gitea.com.
  • Bitbucket full names. Appwrite names a Bitbucket repository by its full name, workspace/slug. The factory now reads the workspace from that id instead of owner, so the API path is /repositories/workspace/slug.

Tests

  • New tests cover the self-hosted endpoint on GitLab and Gitea, Bitbucket full-name ids, and endpoint passing through AppwriteInstallationTokens.
  • bun run lint, bun run check and bun run test all pass locally (490 tests).

Generated by Claude Code

Appwrite now sends review and chat jobs for GitLab, Gitea and Bitbucket
installations, with the installation's OAuth token.

- The token can name the provider's API root, so a self-hosted GitLab or
  Gitea is reached on its own host instead of GitLab.com or gitea.com.
- Bitbucket repositories Appwrite names by their full name,
  `workspace/slug`, are addressed by that workspace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F3M7tuaHpj5WN6awCJZvos
Co-authored-by: Torsten Dittmann <1759475+TorstenDittmann@users.noreply.github.com>
@TorstenDittmann TorstenDittmann self-assigned this Nov 25, 2026
@appwrite

appwrite Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Code review

Commit Status Tier Verdict Details
930c0b0 Reviewed Reviewed 🟢 S · Ready to merge ✅ Approved View review

The changed paths and their callers are consistent, and the new provider-specific behavior is covered by tests.

The Appwrite token adapter now carries a provider API endpoint through installation tokens, and the GitLab and Gitea factories use it for self-hosted instances. The Bitbucket factory parses workspace and slug from Appwrite's full-name repository identifier. Tests cover endpoint forwarding, self-hosted provider routing, and Bitbucket repository lookup.

Walkthrough (10)
File Change
apps/service/src/index.ts Updates the client configuration note for self-hosted GitLab and Gitea.
packages/appwrite/src/installation-tokens.ts Passes an optional API endpoint through Appwrite installation tokens.
packages/appwrite/src/results.test.ts Tests forwarding a self-hosted provider endpoint.
packages/bitbucket/src/client.ts Parses Bitbucket full-name repository IDs into workspace and slug.
packages/bitbucket/src/client.test.ts Tests lookup using a full-name repository ID.
packages/gitea/src/client.ts Adds the optional endpoint to Gitea tokens and uses it for API requests.
packages/gitea/src/client.test.ts Tests that a self-hosted endpoint is used by the Gitea client factory.
packages/github/src/tokens.ts Adds an optional provider endpoint to the shared installation token contract.
packages/gitlab/src/client.ts Adds the optional endpoint to GitLab tokens and uses it for API requests.
packages/gitlab/src/client.test.ts Tests that a self-hosted endpoint is used by the GitLab client factory.

Reviewed 930c0b0

Tip

Comment @appwrite review to re-run, or mention @appwrite with a question.

@appwrite appwrite Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

@TorstenDittmann
TorstenDittmann merged commit 6511301 into main Nov 25, 2026
5 checks passed
@TorstenDittmann
TorstenDittmann deleted the claude/project-thread-t8mmqt branch November 25, 2026 13:35
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.

2 participants