feat(workflow): add pause, resume, cancel-execution commands#76
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces three new CLI commands—cancel-execution, pause, and resume—to manage workflow lifecycles, along with their corresponding unit tests. The reviewer suggested several improvements across all new files: adopting Go naming conventions for initialisms (e.g., accountID), validating the presence of the required account-id configuration early to provide better error messages, and utilizing the package-level client.Run function with cmd.Context() to ensure proper initialization and support for command cancellation.
939de14 to
cc6a049
Compare
Three new workflow lifecycle commands, matching shapes used by the web app (verified in /Users/shiv/Workspace/nudgebee/app): - `nbctl workflow pause <id>` — backed by `workflow_pause` mutation (WorkflowGetRequest: account_id, id). - `nbctl workflow resume <id>` — backed by `workflow_resume`. - `nbctl workflow cancel-execution <workflow-id> <execution-id>` — backed by `workflow_cancel_execution` (WorkflowCancelRequest: account_id, id, execution_id). Each command has text and JSON output modes and unit tests covering both. Live-verified against the dev cluster: pause/resume reach the server and return proper action responses; cancel-execution correctly returned "workflow execution not found" for a bogus execution id, confirming request shape matches the server schema. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cc6a049 to
11095be
Compare
|
Thanks for the review @gemini-code-assist. Addressed one of the four suggestions; rationale for the other three below.
Force-pushed as a single commit; build/test/lint clean. |
|
Thanks for the detailed breakdown, @blue4209211. I completely understand your reasoning regarding the consistency with the existing codebase. Prioritizing architectural uniformity over isolated changes is a sound strategy, especially when those refactors are better suited for a dedicated, repo-wide cleanup. I appreciate you applying the early validation for |
First feature PR in the planned series after PR #75 (OSS scaffolding).
Adds three workflow lifecycle commands so users can manage running workflows from the CLI:
nbctl workflow pause <id>workflow_pausenbctl workflow resume <id>workflow_resumenbctl workflow cancel-execution <workflow-id> <execution-id>workflow_cancel_executionSchema verification
All three action names + input shapes verified against
~/Workspace/nudgebee/app/src/lib/actions.graphqland the app's actual call sites inapp/src/api1/workflow/index.ts(lines 322–349). Used the same GraphQL mutation text the app uses so request shapes will not drift.Test plan
make build,make lint— clean.pause/resumereach the server and the action handler responds (workflows in DRAFT state return "failed to pause workflow" — expected).cancel-executionwith a real workflow id + bogus execution id returned the proper server error"workflow execution not found", confirming the request shape matches the server'sWorkflowCancelRequest.Out of scope (separate PRs)
nbctl workflowsection (currently undocumented).