-
Notifications
You must be signed in to change notification settings - Fork 886
feat: Add workspace agent lifecycle state reporting #5785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should the agent quit here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_error
because this failed - Result (error message) must be visible in build/startup logs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, I've only added a note. I'll revisit this behavior when I add startup log streaming 👍🏻.
coderd/database/migrations/000091_add_workspace_agent_state.up.sql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ship it!
This PR adds workspace agent lifecycle state reporting as an additional property on the agent.
Ref: #5749
startup_script_timeout
anddelay_login_until_ready
terraform-provider-coder#84)WorkspaceAgentLifecycle
:created
,starting
,start_timeout
,start_error
,ready
workspace_agents
(startup_script_timeout_seconds
,delay_login_until_ready
,lifecycle_state
)created
, only changes once the agent reports a new statecreated
status, since we simply don't knowExamples uses:
starting
anddelay_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_error
state lets us direct users towards inspecting the startup log