feat: add support for creating inline/line-level comments on merge request diffs using GitLab's Discussions API.#6
Open
kishan0725 wants to merge 8 commits into
Open
Conversation
Add new functionality to reply to existing discussion threads in GitLab merge requests. This includes handler implementation, tool registration, documentation updates, and categorization updates.
- Add express.js and cors middleware for HTTP server implementation - Implement StreamableHTTPServerTransport with session management - Add health check endpoint and support for SSE connections - Update dependencies to include required packages
…service Add Dockerfile, docker-compose.yml, containers.json, and .dockerignore for container setup Include lightsail-deploy.sh script for AWS deployment automation Add DEPLOYMENT.md with comprehensive deployment guide
- Add helper functions to extract gitlab credentials and create axios instances - Implement session management with handler contexts for each session - Update cors to allow gitlab-specific headers - Improve error handling for gitlab authentication failures
Only require GITLAB_API_TOKEN for stdio transport mode since HTTP mode uses headers
Add two new GitLab tool handlers to list merge request notes and discussions. This provides better visibility into merge request conversations and comments. Update tool registry, documentation, and tool definitions to include the new functionality. Adjust tool category slices to accommodate the new tools.
Add new handler and documentation for resolving/unresolving GitLab merge request discussions. Includes updates to tool registry and tool definitions.
Owner
|
Hi there! This is nice. However, there's some minor conflict due to new commits from #4. |
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.
What's Added
New Tools
gitlab_create_merge_request_discussion: Full-featured tool for creating inline comments with manual commit SHA specificationgitlab_create_merge_request_discussion_simple: Simplified tool that automatically fetches commit SHAs from the merge requestgitlab_reply_to_discussion: Reply to existing discussion threads in merge requests to continue conversations on inline commentsImplementation Details
src/types/repository.types.tswith proper TypeScript interfaces for discussion positions and diff referencessrc/handlers/repository-handlers.tsusing GitLab's Discussions API endpointUsage Example
Creating an inline comment
The simplified version makes it easy to add inline comments:
{ "project_id": "my-project", "merge_request_iid": 42, "body": "Consider using async/await here for better readability", "file_path": "src/server.ts", "line_number": 45, "line_type": "new" }Replying to a discussion thread
Continue conversations on existing inline comments:
{ "project_id": "my-project", "merge_request_iid": 42, "discussion_id": "abc123def456", "body": "Good point! I've refactored this in the latest commit." }Technical Notes
POST /projects/:id/merge_requests/:iid/discussionsPOST /projects/:id/merge_requests/:iid/discussions/:discussion_id/notesComplete Workflow
gitlab_create_merge_request_discussion_simplegitlab_reply_to_discussionwith the discussion_idThis enables full conversational code review capabilities for AI assistants!