feat(cli): add coder task resume command#22066
Conversation
f7dd0e9 to
2427bca
Compare
2427bca to
d3998d8
Compare
coder task resume command
mafredri
left a comment
There was a problem hiding this comment.
Looks good! My main concern is around blocking resumption unless paused, which can lead to some user desperation (see comment). It could perhaps be resolved by an actionable error message for now.
cli/task_resume.go
Outdated
|
|
||
| display := fmt.Sprintf("%s/%s", task.OwnerName, task.Name) | ||
|
|
||
| if task.Status != codersdk.TaskStatusPaused { |
There was a problem hiding this comment.
There are some other states that we need to figure out how the user can resolve, e.g.:
- Error (this could mean the workspace build failed, or is cancelled)
- Unknown (unexpected state)
We don't necessarily have to solve them in resume, but we do need to figure out how we tell users to escape these situations. Ideally the error message would help here. Off the top of my head, resume could auto-resolve, or suggest pausing first. Or perhaps we need to tell them to go manage the workspace build directly.
There was a problem hiding this comment.
| Status | Can resume? | Action |
|---|---|---|
| pending | no | none |
| initializing | no | none |
| active | no | none |
| paused | yes | resume |
| unknown | no | investigate |
| error | no | investigate |
For pending / initializing / active, resume is a no-op.
For unknown and error, I guess we want to direct the user to investigate / troubleshoot?
- Move `resp.WorkspaceBuild` check further up - Inline `if err = cliui.WorkspaceBuild` - Be consistent with task display format - More user friendly "resuming task in background" message
Documentation CheckUpdates Needed
The auto-generated CLI reference documentation ( Automated review via Coder Tasks |
Complements #22012 by adding a
coder task resumecommandCloses COCO-3 / Closes coder/internal#1264