mirror of
https://github.com/coder/coder.git
synced 2026-06-03 04:58:23 +00:00
feat: add exit code and status to workspace agent scripts (#24505)
For scripts that have not finished or in dry run cases these will be omitted.
This commit is contained in:
@@ -17,4 +17,13 @@ SELECT
|
||||
RETURNING workspace_agent_scripts.*;
|
||||
|
||||
-- name: GetWorkspaceAgentScriptsByAgentIDs :many
|
||||
SELECT * FROM workspace_agent_scripts WHERE workspace_agent_id = ANY(@ids :: uuid [ ]);
|
||||
SELECT
|
||||
DISTINCT ON (workspace_agent_scripts.id) workspace_agent_scripts.*,
|
||||
workspace_agent_script_timings.exit_code,
|
||||
workspace_agent_script_timings.status
|
||||
FROM workspace_agent_scripts
|
||||
LEFT JOIN workspace_agent_script_timings
|
||||
ON workspace_agent_script_timings.script_id = workspace_agent_scripts.id
|
||||
WHERE workspace_agent_scripts.workspace_agent_id = ANY(@ids :: uuid [ ])
|
||||
ORDER BY workspace_agent_scripts.id, workspace_agent_script_timings.started_at
|
||||
DESC NULLS LAST;
|
||||
|
||||
Reference in New Issue
Block a user