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(OCPADVISOR-71): Show upgrade risks table #547

Merged
merged 11 commits into from
Apr 18, 2023

Conversation

gkarat
Copy link
Collaborator

@gkarat gkarat commented Apr 13, 2023

Implements https://issues.redhat.com/browse/OCPADVISOR-71.
Mocked at https://www.sketch.com/s/c5c07e06-f4a1-4c64-9cdf-8b12d8ac9ad5/a/25OY5ve.

This introduces the upgrade risks table that is shown under the "Upgrade risks" tab on the cluster details view.

  • The data for this table are fetched from the new back-end (Smart proxy) endpoint v1/cluster/%id/upgrade-risks-prediction.
  • The table must be shown if there are firing alerts or cluster operators available.
  • When there are no firing alerts nor cluster operators, the tab must show successful empty message.
  • If the response from back end is 503, then the tab must show the "not available" empty state.
  • For all other edge cases that are unknown/unexpected, the tab must show "something went wrong."

How to test

The real endpoint will serve no data for real clusters, thus it is better to run this PR together with the mock service:

  1. Follow https://github.com/RedHatInsights/ocp-advisor-frontend#using-insights-results-aggregator-mock instructions and make sure the webpack server and the mock server are running.
  2. Use different cluster IDs from https://github.com/RedHatInsights/insights-results-aggregator-mock/#clusters-that-return-valid-data and navigate to https://stage.foo.redhat.com:1337/beta/openshift/insights/advisor/clusters/%ID.
  3. Click on the "Upgrade risks" tab.
  4. Make sure the content matches with the specifics of this cluster (e.g., 00000003-eeee-eeee-eeee-000000000001 must show firing alerts and cluster operators).

Screenshots

image

image

image

image

image

@gkarat gkarat added the enhancement New feature or request label Apr 13, 2023
@gkarat gkarat self-assigned this Apr 13, 2023
@gkarat gkarat marked this pull request as ready for review April 13, 2023 09:15
@gkarat gkarat requested a review from a team as a code owner April 13, 2023 09:15
@gkarat gkarat force-pushed the ocpadvisor-71-upgrade-risks-tab branch from fbdfd72 to 04c790b Compare April 13, 2023 12:19
Copy link
Collaborator

@ikerreyes ikerreyes left a comment

Choose a reason for hiding this comment

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

Thanks a lot, great work with the tests

),
'successful, alerts empty': () => {
const fixtures = upgradeRisksFixtures;
fixtures.upgrade_recommendation.upgrade_risks_predictors.alerts = [];
Copy link
Collaborator

Choose a reason for hiding this comment

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

will not this modify the inner object for any subsequent uses? Don't we need a copy?

adonispuente
adonispuente previously approved these changes Apr 13, 2023
Copy link

@adonispuente adonispuente left a comment

Choose a reason for hiding this comment

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

Great work, didnt find any issues, LGTM!

@adonispuente adonispuente dismissed their stale review April 14, 2023 12:40

Need to re-review

@Fewwy
Copy link
Collaborator

Fewwy commented Apr 14, 2023

After the update for the mock server, I see every type of table that is on the mocks. Great job. LGTM

data?.upgrade_recommendation?.upgrade_risks_predictors || {};

return (
<TableComposable

Choose a reason for hiding this comment

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

When comparing to the mocks I see a few links/icons that arent shown here.
Your version:
Screen Shot 2023-04-14 at 9 16 19 AM

mock version:
Screen Shot 2023-04-14 at 9 17 15 AM

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch. there is no final agreement on the docs URL, so I'd wait for folks first to decide and then will add it via separate PR most probably

@gkarat gkarat merged commit f9e3031 into RedHatInsights:master Apr 18, 2023
@gkarat gkarat deleted the ocpadvisor-71-upgrade-risks-tab branch April 18, 2023 10:15
gkarat pushed a commit that referenced this pull request Apr 18, 2023
# [1.13.0](v1.12.1...v1.13.0) (2023-04-18)

### Features

* **OCPADVISOR-71:** Show upgrade risks table ([#547](#547)) ([f9e3031](f9e3031))
@gkarat
Copy link
Collaborator Author

gkarat commented Apr 18, 2023

🎉 This PR is included in version 1.13.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants