Skip to content

coderd: autostart: codersdk, http api, database plumbing #879

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: address PR comments
  • Loading branch information
johnstcn committed Apr 6, 2022
commit 316501dc2f14243f879bcac640770c70cb15ca39
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ALTER TABLE ONLY workspaces
DROP COLUMN autostart_schedule,
DROP COLUMN autostop_schedule;
DROP COLUMN IF EXISTS autostart_schedule,
DROP COLUMN IF EXISTS autostop_schedule;
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ALTER TABLE ONLY workspaces
ADD COLUMN autostart_schedule text DEFAULT NULL,
ADD COLUMN autostop_schedule text DEFAULT NULL;
ADD COLUMN IF NOT EXISTS autostart_schedule text DEFAULT NULL,
ADD COLUMN IF NOT EXISTS autostop_schedule text DEFAULT NULL;
5 changes: 4 additions & 1 deletion coderd/workspaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,10 @@ func TestWorkspaceUpdateAutostart(t *testing.T) {
)

err := client.UpdateWorkspaceAutostart(ctx, wsid, req)
require.EqualError(t, err, fmt.Sprintf("status code 404: workspace %q does not exist", wsid), "unexpected error")
require.IsType(t, err, &codersdk.Error{}, "expected codersdk.Error")
coderSDKErr, _ := err.(*codersdk.Error)
require.Equal(t, coderSDKErr.StatusCode(), 404, "expected status code 404")
require.Equal(t, fmt.Sprintf("workspace %q does not exist", wsid), coderSDKErr.Message, "unexpected response code")
})
}

Expand Down