Open
Conversation
8aaa59a to
b2d8d47
Compare
Contributor
Author
|
@Sureshkumars @eshurakov @RSO I finally have a state which is working properly. Can someone have a view and let me know if support is needed? This PR supports Oauth or PAT integration with gitlab + code review configs with some "GitLab specialties" because they differ to GitHub Apps. Also this integration supports:
|
9b715b7 to
4687cfd
Compare
|
@dennismeister93 is attempting to deploy a commit to the emilie-6161's projects Team on Vercel. A member of the Team first needs to authorize it. |
00fb88f to
3a4903d
Compare
3a4903d to
c55d13e
Compare
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.
Summary
cloud_agent_code_reviewsschema withplatformandplatform_project_idcolumnsKey Components
gitlab/adapter.ts- GitLab platform adapter for code reviews (diff fetching, PR commenting, status updates)gitlab/webhook-handlers/merge-request-handler.ts- Handles GitLab MR webhooks to trigger reviewsgitlab/webhook-schemas.ts+webhook-sync.ts- Webhook validation and automated webhook creationgitlab-service.ts- Extended GitLab integration service with OAuth and PAT supportprepare-review-payload.ts- Refactored to support multi-platform review payloadsplatform-helpers.ts- Platform-agnostic prompt generation helpersReviewConfigForm.tsx/RepositoryMultiSelect.tsx- Updated UI for platform selectioncloud-agent/cloud-agent-next- Platform-aware session preparation and orchestrationNotes
platformcolumn (default'github') andplatform_project_idtocloud_agent_code_reviewsglabCLI with OAuth supportTesting / Reproduce Steps for GitLab Code Review Support
Prerequisites
http://localhost:3000.1. Connect GitLab Integration
There are two connection methods (toggle in the UI at
GitLabIntegrationDetails.tsx):Option A: OAuth (gitlab.com)
/api/integrations/gitlab/callback.Option B: Personal Access Token (PAT)
apiscope.validatePATtRPC mutation).3. Webhook Configuration
Webhooks are auto-configured when you save the code review settings:
syncWebhooksForRepositories()creates webhooks for selected repos.{APP_URL}/api/webhooks/gitlab(seeKILO_GITLAB_WEBHOOK_URL).webhook_secret.GitLabWebhookPermissionError.Manual webhook setup (Has to be done for the smee setup):
webhook_secret.4. Trigger a Code Review
X-Gitlab-Event: Merge Request Hookand actionopen/update/reopen.POST /api/webhooks/gitlabhandler:X-Gitlab-Tokenheader against storedwebhook_secret.MergeRequestPayloadSchema.handleMergeRequest().getAgentConfigForOwner(owner, 'code_review', 'gitlab').cloud_agent_code_reviewsrecord withplatform='gitlab'andplatform_project_idset.getOrCreateProjectAccessToken()— adds 👀 reaction to the MR.tryDispatchPendingReviews().202 Accepted.5. Review Payload Preparation
When the review is dispatched,
prepareReviewPayload()runs:githubRepo(owner/repo) +githubToken(installation token).gitUrl(full HTTPS URL likehttps://gitlab.com/group/project.git) +gitToken(PrAT).7. Local Testing with ngrok/Cloudflare Tunnel
Since GitLab needs to reach your Webhook its important that the webhook url needs to be manually adapted:
