Add UnapproveMergeRequest, GetDiffsAsync with unidiff, and draft notes API - #1123
Draft
louis-z wants to merge 4 commits into
Draft
Add UnapproveMergeRequest, GetDiffsAsync with unidiff, and draft notes API#1123louis-z wants to merge 4 commits into
louis-z wants to merge 4 commits into
Conversation
…t notes API Three GitLab API gaps that were missing from NGitLab: 1. IMergeRequestApprovalClient.UnapproveMergeRequest() POST /projects/:id/merge_requests/:iid/unapprove Reverses a prior approval by the authenticated user. 2. IMergeRequestClient.GetDiffsAsync(iid, MergeRequestDiffQuery) MergeRequestDiffQuery.Unidiff controls the ?unidiff=true query param (GitLab 16.5+), which returns diffs in standard unified diff format instead of the default GitLab-specific format. 3. IMergeRequestClient.DraftNotes(iid) -> IMergeRequestDraftNoteClient New IMergeRequestDraftNoteClient interface and implementation covering: - All (GET /draft_notes - list draft notes) - CreateAsync (POST /draft_notes) - PublishAllAsync (POST /draft_notes/bulk_publish) All new public symbols are registered in PublicAPI.Unshipped.txt for all TFMs. Mock stubs throw NotImplementedException (consistent with other unimplemented mocks). Co-Authored-By: Claude <noreply@anthropic.com>
louis-z
force-pushed
the
add-unapprove-unidiff-draft-notes
branch
from
July 29, 2026 18:24
26cae7a to
12cc6e5
Compare
louis-z
marked this pull request as ready for review
July 29, 2026 18:34
… and draft notes Covers the three new APIs added in the previous commit: - MergeRequestApprovalClientTests: approve/unapprove roundtrip, and unapprove-when-not-approved is tolerated (GitLab may return a 401; we accept both outcomes) - MergeRequestDiffsClientTests: GetDiffsAsync returns diffs, unidiff=true returns the same file count, and the unified diff content starts with standard markers - MergeRequestDraftNoteClientTests: create appears in All, All is empty on a fresh MR, PublishAllAsync clears drafts and they surface as regular comments All tests use the Docker integration pattern (GitLabTestContext + [NGitLabRetry]). Co-Authored-By: Claude <noreply@anthropic.com>
Toa741
reviewed
Jul 29, 2026
msrouchou
reviewed
Jul 29, 2026
louis-z
marked this pull request as draft
July 30, 2026 11:55
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.
Three GitLab API gaps that were missing from NGitLab:
IMergeRequestApprovalClient.UnapproveMergeRequest(): Reverses a prior approval by the authenticated user.IMergeRequestClient.GetDiffsAsync(iid, MergeRequestDiffQuery): WhenMergeRequestDiffQuery.Unidiffis true, returns diffs in standard unified diff format instead of the default GitLab-specific format.IMergeRequestClient.DraftNotes(iid)->IMergeRequestDraftNoteClient: NewIMergeRequestDraftNoteClientinterface and implementation covering:All new public symbols are registered in PublicAPI.Unshipped.txt for all TFMs. Mock stubs throw NotImplementedException (consistent with other unimplemented mocks).