Skip to content

fix(coderd/database): correct task pending status logic#21886

Merged
mafredri merged 1 commit intomainfrom
mafredri/fix-task-pending-status
Feb 5, 2026
Merged

fix(coderd/database): correct task pending status logic#21886
mafredri merged 1 commit intomainfrom
mafredri/fix-task-pending-status

Conversation

@mafredri
Copy link
Member

@mafredri mafredri commented Feb 3, 2026

Previously, tasks with pending provisioner jobs (not yet picked up)
were incorrectly reported as "initializing".

Refs #21887

@mafredri mafredri force-pushed the mafredri/fix-task-pending-status branch 3 times, most recently from 33bfeae to 59b3504 Compare February 5, 2026 11:40
Previously, tasks with pending provisioner jobs (not yet picked up)
were incorrectly reported as "initializing".

Refs coder/internal#1265
@mafredri mafredri force-pushed the mafredri/fix-task-pending-status branch from 59b3504 to cd03cca Compare February 5, 2026 11:50
@mafredri mafredri marked this pull request as ready for review February 5, 2026 11:50
WHEN (latest_build_raw.job_status = ANY (ARRAY['failed'::provisioner_job_status, 'canceling'::provisioner_job_status, 'canceled'::provisioner_job_status])) THEN 'error'::task_status
WHEN ((latest_build_raw.transition = ANY (ARRAY['stop'::workspace_transition, 'delete'::workspace_transition])) AND (latest_build_raw.job_status = 'succeeded'::provisioner_job_status)) THEN 'paused'::task_status
WHEN ((latest_build_raw.transition = 'start'::workspace_transition) AND (latest_build_raw.job_status = 'pending'::provisioner_job_status)) THEN 'initializing'::task_status
WHEN ((latest_build_raw.transition = 'start'::workspace_transition) AND (latest_build_raw.job_status = 'pending'::provisioner_job_status)) THEN 'pending'::task_status
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the few times when looking at the diff of this file is useful :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obligatory reminder to check migration number before clicking the big green button!

@mafredri mafredri merged commit 96695ed into main Feb 5, 2026
30 checks passed
@mafredri mafredri deleted the mafredri/fix-task-pending-status branch February 5, 2026 12:08
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants