Skip to content

feat: Allow user to cancel workspace jobs #5115

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 19 commits into from
Nov 21, 2022
Merged
Next Next commit
Add database column allow_user_cancel_workspace_jobs
  • Loading branch information
mtojek committed Nov 17, 2022
commit 4dcbf5c98e315fdf67a4a2b391275d296c9c8dcd
5 changes: 4 additions & 1 deletion coderd/database/dump.sql

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE templates DROP COLUMN allow_user_cancel_workspace_jobs;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE templates ADD COLUMN allow_user_cancel_workspace_jobs boolean NOT NULL DEFAULT true;

COMMENT ON COLUMN templates.allow_user_cancel_workspace_jobs
IS 'Allow users to cancel in-progress workspace jobs.';
2 changes: 2 additions & 0 deletions coderd/database/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 43 additions & 30 deletions coderd/database/queries.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions coderd/database/queries/templates.sql
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ INSERT INTO
icon,
user_acl,
group_acl,
display_name
display_name,
allow_user_cancel_workspace_jobs
)
VALUES
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) RETURNING *;
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15) RETURNING *;

-- name: UpdateTemplateActiveVersionByID :exec
UPDATE
Expand Down Expand Up @@ -102,7 +103,8 @@ SET
default_ttl = $4,
name = $5,
icon = $6,
display_name = $7
display_name = $7,
allow_user_cancel_workspace_jobs = $8
WHERE
id = $1
RETURNING
Expand Down