Skip to content

feat(console): add Gitea to Git connect - #15004

Merged
HarshMN2345 merged 2 commits into
mainfrom
feat-console-gitea
Oct 27, 2026
Merged

HarshMN2345 merged 2 commits into
mainfrom
feat-console-gitea

Conversation

@HarshMN2345

Copy link
Copy Markdown
Member

What changed

  • Added Gitea to the Console's Git provider registry (icon, label, connect flag). The connect buttons on site/function create, the repository picker and the project Git settings card now offer it.
  • Connect options are filtered by _APP_VCS_PROVIDERS from /v1/console/variables, so only providers the server has configured are shown. Unconfigured ones previously showed a button whose authorize call failed with "provider is not configured".
  • Gitea pull request links stay non-clickable, since the instance host isn't known to the Console. Owner links already come from the server's organizationUrl.
  • Added "Connect Gitea" to the he/ja dictionaries, matching existing Bitbucket coverage.

Testing

  • bun test tests/unit/vcs-connect-providers.test.ts passes; bun run lint:types --against origin/main reports no new errors.
  • Ran the Console against a local API with only the Gitea variables set (_APP_VCS_PROVIDERS: ["gitea"]): Create site shows a single "Connect Gitea" button, and its link redirects to Gitea's /login/oauth/authorize with the configured client ID and the /v1/vcs/gitea/callback redirect URI.
  • Against a local API with no VCS variables set (_APP_VCS_PROVIDERS: []), the "Connect Git provider" box shows no connect buttons.

Gitea is a Git provider on the server since 2.0, but the Console had no
entry for it, so there was no way to connect it. Add it to the provider
registry, and show only the connect options the server reports as
configured in _APP_VCS_PROVIDERS, since authorizing any other fails.
@luxor-code-review

luxor-code-review Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review complete. No blocking issues — approved ✅; 1 nitpick below.

🧹 Nitpicks (1) — 🟢 1 low
  • 🟢 Gitea baseUrl fabricates gitea.com links (providers.tsx:169) — The new gitea entry in VCS_PROVIDERS hardcodes https://gitea.com/${organization} (apps/console/src/lib/vcs/providers.tsx:169), while Gitea is self-hosted: the server registry defines a configurable browserEndpoint (_APP_VCS_GITEA_ENDPOINT, app/config/vcs.php:40) and getProviderPullRequestUrl already returns null for gitea because "its host is not known here" (providers.tsx:323-325).

This PR introduces Gitea as a connectable VCS provider in the console. The provider list is now filtered at runtime against a server-reported capability variable so installs that have not configured a provider stop offering its connect flow, and the five call sites that previously showed all providers now fetch console variables and pass the capability list through. Registry metadata for Gitea (icon, oauth client, PR-link fallback) is added alongside the existing GitHub/GitLab/Bitbucket entries.

Files Change
apps/console/src/lib/vcs/providers.tsx Registers the gitea provider and adds getVisibleVcsOAuthProviders capability filtering
apps/console/src/lib/react-query/hooks/console-variables.ts Exposes useConsoleVariables for reading server console variables
apps/console/src/components/global/shared/*.tsx and function/site create views, GitConfigurationCard Hoist the variables hook and pass configured providers into the connect sections
apps/console/src/lib/i18n/dictionaries/{he,ja}/{functions,sites}.ts Adds Hebrew and Japanese strings for the Gitea connect option
apps/console/tests/unit/vcs-connect-providers.test.ts Unit tests for the new provider visibility filtering

Reviewed commit: b5180bb

@appwrite

appwrite Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

New Console

Project ID: new-console

Sites (1)
Site Status Logs Preview QR
 New Console
new-console
Ready Ready View Logs Preview URL QR Code

Tip

GraphQL API works alongside REST and WebSocket protocols

@ghost

ghost commented Oct 27, 2026 •

Copy link
Copy Markdown

🔵 Tier A · Mergeable after minor fixes

The configured-provider filtering needs focused unit coverage before this is ready to merge.

This change adds Gitea to the Console’s Git provider metadata and filters Git connect options using the server’s configured-provider list. It also keeps Gitea pull-request links non-clickable and adds Hebrew and Japanese translations for the connect label.

Verdict New comments Fixed Still open
✅ Approved 1 0 0
Finding Where
🟡 Cover filtering against configured providers apps/console/src/lib/vcs/providers.tsx:205
Fix with agent prompt
### Issue 1
apps/console/src/lib/vcs/providers.tsx:205
**Cover filtering against configured providers**

The updated unit test always passes `undefined`, so it only exercises the compatibility fallback and would still pass if a configured or empty `_APP_VCS_PROVIDERS` list were ignored. Please add cases confirming that an allowlist filters providers and an empty list hides all connect options.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
📂 Walkthrough · 12
File Change
apps/console/src/components/global/shared/ConnectRepositorySection.tsx Uses the configured VCS provider list to filter connect options.
apps/console/src/components/global/shared/RepositoryPicker.tsx Filters repository picker connect options by configured providers.
apps/console/src/components/pages/projects/$projectId/functions/create/CreateFunctionView.tsx Filters function creation connect options by configured providers.
apps/console/src/components/pages/projects/$projectId/settings/GitConfigurationCard.tsx Filters project Git settings connect options by configured providers.
apps/console/src/components/pages/projects/$projectId/sites/create/CreateSiteView.tsx Filters site creation connect options by configured providers.
apps/console/src/lib/i18n/dictionaries/he/functions.ts Adds the Hebrew Gitea connect label.
apps/console/src/lib/i18n/dictionaries/he/sites.ts Adds the Hebrew Gitea connect label.
apps/console/src/lib/i18n/dictionaries/ja/functions.ts Adds the Japanese Gitea connect label.
apps/console/src/lib/i18n/dictionaries/ja/sites.ts Adds the Japanese Gitea connect label.
apps/console/src/lib/react-query/hooks/console-variables.ts Exposes the configured VCS provider list from console variables.
apps/console/src/lib/vcs/providers.tsx Registers Gitea metadata and icon, applies configured-provider filtering, and leaves its pull-request link non-clickable.
apps/console/tests/unit/vcs-connect-providers.test.ts Updates expected provider lists to include Gitea.

Merged main (bf736c6); no changes to this PR's code since b5180bb · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost 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 A · Looks good to merge. Summary

return flag === null || features[flag]
return (
(flag === null || features[flag]) &&
vcsProviderHasCapability(provider.id, configuredProviders)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cover filtering against configured providers

The updated unit test always passes undefined, so it only exercises the compatibility fallback and would still pass if a configured or empty _APP_VCS_PROVIDERS list were ignored. Please add cases confirming that an allowlist filters providers and an empty list hides all connect options.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/console/src/lib/vcs/providers.tsx
Line: 205

Comment:
**Cover filtering against configured providers**

The updated unit test always passes `undefined`, so it only exercises the compatibility fallback and would still pass if a configured or empty `_APP_VCS_PROVIDERS` list were ignored. Please add cases confirming that an allowlist filters providers and an empty list hides all connect options.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · testing · Reply if this doesn't apply.

@HarshMN2345
HarshMN2345 merged commit 3c5d30d into main Oct 27, 2026
33 of 34 checks passed
aishwaripahwa12 pushed a commit that referenced this pull request Oct 27, 2026
feat(console): add Gitea to Git connect
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