feat: notify users before workspace autostop (#26676)

This commit is contained in:
Jon Ayers
2026-06-26 01:25:23 -05:00
committed by GitHub
parent a163d43981
commit 637a801a41
11 changed files with 693 additions and 36 deletions
@@ -141,6 +141,19 @@ SET
updated_at = @updated_at::timestamptz
WHERE id = @id::uuid;
-- name: UpdateWorkspaceBuildNotifiedAutostopDeadline :exec
-- Stamps the deadline value that an autostop reminder was last sent for. Once
-- this equals the build's deadline the reminder is considered handled and the
-- lifecycle executor will not send another for this deadline, which makes the
-- reminder idempotent and HA-safe. It re-arms automatically when the deadline
-- changes (e.g. an activity bump).
UPDATE
workspace_builds
SET
notified_autostop_deadline = @notified_autostop_deadline::timestamptz,
updated_at = @updated_at::timestamptz
WHERE id = @id::uuid;
-- name: GetActiveWorkspaceBuildsByTemplateID :many
SELECT wb.*
FROM (