feat(gitlab): add getPullRequest, getPullRequestFiles, getPullRequestFromBranch, createComment, getComment, updateComment and getUser#94
Conversation
Greptile SummaryThis PR implements the remaining GitLab adapter methods ( Confidence Score: 5/5Safe to merge; no P0 or P1 issues found — only two P2 style/performance suggestions. All findings are P2: a redundant API call in getComment and a missing early-exit guard in the getPullRequestFiles polling loop. Both leave behavior functionally correct, just slightly inefficient. Previously flagged P1s (pagination gaps, spurious PUTs) are resolved by the new findMrIidForNote helper. No files require special attention. Important Files Changed
Reviews (5): Last reviewed commit: "Merge branch 'utopia-php:main' into feat..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76df5e76dd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a688e865e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Implements the remaining pull request, comment, and user methods for the GitLab adapter, completing the full adapter implementation.
Changes
New methods implemented
getPullRequest— fetches a merge request by iid, normalized to match Gitea/GitHub shapegetPullRequestFiles— fetches changed files using/diffsendpoint withpatch_id_shapolling to handle GitLab's async diff processinggetPullRequestFromBranch— finds an open merge request by source branchcreateComment— creates a note on a merge request via GitLab notes APIgetComment— retrieves a note by ID, searching across all MRs in the repositoryupdateComment— updates an existing note by IDgetUser— fetches a user by username via GitLab users search APITests added
testGetEventPushMatchesCheckoutSha,testValidateWebhookEventUsesPlainToken,testCreateOrganizationtestGetUser,testGetUserWithInvalidUsername,testCreatePrivateRepository,testGetRepositoryWithNonExistingOwner,testCreateRepositoryWithInvalidName,testDeleteRepositoryTwiceFails,testDeleteNonExistingRepositoryFails,testGetPullRequestFromBranchNoPR,testCreateCommentInvalidPR,testGetCommentInvalidIdNotes
getCommentandupdateCommentsearch across all MRs to find the note by ID since the MR iid is not stored with the comment IDgetPullRequestFilesusespatch_id_shapolling per GitLab's official documentation recommendation for async diff processinggetUserreturnsusernamefield (notloginlike Gitea/GitHub) — this is a GitLab API differencefeat/gitlab-adapter-webhooksand will need a rebase once that PR merges