- Notifications
You must be signed in to change notification settings - Fork1k
feat: extend workspace build reasons to track connection types#18827
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ALTERTYPE build_reason ADD VALUE IF NOT EXISTS'ssh_connection'; | ||
ALTERTYPE build_reason ADD VALUE IF NOT EXISTS'vscode_connection'; | ||
ALTERTYPE build_reason ADD VALUE IF NOT EXISTS'jetbrains_connection'; |
ethanndicksonJul 15, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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_connection
part is implicit here - if you're using any of these, it was to connect to the workspace. I would personally drop the suffixes, but it's up to you.
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.
FE code looks good 👍, only left a minor comment
site/src/utils/workspace.tsx Outdated
returnundefined; | ||
}; | ||
exportconstgetDisplayInitiatorBuildReason=( |
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: I think this is a nice case to use records.
constbuildReasonLabels:Record<BuildReason,string>={initiator:"API",dashboard:"Dashboard",cli:"CLI",// ...}
So you can use it directly in the component:
<span>{buildReasonLabels[log.build_reason]}</span>
Wdyt?
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.
@BrunoQuaresma I’ve slightly modified the impl based on your suggestion. PTAL
…d-reason# Conflicts:#coderd/workspacebuilds.go
482463c
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
This PR introduces new build reason values to identify what type of connection triggered a workspace build, helping to troubleshoot workspace-related issues.
Database Migration
Added migration 000349_extend_workspace_build_reason.up.sql that extends the build_reason enum with new values:
Implementation
The build reason is specified through the API when creating new workspace builds:
dashboard
when users start workspaces via the web interfacestart
command: Sets reason tocli
when workspaces are started via the command linessh
command: Sets reason to ssh_connection when workspaces are started due to SSH connectionsvscode_connection
by the VS Code extension through CLI hidden flag (feat: set 'vscode_connection' as build reason on workspace start vscode-coder#550)jetbrains_connection
by the Jetbrains Toolbox (feat: set 'jetbrains_connection' as build reason on workspace start coder-jetbrains-toolbox#150) and Jetbrains Gateway extension (feat: set 'jetbrains_connection' as build reason on workspace start jetbrains-coder#561)UI Changes: