@@ -28,34 +28,36 @@ enum class WorkspaceAndAgentStatus(val label: String, val description: String) {
28
28
CONNECTING (" ⦿ Connecting" , " The agent is connecting." ),
29
29
DISCONNECTED (" ⦸ Disconnected" , " The agent has disconnected." ),
30
30
TIMEOUT (" ⓧ Timeout" , " The agent has timed out." ),
31
- AGENT_STARTING (" ⦿ Starting" , " The agent is running the startup script ." ),
32
- AGENT_STARTING_READY (" ⦿ Starting" , " The agent is running the startup script but is ready to accept connections." ),
31
+ AGENT_STARTING (" ⦿ Starting" , " The startup script is running." ),
32
+ AGENT_STARTING_READY (" ⦿ Starting" , " The startup script is still running but the agent ready to accept connections." ),
33
33
CREATED (" ⦿ Created" , " The agent has been created." ),
34
34
START_ERROR (" ◍ Started with error" , " The agent is ready but the startup script errored." ),
35
- START_TIMEOUT (" ◍ Started with timeout" , " The agent is ready but the startup script timed out" ),
35
+ START_TIMEOUT (" ◍ Starting" , " The startup script is taking longer than expected." ),
36
+ START_TIMEOUT_READY (" ◍ Starting" , " The startup script is taking longer than expected but the agent is ready to accept connections." ),
36
37
SHUTTING_DOWN (" ◍ Shutting down" , " The agent is shutting down." ),
37
38
SHUTDOWN_ERROR (" ⦸ Shutdown with error" , " The agent shut down but the shutdown script errored." ),
38
- SHUTDOWN_TIMEOUT (" ⦸ Shutdown with timeout " , " The agent shut down but the shutdown script timed out ." ),
39
+ SHUTDOWN_TIMEOUT (" ⦸ Shutting down " , " The shutdown script is taking longer than expected ." ),
39
40
OFF (" ⦸ Off" , " The agent has shut down." ),
40
41
READY (" ⦿ Ready" , " The agent is ready to accept connections." );
41
42
42
43
fun statusColor (): JBColor = when (this ) {
43
- READY , AGENT_STARTING_READY -> JBColor .GREEN
44
- START_ERROR , START_TIMEOUT -> JBColor .YELLOW
45
- FAILED , DISCONNECTED , TIMEOUT , SHUTTING_DOWN , SHUTDOWN_ERROR , SHUTDOWN_TIMEOUT -> JBColor .RED
44
+ READY , AGENT_STARTING_READY , START_TIMEOUT_READY -> JBColor .GREEN
45
+ START_ERROR , START_TIMEOUT , SHUTDOWN_TIMEOUT -> JBColor .YELLOW
46
+ FAILED , DISCONNECTED , TIMEOUT , SHUTDOWN_ERROR -> JBColor .RED
46
47
else -> if (JBColor .isBright()) JBColor .LIGHT_GRAY else JBColor .DARK_GRAY
47
48
}
48
49
49
50
// We want to check that the workspace is `running`, the agent is
50
51
// `connected`, and the agent lifecycle state is `ready` to ensure the best
51
52
// possible scenario for attempting a connection.
52
53
//
53
- // We can also choose to allow `start_timeout` and ` start_error` for the
54
- // agent state; this means the startup script did not successfully complete
55
- // but the agent will accept SSH connections.
54
+ // We can also choose to allow `start_error` for the agent state; this means
55
+ // the startup script did not successfully complete but the agent will still
56
+ // accept SSH connections.
56
57
//
57
58
// Lastly we can also allow connections when the agent lifecycle state is
58
- // `starting` if `login_before_ready` is true on the workspace response.
59
+ // `starting` or `start_timeout` if `login_before_ready` is true on the
60
+ // workspace response since this bypasses the need to wait for the script.
59
61
//
60
62
// Note that latest_build.status is derived from latest_build.job.status and
61
63
// latest_build.job.transition so there is no need to check those.
@@ -67,7 +69,7 @@ enum class WorkspaceAndAgentStatus(val label: String, val description: String) {
67
69
WorkspaceAgentStatus .CONNECTED -> when (agent.lifecycleState) {
68
70
WorkspaceAgentLifecycleState .CREATED -> CREATED
69
71
WorkspaceAgentLifecycleState .STARTING -> if (agent.loginBeforeReady == true ) AGENT_STARTING_READY else AGENT_STARTING
70
- WorkspaceAgentLifecycleState .START_TIMEOUT -> START_TIMEOUT
72
+ WorkspaceAgentLifecycleState .START_TIMEOUT -> if (agent.loginBeforeReady == true ) START_TIMEOUT_READY else START_TIMEOUT
71
73
WorkspaceAgentLifecycleState .START_ERROR -> START_ERROR
72
74
WorkspaceAgentLifecycleState .READY -> READY
73
75
WorkspaceAgentLifecycleState .SHUTTING_DOWN -> SHUTTING_DOWN
0 commit comments