Skip to content

feat(milestones): consolidate 9 milestone tools into 2 CQRS tools#31

Merged
polaz merged 1 commit intomainfrom
refactor/13-milestones-cqrs-consolidation
Jan 19, 2026
Merged

feat(milestones): consolidate 9 milestone tools into 2 CQRS tools#31
polaz merged 1 commit intomainfrom
refactor/13-milestones-cqrs-consolidation

Conversation

@polaz
Copy link
Copy Markdown
Member

@polaz polaz commented Jan 19, 2026

Summary

Implements issue #13 - CQRS consolidation for milestones entity:

  • browse_milestones (Query): list, get, issues, merge_requests, burndown
  • manage_milestone (Command): create, update, delete, promote

Changes

Before (9 tools) After (2 tools)
list_milestones browse_milestones (action: "list")
get_milestone browse_milestones (action: "get")
get_milestone_issue browse_milestones (action: "issues")
get_milestone_merge_requests browse_milestones (action: "merge_requests")
get_milestone_burndown_events browse_milestones (action: "burndown")
create_milestone manage_milestone (action: "create")
edit_milestone manage_milestone (action: "update")
delete_milestone manage_milestone (action: "delete")
promote_milestone manage_milestone (action: "promote")

Technical Details

  • Uses flat z.object() with .refine() for Claude API compatibility (no oneOf/allOf/anyOf at root)
  • Uses requiredId for proper ID validation
  • Uses assertDefined() for TypeScript type narrowing

Closes #13

Test plan

  • All 1431 unit tests pass
  • Lint passes
  • Build successful
  • Integration tests updated for new CQRS schema

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.
Copilot AI review requested due to automatic review settings January 19, 2026 17:39
@github-actions
Copy link
Copy Markdown

📊 Test Coverage Report

Overall Coverage: 86.53%

Coverage Details

Metric Percentage
Statements
Branches
Functions
Lines

📈 Coverage Report: View detailed coverage report

This report was generated automatically from your PR changes.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 19, 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 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_milestones with actions: list, get, issues, merge_requests, burndown
  • Consolidated 4 write tools into manage_milestone with 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.

@polaz polaz merged commit 7fa5c79 into main Jan 19, 2026
22 of 23 checks passed
@polaz polaz deleted the refactor/13-milestones-cqrs-consolidation branch January 19, 2026 17:46
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.

refactor(milestones): CQRS consolidation - 9 tools → 2 tools

2 participants