feat: Add workspace agent lifecycle state reporting#5785
Conversation
ec6def8 to
534f954
Compare
9d03a6a to
e2dda7d
Compare
e2dda7d to
60f414f
Compare
| if metadata.GitAuthConfigs > 0 { | ||
| err := gitauth.OverrideVSCodeConfigs(a.filesystem) | ||
| if err != nil { | ||
| a.logger.Warn(ctx, "failed to override vscode git auth configs", slog.Error(err)) |
There was a problem hiding this comment.
nit: should the agent quit here?
There was a problem hiding this comment.
We probably shouldn't, this could fail for a multitude of reasons, like a user setting chmod 0000 on a folder. The worst that can happen is a degraded user experience (git auth in vscode not working). Ultimately we might want to:
- Continue executing startup script after this
- Set lifecycle to
start_errorbecause this failed - Result (error message) must be visible in build/startup logs
There was a problem hiding this comment.
The worst that can happen is a degraded user experience (git auth in vscode not working).
Yes, that's the situation I was considering. What can user do in this case? Restart the workspace until it works?
There was a problem hiding this comment.
If the change was done before, failure here doesn't really matter either (btw). Restarting will most likely not help, unless it's a problem mounting FS or similar. They'll most likely need to resolve the issue in the workspace, then restart, or create a new one.
There was a problem hiding this comment.
For now, I've only added a note. I'll revisit this behavior when I add startup log streaming 👍🏻.
This PR adds workspace agent lifecycle state reporting as an additional property on the agent.
Ref: #5749
startup_script_timeoutanddelay_login_until_readyterraform-provider-coder#84)WorkspaceAgentLifecycle:created,starting,start_timeout,start_error,readyworkspace_agents(startup_script_timeout_seconds,delay_login_until_ready,lifecycle_state)created, only changes once the agent reports a new statecreatedstatus, since we simply don't knowExamples uses:
startinganddelay_login_until_ready = true, keep users waiting e.g. duringssh coder.workspace(loading indicator, stream startup log, etc.)start_timeout(or error), show users a warningstart_errorstate lets us direct users towards inspecting the startup log