feat(gitlab): add getPullRequest, getPullRequestFiles, getPullRequestFromBranch, createComment, getComment, updateComment and getUser#94
Conversation
Greptile SummaryThis PR completes the GitLab adapter by implementing
Confidence Score: 4/5Safe to merge with one minor fix recommended in the getPullRequestFiles polling loop. The new methods are well-structured and the composite comment-key approach cleanly resolves the previous MR-scan pagination gap. The one open issue is the missing HTTP status check inside the getPullRequestFiles polling loop — a non-existent PR number causes the loop to exhaust all 10 attempts before an exception is finally raised from the diffs fetch, with a less informative error message. All previously skipped tests are now implemented. src/VCS/Adapter/Git/GitLab.php — specifically the patch_id_sha polling loop in getPullRequestFiles Important Files Changed
Reviews (6): Last reviewed commit: "updated the ID fix for comments" | 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