feat: add workflow management and enrollment commands#37
Conversation
Extend workflow API and CLI commands: - api/automation.go: CreateWorkflow, UpdateWorkflow, DeleteWorkflow - api/automation.go: EnrollInWorkflow, ListWorkflowEnrollments - api/automation_test.go: Comprehensive tests for all new methods - internal/cmd/workflows: create, update, delete, enroll, enrollments commands Commands support workflow CRUD operations and object enrollment management. Closes #26
Test Coverage Assessment for TDDI've analyzed the test coverage for the workflow management and enrollment commands. Here's my assessment: API Layer: Adequate for TDDThe tests in
This matches the established patterns in Potential Gaps (non-blocking)
Verdict: Coverage is sufficientFor TDD purposes, the coverage is adequate. The API layer tests:
The gaps noted are minor and don't block a TDD workflow - they could be addressed in a follow-up if desired. The CLI layer testing gap is an architectural decision that appears intentional across this project (thin CLI layer with logic concentrated in the testable API layer). |
Summary
Extend workflow API and CLI with CRUD operations and enrollment management.
API Layer (
api/automation.go)CreateWorkflow(data)- create a new workflow from JSONUpdateWorkflow(id, data)- update an existing workflowDeleteWorkflow(id)- delete a workflow by IDEnrollInWorkflow(workflowId, objectId)- enroll an object in a workflowListWorkflowEnrollments(workflowId, opts)- list enrolled objects with paginationWorkflowEnrollmentandWorkflowEnrollmentListtypesCLI Commands
hspt workflows create --file workflow.json- create workflow from JSON filehspt workflows update <id> --file workflow.json- update existing workflowhspt workflows delete <id>- delete a workflowhspt workflows enroll <workflowId> --object-id <objectId>- enroll object in workflowhspt workflows enrollments <workflowId>- list workflow enrollmentsTests
api/automation_test.goTest Plan
make buildpassesmake testpassesmake lintpassesCloses #26