-
Notifications
You must be signed in to change notification settings - Fork 34
Show Remote SSH Output panel on workspace start #627
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
EhabY
wants to merge
1
commit into
coder:main
Choose a base branch
from
EhabY:show-remote-ssh-output-on-start
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm aiming for a less intrusive UX by only showing the
Output: Remote SSHchannel when a workspace starts (i.e., when the startup script runs). However, since the channel logs activity during (normal) connection as well, we could always show it to help catch issues sooner. The caveat is that we can't automatically hide the output channel once a connection succeeds.What would be the best UX approach here?
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.
I'm now leaning more towards the latter because those logs can be useful still even if this part is faster than the startup script part
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 we could hide it after connecting I think it might make sense but as a user I feel like I might be annoyed if I have to keep closing the window every time I connect (but I am not a VS Code user so I could be wrong). Do we have users asking for this?
If we just want users to be aware something is happening, the progress notifications should cover that, but maybe we need to show more detail in the notification? Although, that is on the remote SSH extension side and not something we can change. 🤔
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.
This scenario was encountered by @dannykopping where their workspace seemed like it was stuck but it was just executing the startup script and working normally. Seeing the logs just shows that things are moving I suppose while the progress notification doesn't tell us if things are ACTUALLY working (can't tell if it's stuck).
I can keep it as is where we just show the output logs when we start the workspace, that way it's less annoying but might not show the output in some cases.
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.
Makes sense. Actually, I was thinking at this stage we handed off to the remote extension and had no more control, but we do actually still control this part right? We start the workspace before handing off, I think? What if we updated the notification with the last line from the log? Or would that look janky? Maybe even just adding a "open build log" button would do the trick.
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.
Hahaha I went through the same exact confusion so I understand
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.
On the one hand, it feels surprising the build watch endpoint does not also wait for startup scripts, on the other hand it does make sense, I suppose they are distinct steps.
Thinking out loud, maybe we could check if the agent has any blocking startup scripts (
start_blocks_loginI think) and then pop up the remote SSH log window if so.The best long-term fix I suppose would be to actually follow and print the startup script logs, like with the
/api/v2/workspaceagents/$id/logs?follow=trueendpoint (watchWorkspaceAgentLogsin coder/coder'sapi.ts). But I think this endpoint stays open indefinitely. We would need some new endpoint specifically for the startup scripts I think.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.
Wait actually, I think the workspace status does tell us if the startup scripts finished? I vaguely remember doing this in the Jetbrains plugin now that I think about it.
Yeah there are lifecycle states to tell us if the scripts are done: https://github.com/coder/jetbrains-coder/blob/51d1d57bc80e8173b6603a8c4c39b8ffc0e6cbde/src/main/kotlin/com/coder/gateway/models/WorkspaceAndAgentStatus.kt#L31
We could combine that with watching logs
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.
Ooooh that could be nice, watching the logs and showing a similar terminal to the
Build Logone is very clear. But how do we know that the startup script finished executing besides just pollinggetWorkspace, extracting the agents and checking if the lifecycle is notstarting?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.
Polling is how we did it in Gateway but we could also use
watchWorkspaceI believe (I think we already use it, but would need some refactoring).