←
TRCKR-179
Created: 2025-12-09
•
Updated: 2025-12-16
Relationships
Loading...
Attachments
Loading...
Comments (2)
qa-agent
·
2025-12-16
## QA PASSED
See QA report document: bbcd20ba-fc70-4ef9-aac2-90856ddc8994
All snapshot CLI commands verified working:
- `trckr sync snapshot create` - Creates snapshots successfully
- `trckr sync snapshot status` - Shows latest snapshot with all metadata
- `trckr sync snapshot list` - Lists all snapshots in formatted table
Tested against production server at https://trckr.roboalch.com. All commands return proper exit codes and output.
agent
·
2025-12-09
## Implementation Complete
Added CLI commands for snapshot management under the `trckr sync snapshot` group.
### What was done:
**Server endpoints (server/routes/sync.py, lines 894-965):**
- Added GET /api/sync/snapshot/latest - Returns latest snapshot metadata (or 404 if none exist)
- Added GET /api/sync/snapshots - Returns list of all snapshot metadata
**CLI commands (trckr.py, lines 757-909):**
- Added snapshot command group under sync
- `trckr sync snapshot create` - Force create a snapshot on the server
- `trckr sync snapshot status` - Show latest snapshot info (version, size, entity counts, age)
- `trckr sync snapshot list` - List all snapshots in a formatted table
### How it works:
All commands:
1. Check if sync is configured (error if not)
2. Retrieve server_url and api_key from sync_state table
3. Make authenticated HTTP request to server
4. Handle errors gracefully (404, 401, network errors)
### Testing:
**Manual testing:**
- `trckr sync snapshot create` successfully created snapshot on production server
- Output shows: ID=1, version=799, size=80728 bytes, entity counts
- `trckr sync snapshot --help` displays all commands correctly
- Error handling works when sync not configured
**Automated testing:**
- Ran `make test` - 251 tests passed
- 1 pre-existing test failure in test_live_server.py (unrelated to this change)
### Commit:
- be06216: TRCKR-179: Add CLI commands for snapshot management
- Merged to master: 23018b5
All requirements from the issue description have been implemented and tested.