Skip to content

feat: add workspace build transition to provisioner job list#24131

Merged
jscottmiller merged 2 commits intomainfrom
feature/workspace-transition-in-provisioner-job
Apr 10, 2026
Merged

feat: add workspace build transition to provisioner job list#24131
jscottmiller merged 2 commits intomainfrom
feature/workspace-transition-in-provisioner-job

Conversation

@jscottmiller
Copy link
Copy Markdown
Contributor

@jscottmiller jscottmiller commented Apr 7, 2026

Closes #16332

coder provisioner jobs list showed no indication of what a workspace build job was doing (i.e., start, stop, or delete). This adds workspace_build_transition to the provisioner job metadata, exposed in both the REST API and CLI. Template and workspace name columns were also added, both available via -c.

$ coder provisioner jobs list -c id,type,status,"workspace build transition"
ID                                    TYPE                     STATUS     WORKSPACE BUILD TRANSITION
95f35545-a59f-4900-813d-80b8c8fd7a33  template_version_import  succeeded
0a903bbe-cef5-4e72-9e62-f7e7b4dfbb7a  workspace_build          succeeded  start

@github-actions github-actions bot added the community Pull Requests and issues created by the community. label Apr 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@jscottmiller jscottmiller force-pushed the feature/workspace-transition-in-provisioner-job branch 7 times, most recently from fd4ee87 to 0ea0fa6 Compare April 8, 2026 20:30
@jscottmiller jscottmiller force-pushed the feature/workspace-transition-in-provisioner-job branch from 0ea0fa6 to c8d5260 Compare April 8, 2026 20:43
Copy link
Copy Markdown
Contributor Author

@jscottmiller jscottmiller left a comment

Choose a reason for hiding this comment

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

Most of this diff is generated code. Here are the actual changes to review:

Comment thread coderd/database/queries/provisionerjobs.sql Outdated
WorkspaceBuildTransition WorkspaceTransition `json:"workspace_build_transition,omitempty" table:"workspace build transition"`
}

// ProvisionerJobType represents the type of job.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

SDK type change: new WorkspaceBuildTransition field on ProvisionerJobMetadata.

Comment thread coderd/provisionerjobs.go Outdated
if pj.WorkspaceID.Valid {
job.Metadata.WorkspaceID = &pj.WorkspaceID.UUID
}
if pj.WorkspaceBuildID.Valid {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Conversion logic: only populates WorkspaceBuildTransition when a workspace build exists, preventing the SQL COALESCE default from leaking into the API response for non-workspace-build jobs.

TemplateIcon: template.Icon,
WorkspaceID: &w.ID,
WorkspaceName: w.Name,
WorkspaceBuildTransition: codersdk.WorkspaceTransitionStart,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Test coverage: asserts the new field is correctly populated for workspace build jobs.

@jscottmiller jscottmiller marked this pull request as ready for review April 8, 2026 21:10
@jscottmiller jscottmiller removed the community Pull Requests and issues created by the community. label Apr 9, 2026
@jscottmiller
Copy link
Copy Markdown
Contributor Author

recheck

@jscottmiller
Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

1 similar comment
@jscottmiller
Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

cdrci2 added a commit to coder/cla that referenced this pull request Apr 9, 2026
@jscottmiller jscottmiller merged commit 7bde763 into main Apr 10, 2026
69 of 76 checks passed
@jscottmiller jscottmiller deleted the feature/workspace-transition-in-provisioner-job branch April 10, 2026 14:50
@github-actions github-actions bot locked and limited conversation to collaborators Apr 10, 2026
@johnstcn
Copy link
Copy Markdown
Member

<3

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.

Show workspace build transition in the coder provisioner jobs list CLI command

4 participants