-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add gp timeout show
command
#10782
Add gp timeout show
command
#10782
Conversation
@andrew-farries Don't forget about docs update. At least file an issue. |
4c40e14
to
3dffeed
Compare
@mustard-mh Should we add the docs for this to your existing docs PR (https://github.com/gitpod-io/website/pull/2218) or would you rather I create a new one? |
@andrew-farries You can do it after previous one https://github.com/gitpod-io/website/pull/2218 merged, I can ping you after that |
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 tested with it. As we can see in image below,
default value is long
after extend 180m
extend another workspace, this workspace will reset to default long
If we can't format every output time to 180m
, maybe we can turn 180m
to extended
?
PS. As a user I prefer 180m
formated duration🙂
If we will keep it, it's good for me too, but we should explain more in doc
gitpod/components/gitpod-protocol/src/gitpod-service.ts
Lines 340 to 349 in 7bf63df
export const WORKSPACE_TIMEOUT_DEFAULT_SHORT = "short"; | |
export const WORKSPACE_TIMEOUT_DEFAULT_LONG = "long"; | |
export const WORKSPACE_TIMEOUT_EXTENDED = "extended"; | |
export const WORKSPACE_TIMEOUT_EXTENDED_ALT = "180m"; // for backwards compatibility since the IDE uses this | |
export const WorkspaceTimeoutValues = [ | |
WORKSPACE_TIMEOUT_DEFAULT_SHORT, | |
WORKSPACE_TIMEOUT_DEFAULT_LONG, | |
WORKSPACE_TIMEOUT_EXTENDED, | |
WORKSPACE_TIMEOUT_EXTENDED_ALT, | |
] as const; |
#10782 (review) What do you think/prefer? @loujaybee |
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 want to turn all output into 180m
formatted, maybe we need a map/func in protocol, since we have multiple similar code like this below. Or just hard code here too
gitpod/components/server/src/user/user-service.ts
Lines 173 to 183 in 402894b
public workspaceTimeoutToDuration(timeout: WorkspaceTimeoutDuration): string { | |
switch (timeout) { | |
case WORKSPACE_TIMEOUT_DEFAULT_SHORT: | |
return "30m"; | |
case WORKSPACE_TIMEOUT_DEFAULT_LONG: | |
return "60m"; | |
case WORKSPACE_TIMEOUT_EXTENDED: | |
case WORKSPACE_TIMEOUT_EXTENDED_ALT: | |
return "180m"; | |
} | |
} |
gitpod/components/server/src/user/user-service.ts
Lines 185 to 196 in 402894b
public durationToWorkspaceTimeout(duration: string): WorkspaceTimeoutDuration { | |
switch (duration) { | |
case "30m": | |
return WORKSPACE_TIMEOUT_DEFAULT_SHORT; | |
case "60m": | |
return WORKSPACE_TIMEOUT_DEFAULT_LONG; | |
case "180m": | |
return WORKSPACE_TIMEOUT_EXTENDED_ALT; | |
default: | |
return WORKSPACE_TIMEOUT_DEFAULT_SHORT; | |
} | |
} |
eb64445
to
745e845
Compare
Notice that if we need changes from server, this PR will be approved before next WebApp deploy, or it will block IDE deployment 🙏 |
We can get the raw time duration from server, without conversion to
|
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.
Thanks a lot @andrew-farries for the new command 🧡! I tested it and ti works as advertised.
Maybe we could add to the minutes just a "status" which would indicate whether the timeout is the default one or the extended one? Something like
$ gp timeout show
60m (Default)
$ gp timeout extend
$ gp timeout show
180m (Extended)
@filiptronicek Remember that
|
I suggest we leave the output as is for now, ie without |
/hold |
@mustard-mh I agree, thanks for bringing this up. I wanted to say, that as a user, I would personally like to check
@andrew-farries I see where you're coming from, it could perhaps be in some way programmatically consumed afterwards as well, but I would prefer to see a bit more context about my timeout, if we have it available. We could also ship it as is and afterwards provide a flag or similar to provide such information. |
If a user cannot extend timeout, output will be like this @filiptronicek Only Unleashed plan can extend timeout 🙈
|
33f998f
to
62eea1d
Compare
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.
Tested and code LGTM
/hold
-
‼️ Need to deploy WebApp first, so this PR should unhold before next WebApp deploy - Maybe want to follow up @filiptronicek 's suggestion Add
gp timeout show
command #10782 (comment)
I'll add them to PR description too
@andrew-farries Previous doc PR has been merged, you can start it or ask @filiptronicek to help with it 👍 |
Docs PR is here: https://github.com/gitpod-io/website/pull/2292 |
Thank you @andrew-farries , could you split this PR into two PRs, to unblock deployment? See more context in internal chat |
62eea1d
to
038307c
Compare
I've done this. This PR now contains just the |
133b2eb
to
0e1e454
Compare
0e1e454
to
c984c1c
Compare
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.
Some feedback, not really important, but I would expect some more user friendly output other than just a number, same with |
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.
Thank you, LGTM
/unhold
You can do it in another PR if you want, to print more friendly 🙂 cc @jeanp413 @filiptronicek i.e. |
Description
Add a
gp timeout show
command to thegp
CLI to go along with the recently addedgp timeout extend
command (see #10619).Need to hold until PR [server] Return raw duration fromgetWorkspaceTimeout
#10896 deployedgp timeout show
command #10782 (comment)Related Issue(s)
How to test
gp timeout show
gp timeout extend
.gp timeout show
. Output should be:gp timeout extend
gp timeout show
should back to original oneRelease Notes
Documentation
We'll need to add something to https://github.com/gitpod-io/website/pull/2218 either before or after it's merged.
Werft options: