Skip to content

feat(mrs): implement GitLab Suggestions API integration#70

Merged
polaz merged 2 commits intomainfrom
feat/66-apply-suggestions
Jan 20, 2026
Merged

feat(mrs): implement GitLab Suggestions API integration#70
polaz merged 2 commits intomainfrom
feat/66-apply-suggestions

Conversation

@polaz
Copy link
Copy Markdown
Member

@polaz polaz commented Jan 20, 2026

Summary

Add suggestion apply functionality to complete code review workflow. This closes the gap compared to specialized code review MCP servers.

New actions in manage_mr_discussion:

  • apply_suggestion - Apply a single code suggestion by ID
  • apply_suggestions - Batch apply multiple suggestions in one commit

Both actions support optional custom commit messages.

GitLab API

  • Single: PUT /projects/:id/merge_requests/:iid/suggestions/:suggestion_id/apply
  • Batch: PUT /projects/:id/merge_requests/:iid/suggestions/batch_apply

Test plan

  • Unit tests for both actions (4 new tests)
  • All 2262 unit tests pass
  • Integration test with real GitLab instance

Closes #66

Extend manage_mr_discussion with two new actions for code review workflow:
- Single suggestion commit via REST API
- Batch suggestions commit via REST API

Closes #66
Copilot AI review requested due to automatic review settings January 20, 2026 20:54
@github-actions
Copy link
Copy Markdown

📊 Test Coverage Report

Overall Coverage: 89.58%

Coverage Details

Metric Percentage
Statements 89.58%
Branches 82.5%
Functions 77.18%
Lines 90.03%

Coverage Report: View detailed coverage report

This report was generated automatically from your PR changes.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds GitLab Suggestions API integration to enable applying code review suggestions directly through the MCP server, completing the code review workflow.

Changes:

  • Added two new actions to manage_mr_discussion tool: apply_suggestion (single) and apply_suggestions (batch)
  • Both actions support optional custom commit messages
  • Comprehensive unit test coverage with 4 new test cases

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/entities/mrs/schema.ts Added Zod schemas for apply_suggestion and apply_suggestions actions with validation
src/entities/mrs/registry.ts Implemented handler logic for both new actions with proper API endpoint calls
tests/unit/entities/mrs/registry.test.ts Added comprehensive unit tests covering both actions with and without commit messages

@polaz polaz merged commit b9ca090 into main Jan 20, 2026
17 of 18 checks passed
@polaz polaz deleted the feat/66-apply-suggestions branch January 20, 2026 21:00
sw-release-bot bot pushed a commit that referenced this pull request Jan 21, 2026
## [6.18.0](v6.17.0...v6.18.0) (2026-01-21)

### Features

* **errors:** add structured error handling with tier awareness ([#75](#75)) ([2b5088c](2b5088c)), closes [#50](#50) [#50](#50)
* **mrs:** implement GitLab Suggestions API integration ([#70](#70)) ([b9ca090](b9ca090)), closes [#66](#66)
* **tiers:** add action-level tier requirements for consolidated tools ([#77](#77)) ([8e5ae0e](8e5ae0e)), closes [#48](#48)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(mrs): Add suggestion apply actions (apply_suggestion, apply_suggestions)

2 participants