Repository navigation
feat(gitlab_api): confirm batch suggestion application - #591
Conversation
Snapshot requested identities and require complete applied-state confirmation so mutable inputs or incomplete responses cannot report success; never replay or split batch writes. Signed-off-by: sjungwon03 <sjungwon03@gmail.com>
Link the reviewed batch API foundation and distinguish its remaining selection and confirmation UI scope. Signed-off-by: sjungwon03 <sjungwon03@gmail.com>
sjungwon03-ai
left a comment
There was a problem hiding this comment.
Review of commit ff96608: No blocking findings on the exact reviewed head. Reviewed the documented single PUT /suggestions/batch_apply operation, positive nonempty unique global input identities, caller-list snapshot before the first await, exact optional commit messages and injected account/self-hosted routing. The write disables redirects and automatic OAuth refresh/replay with no fallback to individual application calls. Confirmed success requires HTTP 200, a strictly validated array, exact complete requested identity set without duplicates or extra members, and applied=true for every returned suggestion. Immutable results preserve server order, including reordered responses; nullable and empty patch content and legacy/documented applicability aliases remain intact. Shared metadata validation precedes generated numeric parsing and preserves type, coordinate/range and alias boundaries. Status-first HTTP mapping and malformed/transport errors are typed and sanitized. No partial confirmation, inferred commit count, branch SHA, permission or atomicity guarantee is exposed. Caller mutation cases and all returned member positions are covered. Test-first evidence showed missing-method failure, then 130 failing contracts against a minimal unsafe implementation before fixes; all 149 new batch cases plus 254 single-application/metadata regressions pass. The complete workspace gate passed 5,514 tests (app 3,015; design system 121; API 2,201; models 172; storage 5), 897-file formatting and clean analysis, and all four required CI jobs passed on this exact head. No DTO, generated, UI, localization or dependency changes. An unconfirmed response can follow accepted server writes, so batch selection, multi-patch user confirmation and complete fresh-state recovery remain required UI follow-up work. No live GitLab or physical-device validation claimed.
Summary
The client can apply individual code suggestions but cannot send the documented batch operation. Add
GitLabClient.suggestions.applyBatchwith a single request and strict confirmation of every requested global suggestion identity before returning success.Closes #590
Behavior
applied=true. Reject missing, extra, duplicate, malformed or unapplied members without exposing partial results. Preserve server response order in an immutable list.Validation
Notes for reviewers
An incomplete response can follow accepted server writes. The caller must inspect all selected discussions and require renewed confirmation before manual retry. This API does not implement batch selection, MR grouping, multi-patch confirmation or recovery UI; the app retains its reviewed single-suggestion application flow. Multiline review remains separate.
Official reference: https://docs.gitlab.com/api/suggestions/#apply-multiple-suggestions