feat(variables): consolidate 5 CI/CD variable tools into 2 CQRS tools#43
feat(variables): consolidate 5 CI/CD variable tools into 2 CQRS tools#43
Conversation
Consolidates variable operations following CQRS pattern: - browse_variables (Query): list, get actions - manage_variable (Command): create, update, delete actions Uses flat z.object() with .refine() instead of z.discriminatedUnion() for Claude API compatibility (no oneOf/allOf/anyOf at root level). Closes #9
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This pull request consolidates the CI/CD variables functionality from 5 individual tools into 2 CQRS-pattern tools, following the established architectural pattern in the codebase.
Changes:
- Replaced 5 tools (
list_variables,get_variable,create_variable,update_variable,delete_variable) with 2 CQRS tools (browse_variables,manage_variable) - Implemented flat schema pattern with
.refine()for Claude API compatibility - Updated all 45 unit tests to reflect the new CQRS structure
- Added comprehensive integration tests for the new variable schemas
- Updated README.md to reflect the tool count change (58 → 55 tools)
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/entities/variables/schema-readonly.ts | Implements BrowseVariablesSchema with "list" and "get" actions using flat schema pattern |
| src/entities/variables/schema.ts | Implements ManageVariableSchema with "create", "update", and "delete" actions using flat schema pattern |
| src/entities/variables/registry.ts | Consolidates 5 tool handlers into 2 CQRS handlers with proper action routing |
| tests/unit/entities/variables/registry.test.ts | Refactored 45 unit tests to cover the new CQRS tools comprehensively |
| tests/integration/schemas/variables.test.ts | Added new integration tests covering all actions and lifecycle operations |
| README.md | Updated documentation to reflect 2 CQRS tools and adjusted total tool count from 58 to 55 |
Add comprehensive unit tests for BrowseVariablesSchema and ManageVariableSchema covering: - Action field validation (list, get, create, update, delete) - Variable type coercion (env_var, file, env, environment, etc.) - Boolean field coercion (flexibleBoolean) - Filter and environment scope validation - Edge cases and error handling Increases test count from 45 to 108 for variables entity.
📊 Test Coverage ReportOverall Coverage: 86.67% Coverage Details
Coverage Report: View detailed coverage report
|
| ## Tools 🛠️ | ||
|
|
||
| **60 Tools Available** - Organized by entity and functionality below. | ||
| **57 Tools Available** - Organized by entity and functionality below. |
There was a problem hiding this comment.
The PR description mentions reducing tools from "58 → 55" but the diff shows "60 → 57". The actual change is correct (60 minus 3 equals 57), but the PR description should be updated to match the actual numbers.
Summary
browse_variables(Query): list, get actionsmanage_variable(Command): create, update, delete actions.refine()for Claude API compatibilityChanges
schema-readonly.tswithBrowseVariablesSchemaschema.tswithManageVariableSchemaregistry.tswith 2 CQRS tool handlersTest plan
Closes #9