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

jwa: Improve how JWA exposes errors #6952

Merged

Conversation

elenzio9
Copy link
Contributor

@elenzio9 elenzio9 commented Feb 14, 2023

Currently, JWA doesn't properly expose the error state when errors occur in the underlying resources that the app is showing. Our goal it to further improve the way the app exposes errors to better inform users what's going on. So, in this PR:

Backend

  1. Extend the process_status function to consider the following cases:
    • Check the .status.containerState.
    • Check the .status.conditions, since they have the one-liner reason and a message.
    • If none of the above exist, it will use the Events emitted for the notebook.
    • In case it deduces the status from an Event and it's not available anymore, it will use a generic message.
  2. Add a 10 second delay to the backend logic, where we display a spinner and a generic message to prevent a warning icon from appearing just after a notebook is being initialized.
  3. Extend the getNotebook request to also include the processed status information in the Notebook details page.

Frontend

  1. Add an admonition in the details page of each Notebook with a detailed message on the current status.
  2. Don't show the popup when a notebook is being stopped.
Click here to see some screenshots of how it looks like

image

image

image

Related issue: #6999

@kimwnasptd
Copy link
Member

Thanks for this effort @elenzio9! I'll also create a more generalized issue for this effort, since we'll also need to set some future goals for how the Notebooks Controller exposes the status right now.

Regarding this PR, could you also create some Cypress tests for the different cases of the status we expect? This way we'll be sure this expectation will be tested in future PRs

@elenzio9 elenzio9 force-pushed the feature-elena-jwa-exposing-errors branch 2 times, most recently from 269f4aa to b8a20a2 Compare February 16, 2023 09:08
@elenzio9
Copy link
Contributor Author

Regarding this PR, could you also create some Cypress tests for the different cases of the status we expect? This way we'll be sure this expectation will be tested in future PRs

After looking at the Cypress tests I found this one, which checks the status icon considering any type of status. So I think that covers us at least for now.

Once the frontend receives the raw YAML of each notebook (rather than the processed status sent by the backend), we can go ahead and create more tests for the different cases of the status we expect, as then the preprocessing part will happen in the frontend. However, this requires improvements to be made on the Notebook Controller side in order to always expose the status in the Notebook's .status.conditions.

@kimwnasptd Wdyt?

@elenzio9 elenzio9 force-pushed the feature-elena-jwa-exposing-errors branch 6 times, most recently from a9861a0 to ad9b231 Compare February 17, 2023 11:19
@elenzio9 elenzio9 changed the title [jwa-exposing-errors] Improve how JWA exposes errors jwa: Improve how JWA exposes errors Feb 24, 2023
@elenzio9 elenzio9 force-pushed the feature-elena-jwa-exposing-errors branch from ad9b231 to ef3af1b Compare March 1, 2023 19:03
Copy link
Contributor

@tasos-ale tasos-ale 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 the PR @elenzio9. Please take a look at my comments.

@elenzio9 elenzio9 force-pushed the feature-elena-jwa-exposing-errors branch from ef3af1b to bbe0233 Compare March 10, 2023 13:25
@google-oss-prow google-oss-prow bot added size/XL and removed size/L labels Mar 10, 2023
@elenzio9
Copy link
Contributor Author

Thanks for the PR @elenzio9. Please take a look at my comments.

@tasos-ale Thanks for you comments! I just force pushed!

@elenzio9 elenzio9 force-pushed the feature-elena-jwa-exposing-errors branch from 07afc0a to 4d810cd Compare March 10, 2023 15:48
@elenzio9 elenzio9 force-pushed the feature-elena-jwa-exposing-errors branch 3 times, most recently from b84f73b to 3cce67c Compare March 14, 2023 11:09
@tasos-ale
Copy link
Contributor

/lgtm
cc @kimwnasptd

* Have an admonition in the details page of each Notebook with a
  detailed message on the current status.

Signed-off-by: Elena Zioga <elena@arrikto.com>
The process_status parses the status by:
- Checking the .status.containerState.
- Checking the .status.conditions, since they have the one-liner reason
  and a message.
- If none of the above exist, it will use the Events emitted for the
  notebook.
- In case it deduces the status from an Event and it's not available
  anymore, it uses a generic message.

Also, add a 10 second delay to the backend logic where we display a
spinner and a generic message to prevent a warning icon from appearing
immediately after a notebook is initialized.

Signed-off-by: Elena Zioga <elena@arrikto.com>
* Extend the getNotebook request to also include the processed status
  information in the Notebook details page.

Signed-off-by: Elena Zioga <elena@arrikto.com>
Extend the frontend by:
- Adding an admonition with a detailed message on the current status
  bellow the notebook name.
- Adding the processed_status field.

Signed-off-by: Elena Zioga <elena@arrikto.com>
Fix unit tests accordingly.

Signed-off-by: Elena Zioga <elena@arrikto.com>
* Use the waiting status, which also uses the spinner, when a notebook
  is being stopped.

Signed-off-by: Elena Zioga <elena@arrikto.com>
Signed-off-by: Elena Zioga <elena@arrikto.com>
@elenzio9 elenzio9 force-pushed the feature-elena-jwa-exposing-errors branch from 3cce67c to ee15024 Compare March 23, 2023 12:07
@google-oss-prow google-oss-prow bot removed the lgtm label Mar 23, 2023
@elenzio9 elenzio9 force-pushed the feature-elena-jwa-exposing-errors branch from ee15024 to 991c6e4 Compare March 23, 2023 12:17
@elenzio9
Copy link
Contributor Author

Did a first pass and added some comments as I took a look at the backend changes. Will add more in the next days

@kimwnasptd Thanks for the comments! Just pushed the changes in fixup commits.

@elenzio9 elenzio9 force-pushed the feature-elena-jwa-exposing-errors branch from 991c6e4 to 6bebb7f Compare March 23, 2023 12:26
@kimwnasptd
Copy link
Member

/lgtm
/approve

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kimwnasptd

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

The pull request process is described 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

@google-oss-prow google-oss-prow bot merged commit 3649e7e into kubeflow:master Mar 23, 2023
@kimwnasptd kimwnasptd deleted the feature-elena-jwa-exposing-errors branch March 23, 2023 15:27
@thesuperzapper thesuperzapper modified the milestone: v1.9.0 May 9, 2024
Adembc pushed a commit to Adembc/notebooks that referenced this pull request Jun 22, 2024
* web-apps(front): Fix status case

* Fix the status case to properly show the warning icon when the status
  phase is warning.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* web-apps(front): Modify status-icon component

* Modify the status-icon component to follow the status cases.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* web-apps(front): Modify status component

Signed-off-by: Elena Zioga <elena@arrikto.com>

* web-apps(front): Introduce status-info component

* Have an admonition in the details page of each Notebook with a
  detailed message on the current status.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(back): Extend process_status function

The process_status parses the status by:
- Checking the .status.containerState.
- Checking the .status.conditions, since they have the one-liner reason
  and a message.
- If none of the above exist, it will use the Events emitted for the
  notebook.
- In case it deduces the status from an Event and it's not available
  anymore, it uses a generic message.

Also, add a 10 second delay to the backend logic where we display a
spinner and a generic message to prevent a warning icon from appearing
immediately after a notebook is initialized.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(back): Extend getNotebook request

* Extend the getNotebook request to also include the processed status
  information in the Notebook details page.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(front): Extend the frontend

Extend the frontend by:
- Adding an admonition with a detailed message on the current status
  bellow the notebook name.
- Adding the processed_status field.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(front): Fix unit tests

Fix unit tests accordingly.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa: Don't show the popup when a notebook is being stopped

* Use the waiting status, which also uses the spinner, when a notebook
  is being stopped.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* vwa(front): Update lib-status-icon

Signed-off-by: Elena Zioga <elena@arrikto.com>

* fixup! jwa(back): Extend getNotebook request

* fixup! jwa(back): Extend process_status function

---------

Signed-off-by: Elena Zioga <elena@arrikto.com>
Adembc pushed a commit to Adembc/notebooks that referenced this pull request Jun 22, 2024
* web-apps(front): Fix status case

* Fix the status case to properly show the warning icon when the status
  phase is warning.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* web-apps(front): Modify status-icon component

* Modify the status-icon component to follow the status cases.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* web-apps(front): Modify status component

Signed-off-by: Elena Zioga <elena@arrikto.com>

* web-apps(front): Introduce status-info component

* Have an admonition in the details page of each Notebook with a
  detailed message on the current status.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(back): Extend process_status function

The process_status parses the status by:
- Checking the .status.containerState.
- Checking the .status.conditions, since they have the one-liner reason
  and a message.
- If none of the above exist, it will use the Events emitted for the
  notebook.
- In case it deduces the status from an Event and it's not available
  anymore, it uses a generic message.

Also, add a 10 second delay to the backend logic where we display a
spinner and a generic message to prevent a warning icon from appearing
immediately after a notebook is initialized.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(back): Extend getNotebook request

* Extend the getNotebook request to also include the processed status
  information in the Notebook details page.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(front): Extend the frontend

Extend the frontend by:
- Adding an admonition with a detailed message on the current status
  bellow the notebook name.
- Adding the processed_status field.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(front): Fix unit tests

Fix unit tests accordingly.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa: Don't show the popup when a notebook is being stopped

* Use the waiting status, which also uses the spinner, when a notebook
  is being stopped.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* vwa(front): Update lib-status-icon

Signed-off-by: Elena Zioga <elena@arrikto.com>

* fixup! jwa(back): Extend getNotebook request

* fixup! jwa(back): Extend process_status function

---------

Signed-off-by: Elena Zioga <elena@arrikto.com>
Adembc pushed a commit to Adembc/notebooks that referenced this pull request Jun 22, 2024
* web-apps(front): Fix status case

* Fix the status case to properly show the warning icon when the status
  phase is warning.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* web-apps(front): Modify status-icon component

* Modify the status-icon component to follow the status cases.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* web-apps(front): Modify status component

Signed-off-by: Elena Zioga <elena@arrikto.com>

* web-apps(front): Introduce status-info component

* Have an admonition in the details page of each Notebook with a
  detailed message on the current status.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(back): Extend process_status function

The process_status parses the status by:
- Checking the .status.containerState.
- Checking the .status.conditions, since they have the one-liner reason
  and a message.
- If none of the above exist, it will use the Events emitted for the
  notebook.
- In case it deduces the status from an Event and it's not available
  anymore, it uses a generic message.

Also, add a 10 second delay to the backend logic where we display a
spinner and a generic message to prevent a warning icon from appearing
immediately after a notebook is initialized.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(back): Extend getNotebook request

* Extend the getNotebook request to also include the processed status
  information in the Notebook details page.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(front): Extend the frontend

Extend the frontend by:
- Adding an admonition with a detailed message on the current status
  bellow the notebook name.
- Adding the processed_status field.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(front): Fix unit tests

Fix unit tests accordingly.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa: Don't show the popup when a notebook is being stopped

* Use the waiting status, which also uses the spinner, when a notebook
  is being stopped.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* vwa(front): Update lib-status-icon

Signed-off-by: Elena Zioga <elena@arrikto.com>

* fixup! jwa(back): Extend getNotebook request

* fixup! jwa(back): Extend process_status function

---------

Signed-off-by: Elena Zioga <elena@arrikto.com>
Adembc pushed a commit to Adembc/notebooks that referenced this pull request Jun 23, 2024
* web-apps(front): Fix status case

* Fix the status case to properly show the warning icon when the status
  phase is warning.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* web-apps(front): Modify status-icon component

* Modify the status-icon component to follow the status cases.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* web-apps(front): Modify status component

Signed-off-by: Elena Zioga <elena@arrikto.com>

* web-apps(front): Introduce status-info component

* Have an admonition in the details page of each Notebook with a
  detailed message on the current status.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(back): Extend process_status function

The process_status parses the status by:
- Checking the .status.containerState.
- Checking the .status.conditions, since they have the one-liner reason
  and a message.
- If none of the above exist, it will use the Events emitted for the
  notebook.
- In case it deduces the status from an Event and it's not available
  anymore, it uses a generic message.

Also, add a 10 second delay to the backend logic where we display a
spinner and a generic message to prevent a warning icon from appearing
immediately after a notebook is initialized.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(back): Extend getNotebook request

* Extend the getNotebook request to also include the processed status
  information in the Notebook details page.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(front): Extend the frontend

Extend the frontend by:
- Adding an admonition with a detailed message on the current status
  bellow the notebook name.
- Adding the processed_status field.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(front): Fix unit tests

Fix unit tests accordingly.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa: Don't show the popup when a notebook is being stopped

* Use the waiting status, which also uses the spinner, when a notebook
  is being stopped.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* vwa(front): Update lib-status-icon

Signed-off-by: Elena Zioga <elena@arrikto.com>

* fixup! jwa(back): Extend getNotebook request

* fixup! jwa(back): Extend process_status function

---------

Signed-off-by: Elena Zioga <elena@arrikto.com>
Adembc pushed a commit to Adembc/notebooks that referenced this pull request Jun 23, 2024
* web-apps(front): Fix status case

* Fix the status case to properly show the warning icon when the status
  phase is warning.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* web-apps(front): Modify status-icon component

* Modify the status-icon component to follow the status cases.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* web-apps(front): Modify status component

Signed-off-by: Elena Zioga <elena@arrikto.com>

* web-apps(front): Introduce status-info component

* Have an admonition in the details page of each Notebook with a
  detailed message on the current status.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(back): Extend process_status function

The process_status parses the status by:
- Checking the .status.containerState.
- Checking the .status.conditions, since they have the one-liner reason
  and a message.
- If none of the above exist, it will use the Events emitted for the
  notebook.
- In case it deduces the status from an Event and it's not available
  anymore, it uses a generic message.

Also, add a 10 second delay to the backend logic where we display a
spinner and a generic message to prevent a warning icon from appearing
immediately after a notebook is initialized.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(back): Extend getNotebook request

* Extend the getNotebook request to also include the processed status
  information in the Notebook details page.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(front): Extend the frontend

Extend the frontend by:
- Adding an admonition with a detailed message on the current status
  bellow the notebook name.
- Adding the processed_status field.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa(front): Fix unit tests

Fix unit tests accordingly.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* jwa: Don't show the popup when a notebook is being stopped

* Use the waiting status, which also uses the spinner, when a notebook
  is being stopped.

Signed-off-by: Elena Zioga <elena@arrikto.com>

* vwa(front): Update lib-status-icon

Signed-off-by: Elena Zioga <elena@arrikto.com>

* fixup! jwa(back): Extend getNotebook request

* fixup! jwa(back): Extend process_status function

---------

Signed-off-by: Elena Zioga <elena@arrikto.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants