Skip to content

Conversation

DanielleMaywood
Copy link
Contributor

Allows passing --quiet (or -q) to the task create command so that it only prints the ID of the task.

Allows passing `--quiet` (or `-q`) to the task create command so that it
only prints the ID of the task.
Comment on lines +48 to +52
case fmt.Sprintf("/api/v2/organizations/%s/templates/%s/versions/%s", orgID, templateName, templateVersionName):
httpapi.Write(ctx, w, http.StatusOK, codersdk.TemplateVersion{
ID: templateVersionID,
})
case fmt.Sprintf("/api/v2/organizations/%s/templates/my-template", orgID):
case fmt.Sprintf("/api/v2/organizations/%s/templates/%s", orgID, templateName):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive-by test fix

@@ -83,7 +84,8 @@ func TestTaskCreate(t *testing.T) {
assert.Equal(t, templateVersionPresetID, req.TemplateVersionPresetID, "template version preset id mismatch")
}

httpapi.Write(ctx, w, http.StatusCreated, codersdk.Workspace{
httpapi.Write(ctx, w, http.StatusCreated, codersdk.Task{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive-by test fix

@DanielleMaywood
Copy link
Contributor Author

manually tested to confirm it works

coder@danielle ~/coder ((6e4f330b))> ./scripts/coder-dev.sh exp task status --watch $(./scripts/coder-dev.sh exp tasks create -q "my custom prompt")
STATE CHANGED  STATUS    STATE  MESSAGE
1s ago         starting
5s ago         running
47s ago        stopping
51s ago        stopped

@DanielleMaywood DanielleMaywood marked this pull request as ready for review September 4, 2025 08:52
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@DanielleMaywood DanielleMaywood merged commit f94abfc into main Sep 4, 2025
35 checks passed
@DanielleMaywood DanielleMaywood deleted the danielle/tasks/quiet-flag-create branch September 4, 2025 09:03
@github-actions github-actions bot locked and limited conversation to collaborators Sep 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants