feat: first-class GitLab connect, browse, and push-to-deploy (Phase 1)#177
Open
ThomasRbn wants to merge 18 commits into
Open
feat: first-class GitLab connect, browse, and push-to-deploy (Phase 1)#177ThomasRbn wants to merge 18 commits into
ThomasRbn wants to merge 18 commits into
Conversation
Reserve gitlab_webhook_event for delivery idempotency, store GitLab PATs on user_settings, and scope installation/project queries by provider so GitHub and GitLab paths cannot collide.
Allow injectGitToken/assembleGitClone to use oauth2 for GitLab while keeping GitHub's x-access-token default.
Register Better Auth GitLab social login, GITLAB_* config, permission tags, and allow the unified webhook dispatcher to accept gitlab deliveries with provider-scoped GitHub lookups.
Introduce the peer /api/gitlab surface with OAuth/PAT auth, project listing, Push Hook handling, and clone-token resolution without changing the GitHub module.
Link GitLab projects with gitProvider=gitlab, resolve stack via the GitLab reader, and branch build/preflight credential checks so GitLab clones never fall back to GitHub tokens.
Mount GitLabProvider and let users connect via OAuth or PAT from Settings without changing the existing GitHub flow.
Add a Library provider picker, GitLab URL import with nested groups, and provider-aware project source/deploy plumbing that sets gitProvider=gitlab.
Document Phase 1 GitLab deploy flows and note that URL import accepts gitlab.com alongside github.com.
Introduce a new entry for gitlabCloneTokenEncrypted in the secret registry to support GitLab integration.
…nents - Updated DeployRepository to include provider in dependencies. - Modified SkeletonLoader and RepositoryList to support GitLab alongside GitHub. - Added GitLab tab in LibraryPage for project selection. - Enhanced localization files to include GitLab references in multiple languages.
- Introduced provider-aware URL construction for GitLab and GitHub in project-related services. - Updated projectGitUrl function to dynamically generate URLs based on the git provider. - Ensured synchronization of git source fields during project updates to prevent incorrect URLs. - Added support for GitLab installation IDs in deployment configurations.
- Implemented GitLab-specific webhook registration for auto-deploy, ensuring proper handling of project IDs and webhook URLs. - Added error handling for missing GitLab tokens and webhook deletion scenarios, providing clearer feedback to users. - Updated webhook URL construction to accommodate both GitLab and GitHub based on the project's git provider.
Add user_settings.gitlab_base_url so self-hosted instance origins can be saved with a personal access token.
Accept baseUrl on PAT connect, store it with the token, and use it for API calls, clone URL construction, and URL parsing.
Let users enter a self-hosted instance origin next to the personal access token and pass it through connect.
Clarify Settings URL vs instance-wide GITLAB_BASE_URL for self-hosted setups.
build.service imports resolveUserGitlabBaseUrl, which pulls Better Auth and needs schema from @repo/db. Stub gitlab.auth so the test mock of repos alone does not blow up on import.
Member
|
Huge, thank you, will review and merge asap |
Member
|
thank you for the pr, there's some issues before merge i hope to fix before merge
|
Contributor
Author
|
Great, thanks for your feedback, I'll take a look on this whenever I can 👀 |
Member
|
perfect, but anyway really great work |
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.
Refs #75
Summary
Implements Phase 1 of #75: first-class GitLab as a peer source provider alongside GitHub.
Users can connect GitLab (OAuth or PAT, including self-hosted), browse groups/projects/branches in the Library, bind a project with
gitProvider: "gitlab", clone private repos into the existing deploy pipeline, and auto-deploy on Push Hook deliveries.This does not include Phase 2 (commit statuses, per-server GitLab tokens) or Phase 3 (MR preview environments).
What’s included
Connect
GITLAB_BASE_URL)Library / bind
gitProvider: "gitlab", owner/repo path, branch, clone URL, and numeric GitLab project id (installationId)Push-to-deploy
POST /api/webhooks/gitlabwithX-Gitlab-Tokenverification and delivery idempotencyClone / deploy
oauth2:<token>(project clone token → user PAT → OAuth)gitProvider=gitlaboauth2)Docs
apps/web/content/docs/guides/deploy-from-gitlab.mdxapps/web/content/docs/api/gitlab.mdxapps/web/content/docs/troubleshooting/gitlab.mdxConfig