-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
local cli: better logging for ws stop
#19031
Conversation
if HasInstanceStatus(wsInfo.Msg.Result) { | ||
currentStatus = prettyprint.FormatWorkspacePhase(wsInfo.Msg.Result.Status.Instance.Status.Phase) |
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 actually made it so that the status never got updates (should be ws
instead of wsInfo
). Here we fix it as well
@@ -34,54 +34,60 @@ var workspaceStopCommand = &cobra.Command{ | |||
return err | |||
} | |||
|
|||
slog.Info("stopping workspace...") | |||
slog.Debug("stopping workspace...") |
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.
By default, we only output the waiting for workspace to stop...
which can be found below. We essentially had 2 very similar messages, which are more useful for debugging than actually using the CLI.
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.
Approve to unblock you (I'm going to sleep). There's a failed test case #19031 (comment)
if stopDontWait { | ||
slog.Info("workspace stopping") | ||
return nil | ||
} | ||
|
||
stream, err := gitpod.Workspaces.StreamWorkspaceStatus(ctx, connect.NewRequest(&v1.StreamWorkspaceStatusRequest{WorkspaceId: workspaceID})) | ||
|
||
if err != nil { | ||
return 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.
In Golang we used to defer
close / release something once it was created successfully (maybe there will have some special cases but it's a good habit to do so)
@mustard-mh as there's time enough to ship this, feel free to leave any more comments, I'd love to address them in the morning. We can merge later tomorrow. Thanks for the feedback so far |
Let's ship it and do further improvement if needed |
Description
Summary generated by Copilot
🤖 Generated by Copilot at 2662c48
Refactored the
workspace-stop
command in the local app to improve logging and loop logic. Made the output more concise and user-friendly.Related Issue(s)
Fixes EXP-883
How to test
In
/workspace/gitpod/components/local-app/main/gitpod-cli
,Documentation
Preview status
gitpod:summary
Build Options
Build
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
. If enabled,with-preview
andwith-large-vm
will be enabled./hold