mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add workspace restart functionality to API (#25757)
This models restart as durable orchestration of existing stop and start workspace builds instead of adding a new restart transition. Keeping restart as two existing transitions preserves the current build/provisioner model. The child start build is created only after the parent stop build succeeds, rather than being inserted immediately in a pending state. That keeps `workspace_builds` aligned with actual provisioner-ready work and avoids introducing a second pending-build lifecycle that the provisioner and build acquisition paths would need to understand. Refs: https://linear.app/codercom/issue/PLAT-143
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
INSERT INTO workspace_build_orchestrations (
|
||||
id,
|
||||
created_at,
|
||||
updated_at,
|
||||
workspace_id,
|
||||
parent_build_id,
|
||||
child_transition
|
||||
)
|
||||
SELECT
|
||||
'4e983a68-9b8a-4d4e-a4d6-5f2dd73551c2'::uuid,
|
||||
NOW(),
|
||||
NOW(),
|
||||
workspace_id,
|
||||
id,
|
||||
'start'::workspace_transition
|
||||
FROM
|
||||
workspace_builds
|
||||
ORDER BY
|
||||
created_at, id
|
||||
LIMIT 1
|
||||
ON CONFLICT DO NOTHING;
|
||||
Reference in New Issue
Block a user