Skip to content
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

[dashboard, server] Add global custom timeout preference #16503

Merged
merged 5 commits into from
Mar 3, 2023

Conversation

iQQBot
Copy link
Contributor

@iQQBot iQQBot commented Feb 22, 2023

Description

[dashboard, server] Add global custom timeout preference

Related Issue(s)

Closes #16200

How to test

  1. try enabling billing with your account, otherwise custom workspace timeout will disabled.
  2. setting custom timeout in preference
  3. start a workspace, use kubectl describe pod ws-{instanceID} to check your workspace timeout and closed timeout.
annotations `gitpod/customTimeout` is your workspace timeout.

Release Notes

[dashboard, server] Add global custom timeout preference

Documentation

Build Options:

  • /werft with-github-actions
    Experimental feature to run the build with GitHub Actions (and not in Werft).
  • leeway-no-cache
    leeway-target=components:all
  • /werft no-test
    Run Leeway with --dont-test
Publish Options
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer Options
  • with-ee-license
  • with-slow-database
  • with-dedicated-emulation
  • with-ws-manager-mk2
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated

Preview Environment Options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh

@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-pd-timeout-16089.6 because the annotations in the pull request description changed
(with .werft/ from main)

@iQQBot
Copy link
Contributor Author

iQQBot commented Feb 22, 2023

@loujaybee Could you help me think of some documents or desc in preference?

@iQQBot
Copy link
Contributor Author

iQQBot commented Feb 22, 2023

@gtsiolis Could you help review the design here?

should we add a new menu? i.e. not under Preference

@iQQBot
Copy link
Contributor Author

iQQBot commented Feb 22, 2023

Something need discuss

  • Currently, we only allow paid users to customize workspace timeout, should we hide these settings when the user don't have any paid plan?
  • Or we remove all limits, and let all user can customize.
  • Should we introduce a new API for these workspace timeout settings? i.e. the value should be valid, and need make sure user have permission to set.

cc @svenefftinge

@iQQBot iQQBot marked this pull request as ready for review February 22, 2023 14:40
@iQQBot iQQBot requested a review from a team February 22, 2023 14:40
@iQQBot iQQBot requested a review from gtsiolis as a code owner February 22, 2023 14:40
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Feb 22, 2023
@gtsiolis
Copy link
Contributor

gtsiolis commented Feb 23, 2023

Looking at this now! 👀

Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

Thanks for adding this, @iQQBot! 🔮

Added below some UX comments based on the following design.

To also answer your question about adding a menu in #16503 (comment), I don't think this needs a separate menu in user settings for now. ✔️

Inactivity Timeout
Inactivity Timeout

Approving to unblock merging, but holding in case someone from the @gitpod-io/engineering-webapp needs to take a closer look at the code changes. 🏓

/hold

components/dashboard/src/user-settings/Preferences.tsx Outdated Show resolved Hide resolved
components/dashboard/src/user-settings/Preferences.tsx Outdated Show resolved Hide resolved
components/dashboard/src/user-settings/Preferences.tsx Outdated Show resolved Hide resolved
components/dashboard/src/user-settings/Preferences.tsx Outdated Show resolved Hide resolved
Comment on lines 197 to 137
<CheckBox
title="Disabled Close Timeout"
desc={<span></span>}
checked={disabledClosedTimeout}
onChange={(e) => actuallySetDisabledClosedTimeout(e.target.checked)}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

question: What does this do? It seems to not work. Do we need it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what do you mean not work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This feature is used to disable the default close timeout, which means you will no longer have the five minute fast timeout limit when closing your browser or disconnecting from ssh

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, it seems to work now. I could not toggle the checkbox when I tried earlier. 🤷

Still, what does this checkbox do? Do we need it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

explain in the previous message, is it make sense?

Copy link
Contributor

@gtsiolis gtsiolis Feb 24, 2023

Choose a reason for hiding this comment

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

Thanks @iQQBot! Just highlighting some copy changes from the suggestion above to simplify and improve readability. What do you think?

BEFORE AFTER
timeouts-before timeouts-after

💡 tip: Also, using font-semibold instead of bold can improve the rendering here.

issue: This is also missing some validation states where a user enters a blank value or an invalid value but relying on the browser alert sounds ok for this iteration. Could you open a follow-up issue for doing proper form validation in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This 5m close timeout only for gitpod.io. Other installation may have different value, and it set in workspace cluster, so server actually don't know it

And this 30m default inactive timeout is depend user plan, e.g. free user got 30m, paid user got 60m....

So if we want display default value and valid value in server side, we may need some new api for it

Copy link
Member

@loujaybee loujaybee Feb 28, 2023

Choose a reason for hiding this comment

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

Just highlighting some copy changes from the suggestion above to simplify and improve readability. What do you think?

I'm not a fan of the "keep workspace running" copy. It feels very ambiguous.

Could we go with:

"Close workspaces on editor disconnect (5 minutes)" (default = selected)

Or similar?

Copy link
Member

@loujaybee loujaybee Feb 28, 2023

Choose a reason for hiding this comment

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

This 5m close timeout only for gitpod.io. Other installation may have different value, and it set in workspace cluster, so server actually don't know it

In Dedicated, this type of policy would likely be controlled through the organisation settings. Can we not safely assume 5 minutes for now as the general default until we have also this configuration at the admin/organisation level? Dedicated will have very little infra level variance, unless exposed through the product.

Copy link
Member

Choose a reason for hiding this comment

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

The workspace inactivity timeout copy + behaviour looks good, the editor timeout needs some refinement. I have created an internal RFC to resolve some questions about the naming of the editor timeout copy text and naming. My intention is to get feedback and close that decision in the next 24 hours to unblock this PR.

However, given this PR is solving two distinct product issues:

If we are keen to merge it, we should consider either commenting out/disabling the editor timeout part of this PR + raising a separate PR for the editor timeout, whilst we resolve naming + copy decisions. Or wait until that decision and merge both at once.

@iQQBot
Copy link
Contributor Author

iQQBot commented Feb 23, 2023

Big thanks for @gtsiolis

@geropl
Copy link
Member

geropl commented Feb 24, 2023

@iQQBot Left a few comments above. Also, the preview env is not working atm 😢

@iQQBot iQQBot force-pushed the pd/timeout-16089 branch 2 times, most recently from 59edcca to c6b20e1 Compare February 24, 2023 16:28
@iQQBot
Copy link
Contributor Author

iQQBot commented Feb 24, 2023

@geropl Thanks for your review, I already addressed your feedback, and the preview env is works now, you can have a try.

Copy link
Member

@loujaybee loujaybee left a comment

Choose a reason for hiding this comment

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

Thanks for adapting this @iQQBot ! 🙏 - Would be good if we could leave a message for the disabled setting, and/or simplify the placeholder message. However, both of these could be done in a follow up PR, I'd be happy to ship this as it currently is.

@iQQBot iQQBot force-pushed the pd/timeout-16089 branch from 02fa0e2 to c0c7935 Compare March 1, 2023 15:03
@loujaybee loujaybee requested a review from a team March 1, 2023 16:17
@loujaybee
Copy link
Member

loujaybee commented Mar 1, 2023

Could someone from https://github.com/orgs/gitpod-io/teams/engineering-webapp review it? 🙏

Added @gitpod-io/engineering-webapp as a reviewer, but a re-review from @geropl or @easyCZ (as they already have context would also be good!) 🙏

@gtsiolis
Copy link
Contributor

gtsiolis commented Mar 1, 2023

Looking at this (again) now! 👀

@iQQBot iQQBot force-pushed the pd/timeout-16089 branch 2 times, most recently from 908770a to f242605 Compare March 2, 2023 15:59
@@ -494,6 +499,33 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
return user;
}

public async supportConfigureWorkspaceTimeout(ctx: TraceContext): Promise<boolean> {
Copy link
Member

@geropl geropl Mar 2, 2023

Choose a reason for hiding this comment

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

The support puts me off a bit: We don't use that word, yet, anywhere. So using it here means adding uncertainty. What about sticking to can or may instead? 🤔

Also, we happen to make (nearly) exactly the same method over here. Maybe it's worth re-using/combining the two? 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the method signature is not same, and it is only in enterprise

Copy link
Member

@geropl geropl Mar 2, 2023

Choose a reason for hiding this comment

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

the method signature is not same

The signature is effectively identical: If we make maySetTimeout public, it's basically maySetWorkspaceTimeout(ctx: TraceContext), where we get the user on the first or second line.

Anyway, want to push more for the name. 🤗

and it is only in enterprise

I agree that's super confusing, and we should change that very soon: it' the code we use for all distribution modes: there is 0️⃣ difference, we ship that "ee" code to everyone.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

9b7d2b5

I made some changes, could you check this commit?

@geropl
Copy link
Member

geropl commented Mar 2, 2023

Two immediate questions when I see this:

  • What's the current value?
  • What's the default value?
    image

@geropl
Copy link
Member

geropl commented Mar 2, 2023

I can't test in the preview env:
image

How to proceed @iQQBot ? Have you or somebody else tested the current version?

@iQQBot
Copy link
Contributor Author

iQQBot commented Mar 2, 2023

Could you try again?

@iQQBot iQQBot force-pushed the pd/timeout-16089 branch from 9b7d2b5 to 93c093d Compare March 3, 2023 04:15
@@ -494,6 +499,33 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
return user;
}

public async maySetTimeout(ctx: TraceContext): Promise<boolean> {
Copy link
Member

Choose a reason for hiding this comment

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

🧡 Thanks @iQQBot !

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

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

Code LGTM, but cannot test due to (unrelated) preview problems 👍

@iQQBot
Copy link
Contributor Author

iQQBot commented Mar 3, 2023

/unhold

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: dashboard component: server deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note size/L team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce global user timeout default
8 participants