MCPcopy Index your code
hub / github.com/coder/coder / appStatusStateToTaskState

Function appStatusStateToTaskState

coderd/aitasks.go:320–327  ·  view source on GitHub ↗

appStatusStateToTaskState converts a WorkspaceAppStatusState to a TaskState. The two enums mostly share values but "failure" in the app status maps to "failed" in the public task API.

(s codersdk.WorkspaceAppStatusState)

Source from the content-addressed store, hash-verified

318// TaskState. The two enums mostly share values but "failure" in the
319// app status maps to "failed" in the public task API.
320func appStatusStateToTaskState(s codersdk.WorkspaceAppStatusState) codersdk.TaskState {
321 switch s {
322 case codersdk.WorkspaceAppStatusStateFailure:
323 return codersdk.TaskStateFailed
324 default:
325 return codersdk.TaskState(s)
326 }
327}
328
329// deriveTaskCurrentState determines the current state of a task based on the
330// workspace's latest app status and initialization phase.

Callers 1

deriveTaskCurrentStateFunction · 0.85

Calls 1

TaskStateTypeAlias · 0.92

Tested by

no test coverage detected