Skip to content

feat: set 'vscode_connection' as build reason on workspace start #550

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kacpersaw
Copy link

This PR is part of coder/coder#18827 which introduces new build reason values to identify what type of connection triggered a workspace build, helping to troubleshoot workspace-related issues.

@kacpersaw kacpersaw changed the title Set 'vscode_connection' as build reason on workspace start feat: set 'vscode_connection' as build reason on workspace start Jul 14, 2025
@kacpersaw kacpersaw marked this pull request as ready for review July 15, 2025 13:04
@kacpersaw kacpersaw requested a review from ethanndickson July 15, 2025 13:04
Copy link
Member

@ethanndickson ethanndickson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, assuming you've tested it against your feature branch with --reason

kacpersaw added a commit to coder/coder that referenced this pull request Jul 22, 2025
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:
```
dashboard, cli, ssh_connection, vscode_connection, jetbrains_connection
```

## Implementation
The build reason is specified through the API when creating new
workspace builds:

- Dashboard: Automatically sets reason to `dashboard` when users start
workspaces via the web interface
- CLI `start` command: Sets reason to `cli` when workspaces are started
via the command line
- CLI `ssh` command: Sets reason to ssh_connection when workspaces are
started due to SSH connections
- VS Code connections: Will be set to `vscode_connection` by the VS Code
extension through CLI hidden flag
(coder/vscode-coder#550)
- JetBrains connections: Will be set to `jetbrains_connection` by the
Jetbrains Toolbox
(coder/coder-jetbrains-toolbox#150) and
Jetbrains Gateway extension
(coder/jetbrains-coder#561)

## UI Changes:
* Tooltip with reason in Build history
<img width="309" height="457" alt="image"
src="https://github.com/user-attachments/assets/bde8440b-bf3b-49a1-a244-ed7e8eb9763c"
/>

* Reason in Audit Logs Row tooltip
<img width="906" height="237" alt="image"
src="https://github.com/user-attachments/assets/ebbb62c7-cf07-4398-afbf-323c83fb6426"
/>

<img width="909" height="188" alt="image"
src="https://github.com/user-attachments/assets/1ddbab07-44bf-4dee-8867-b4e2cd56ae96"
/>
Co-authored-by: Ethan <39577870+ethanndickson@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants