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

feat: implement more specific error pages for 'workspace stopped' err… #595

Merged
merged 3 commits into from
Aug 3, 2022

Conversation

dkwon17
Copy link
Contributor

@dkwon17 dkwon17 commented Jul 29, 2022

…or page

Signed-off-by: David Kwon [email protected]

What does this PR do?

Currently there is a generic error page that is displayed when trying to access a workspace url (a devworkspace's status.mainUrl) when the workspace is not running:

However, there can be multiple reasons why a workspace is not running. Some examples are:

  • workspace is not running because it was shut down due to inactivity
  • workspace is not running because it was shut down due to the run timeout
  • workspace shut down because an error (ie case where for the devworkspace, status.phase == Failed)
  • user forgot to start the workspace

This PR introduces a new class WorkspaceStoppedDetector to help detect the different cases.

Ad a result, different error page messages in each of these four scenarios are available:

Workspace inactivity

image

Workspace run timeout

image

Workspace error

image

Workspace was not started

image

What issues does this PR fix or reference?

Fixes eclipse-che/che#21516

Is it tested? How?

Testing the 'Workspace inactivity' error page

  1. Set the workspace inactivity timeout to a smaller value by setting checluster.spec.devEnvironments.secondsOfInactivityBeforeIdling to, for example, 120.

  2. Start a workspace. Once the editor opens, let it timeout by not interacting with it for about 120 seconds.

  3. Once the workspace times out, refresh the page

Testing the 'Workspace run timeout' error page

  1. Set the workspace run timeout to a value smaller than the inactivity timeout by setting checluster.spec.devEnvironments.secondsOfRunBeforeIdling to, for example, 80.

  2. Start a workspace. After the workspace starts, the workspace should terminate in about 80 seconds.

  3. Once the workspace times out, refresh the editor page

Testing the 'Workspace error' error page

  1. To prevent other timeouts from shutting down the workspace, disable the timeouts by setting both secondsOfInactivityBeforeIdling and secondsOfRunBeforeIdling to -1 in the checluster CR.

  2. Start a workspace with this github repository: https://github.com/dkwon17/failing-workspace/tree/fail-delayed

  3. The editor should open, however after roughly 1 minute and 30 seconds, the workspace should terminate due to a failing container.

  4. Refresh the editor page

Testing the 'Workspace was not started' error page

  1. Start a workspace.

  2. Once the workspace has started and the editor has loaded, stop the workspace.

  3. Refresh the editor page

Release Notes

The warning page that appears when accessing the workspace url for a stopped workspace provides a more specific message depending on the reason why the workspace has stopped.

The cases are:

  • Workspace has been stopped due to inactivity
  • Workspace has been stopped because it reached the run timeout
  • Workspace has stopped due to an error causing the workspace pod to shut down
  • Workspace was not running in the first place

Docs PR

@che-bot
Copy link
Contributor

che-bot commented Jul 29, 2022

Click here to review and test in web IDE: Contribute

@che-bot
Copy link
Contributor

che-bot commented Jul 29, 2022

Click here to review and test in web IDE: Contribute

@che-bot
Copy link
Contributor

che-bot commented Jul 29, 2022

Click here to review and test in web IDE: Contribute

@che-bot
Copy link
Contributor

che-bot commented Jul 29, 2022

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-595

Copy link
Contributor

@akurinnoy akurinnoy left a comment

Choose a reason for hiding this comment

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

I tested locally on minikube, and everything works as expected.

@openshift-ci openshift-ci bot removed the lgtm label Aug 2, 2022
@che-bot
Copy link
Contributor

che-bot commented Aug 2, 2022

Click here to review and test in web IDE: Contribute

Signed-off-by: David Kwon <[email protected]>
@che-bot
Copy link
Contributor

che-bot commented Aug 2, 2022

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

github-actions bot commented Aug 2, 2022

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-595

@dkwon17
Copy link
Contributor Author

dkwon17 commented Aug 2, 2022

Thank you for the feedback everyone, I have removed the unused imports and added more unit tests:
image

@openshift-ci
Copy link

openshift-ci bot commented Aug 2, 2022

@dkwon17: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/v8-dashboard-happy-path b705075 link true /test v8-dashboard-happy-path

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-ci
Copy link

openshift-ci bot commented Aug 3, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: akurinnoy, dkwon17, ibuziuk, olexii4

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dkwon17 dkwon17 merged commit c7f1521 into main Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Determine why workspace stopped and provide appropriate warning/info page on dashboard if needed
5 participants