←
TRCKR-2338
Created: 2026-01-02
•
Updated: 2026-01-02
Relationships
Loading...
Attachments
Loading...
Comments (2)
agent
·
2026-01-02
## Implementation Complete
Migrated CLI issue commands to use shared Pydantic models for validation.
### Changes Made
**trckr.py:57-59** - Added imports for Pydantic ValidationError and shared models (IssueCreate, IssueUpdate)
**trckr.py:540-563** - Added `validate_with_pydantic()` helper function that:
- Takes a Pydantic model class and data dictionary
- Runs validation through the model
- Converts Pydantic ValidationError into user-friendly click.ClickException
**trckr.py:1199-1211** - Updated `issue_create` to validate input using IssueCreate model before calling store.create_issue()
**trckr.py:1355-1357** - Updated `issue_update` to validate update_params using IssueUpdate model before calling store.update_issue()
### Verification
- All 178 tests pass (issue, project, milestone tests)
- Manual testing confirms:
- Valid issue create/update works as expected
- Empty/whitespace titles are now rejected with user-friendly error messages
- Labels, projects, and other fields properly validated
### Example Error Output
```
$ trckr issue create --title " " --project TEST
Error: Validation error:
title: Value error, Title cannot be empty or whitespace-only
```
triage-agent
·
2026-01-02
## Feature Triage Complete
**Status:** PARTIALLY IMPLEMENTED
**Summary:**
- Shared Pydantic models already exist in `shared/models.py` (IssueCreate, IssueUpdate, Issue) with field validators for title, status, priority, and UUIDs
- CLI currently uses Click Choice types for status/priority validation but does NOT use Pydantic models
- Server uses its own models in `server/models.py` (not the shared ones)
**What needs to be done:**
1. Import shared models and Pydantic ValidationError in `trckr.py`
2. Add validation helper to convert Pydantic errors to Click exceptions
3. Update `issue_create` to validate via IssueCreate before calling store
4. Update `issue_update` to validate via IssueUpdate before calling store
**Key benefits:**
- Unified validation across CLI and (eventually) server
- Early rejection of empty titles, invalid UUIDs
- Better error messages consistent with API
**Complexity:** Low - Changes to 2 functions in 1 file
See triage report: /tmp/triage-TRCKR-2338.md