feat(milestones): consolidate 9 milestone tools into 2 CQRS tools#31
Merged
feat(milestones): consolidate 9 milestone tools into 2 CQRS tools#31
Conversation
Implements issue #13 - CQRS consolidation for milestones entity: - browse_milestones (Query): list, get, issues, merge_requests, burndown - manage_milestone (Command): create, update, delete, promote Uses flat z.object() with .refine() for Claude API compatibility.
📊 Test Coverage ReportOverall Coverage: 86.53% Coverage Details
📈 Coverage Report: View detailed coverage report
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR consolidates 9 separate milestone tools into 2 CQRS-pattern tools, implementing issue #13. The refactoring reduces tool count while maintaining full functionality and improving consistency across the codebase.
Changes:
- Consolidated 5 read-only tools into
browse_milestoneswith actions: list, get, issues, merge_requests, burndown - Consolidated 4 write tools into
manage_milestonewith actions: create, update, delete, promote - Updated schemas to use flat structure with
.refine()validation for Claude API compatibility
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/entities/milestones/schema-readonly.ts |
Introduced BrowseMilestonesSchema with 5 query actions using flat schema pattern |
src/entities/milestones/schema.ts |
Introduced ManageMilestoneSchema with 4 command actions using flat schema pattern |
src/entities/milestones/registry.ts |
Refactored registry from 9 separate tool handlers to 2 CQRS handlers with switch-based action routing |
tests/unit/entities/milestones/registry.test.ts |
Updated unit tests to validate CQRS structure and test all action handlers |
tests/integration/schemas/milestones.test.ts |
Updated integration tests to validate all CQRS actions with real GitLab API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Implements issue #13 - CQRS consolidation for milestones entity:
Changes
list_milestonesbrowse_milestones(action: "list")get_milestonebrowse_milestones(action: "get")get_milestone_issuebrowse_milestones(action: "issues")get_milestone_merge_requestsbrowse_milestones(action: "merge_requests")get_milestone_burndown_eventsbrowse_milestones(action: "burndown")create_milestonemanage_milestone(action: "create")edit_milestonemanage_milestone(action: "update")delete_milestonemanage_milestone(action: "delete")promote_milestonemanage_milestone(action: "promote")Technical Details
z.object()with.refine()for Claude API compatibility (no oneOf/allOf/anyOf at root)requiredIdfor proper ID validationassertDefined()for TypeScript type narrowingCloses #13
Test plan