-
Notifications
You must be signed in to change notification settings - Fork 755
feat: Add Gitea Support #11667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: Add Gitea Support #11667
Conversation
|
@Excellencedev is attempting to deploy a commit to the GitButler Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks a lot for getting the ball rolling on Gitea! Do you have suggestions for how this should be validated locally? Please also note that I have set this PR back to draft for a first round of getting CI green, and then seeing what Copilot finds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds Gitea support to GitButler, allowing users to manage Gitea repositories and pull requests. The implementation follows the existing but-github pattern by creating a new but-gitea crate with API client functionality, authentication token management, and PR operations. However, there are several critical issues that will prevent the code from compiling and functioning correctly.
Key Changes:
- New
but-giteacrate implementing Gitea API client and authentication - Updated
but-forgeto detect Gitea URLs and add Gitea to theForgeNameenum - Extended
but-forge-storageto store Gitea account credentials - Added Gitea login button to the web frontend
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
crates/but-gitea/Cargo.toml |
New crate definition with dependencies for Gitea integration |
crates/but-gitea/src/client.rs |
Gitea API client implementation with user and PR operations |
crates/but-gitea/src/client_tests.rs |
Unit tests for deserializing Gitea API responses |
crates/but-gitea/src/token.rs |
Token storage and account management for Gitea |
crates/but-gitea/src/pr.rs |
PR list/get/create operations for Gitea repositories |
crates/but-gitea/src/lib.rs |
Public API and PAT storage functionality |
crates/but-forge/src/forge.rs |
Added Gitea to ForgeName enum and ForgeUser |
crates/but-forge/src/lib.rs |
Added Gitea URL detection logic |
crates/but-forge/src/review.rs |
Added Gitea template path functions |
crates/but-forge/Cargo.toml |
Added but-gitea dependency |
crates/but-forge-storage/src/settings.rs |
Added GiteaSettings and GiteaAccount structs |
crates/but-forge-storage/src/controller.rs |
Added methods for managing Gitea accounts |
apps/web/src/lib/components/auth/OAuthButtons.svelte |
Added Gitea OAuth button to UI |
Cargo.toml |
Added but-gitea to workspace members |
Cargo.lock |
Lock file update for new crate |
crates/gitbutler-git/src/repository.rs |
Removed error handling from PID conversion (unrelated change) |
Critical Issues Found:
- The
PullRequeststruct is missing required fields (labels, draft, timestamps, reviewers, etc.) that are needed forForgeReviewconversion - Missing
Fromtrait implementations to convert Gitea types toForgeReviewandForgeUser GiteaAccountIdentifieris missingPartialEqimplementation needed for account resolution- The
review.rsmodule doesn't handle Gitea inlist_forge_reviews,get_forge_review, orcreate_forge_reviewfunctions - Unrelated and potentially problematic change to PID conversion error handling in
repository.rs
|
Here's a guide on how to verify @Byron Prerequisites
Step 1: Set up a local Gitea InstanceWe will use Docker to spin up a local Gitea instance for comprehensive testing.
Step 2: Create a Personal Access Token (PAT)
Step 3: Create a Repository
Step 4: Authentication in GitButler
Step 5: Test Pull Request Flow
|
Byron
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a very quick review, and please feel free to add #[allow(missing_docs)] to certain types if these are just there for serisalisation.
What I'd really like to learn more about is how you'd get a local test setup for Gitea, along with the way you test this with the CLI and/or the GUI. And I realise that Gitea does do hosting, so what remains is the suggested workflow for testing it in the real-world.
Thank you!
|
@Byron Thanks for consideing my PR |
…utler into gitea-support
Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…utler into gitea-support
|
Interesting - I am all setup, yet I cannot enter credentials for Gitea. Maybe another bug, for instance, if a GitHub login exists, it won't show alternatives. Screen.Recording.2025-12-30.at.16.53.25.mov |
|
@Byron I have addressed all feedback from you, Copilot, and I fixed the bug you reported |
|
@Byron All CI is passing now |
|
pls approve vercel preview |
|
Vercel can be ignored and it's normal to be red (unfortunately). Could you also cherry-pick all actual commits onto Thanks again. |
@Byron Done ! |
|
waiting for review :) |
|
I just tried again, and it doesn't appear like the Gitea integration is kicking in at all. There seem to be two issues:
The commit I ran this on was the latest one available: 44e36ef . The video I have shared previously is still representing what I see. Once this works, I'd also test it with a local instance, but let's take one step at a time. PS: I added some tasks to the PR for me to keep track. |
Byron
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me also officially prevent the PR from being merged while we try to figure out the basics.
|
i ran |
|
I go with I hope you also don't mind me sharing that I am surprised this seems to be the first time you seem to be starting the app in dev mode to try the submission locally. |
Yeah I actually tied before and I got that error so I just decided submitted this PR |
|
@Byron I keep getting this error. Ans yes i killed all tasks on that port, restarted my computer, nothing worked @gitbutler/desktop:dev:
@gitbutler/desktop:dev: > @gitbutler/desktop@0.0.0 dev C:\Users\USER\3D Objects\gitbutler\apps\desktop
@gitbutler/desktop:dev: > vite --clearScreen false
@gitbutler/desktop:dev:
Warn Waiting for your frontend dev server to start on http://localhost:1420/...
@gitbutler/desktop:dev: error when starting dev server:
@gitbutler/desktop:dev: Error: Port 1430 is already in use
@gitbutler/desktop:dev: at Server.onError (file:///C:/Users/USER/3D%20Objects/gitbutler/node_modules/.pnpm/vite@6.3.5_@types+node@22.1_cdc70ec4a8da45ab48fc93d8b4204639/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js:25023:18)
@gitbutler/desktop:dev: at Server.emit (node:events:518:28)
@gitbutler/desktop:dev: at emitErrorNT (node:net:1975:8)
@gitbutler/desktop:dev: at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
@gitbutler/desktop:dev: ELIFECYCLE Command failed with exit code 1.
Warn Waiting for your frontend dev server to start on http://localhost:1420/... |
|
This is an unfortunate issue on Windows, and from what I heard people had to go as far as to reboot to fix it. Maybe |
Description
This PR adds support for Gitea as a git forge provider in GitButler.
Changes
crates/but-giteacrates/but-forgeGiteatoForgeNameenum.OAuthButtons.svelte.Motivation
Gitea is a popular self-hosted git service. Adding support allows users to manage Gitea repositories and PRs directly from GitButler, expanding our forge compatibility beyond GitHub.
Implementation Details
but-githubimplementation.reqwestfor API calls.Test Logs:
These unit tests prove that:
Related Issues
Byron's Tasks