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

WD-8309 - feat: Display error when trying to retrieve models info #1686

Merged
merged 6 commits into from
Jan 25, 2024

Conversation

vladimir-cucu
Copy link
Contributor

@vladimir-cucu vladimir-cucu commented Jan 22, 2024

Done

  • Throw the “Unable to fetch the status.” error instead of using return. Afterward, throw the error, so that it is further caught in fetchAllModelStatuses().
  • If less than 10% of models error out, no error is processed in fetchAllModelStatuses(). Else, throw the error back, so that it is further caught in modelPollerMiddleware().
  • When trying to retrieve models info in modelPollerMiddleware(), send "Unable to load models." error if it is the first polling and all models error out, "Unable to load some models." error if it is the first polling and some models error out, "Unable to load latest model data." if it is later polling and the error appears in fetchAllModelStatuses() call, else send "Unable to list or update models." error. The error should be sent to juju -> modelsErrors in Redux store.
  • Display the previously mentioned error inline in pages/ModelsIndex/ModelsIndex.tsx.

QA

  • Modify the code of modelPollerMiddleware() to throw an error on line 217.
  • Verify that the error gets displayed on Models page and logged into the console.

Details

Screenshots

Screenshot from 2024-01-23 19-39-26

@webteam-app
Copy link

Demo starting at https://juju-dashboard-1686.demos.haus

Copy link

codecov bot commented Jan 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5e8ef26) 0.00% compared to head (2a43750) 95.02%.
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##           main    #1686       +/-   ##
=========================================
+ Coverage      0   95.02%   +95.02%     
=========================================
  Files         0      178      +178     
  Lines         0     5207     +5207     
  Branches      0     1524     +1524     
=========================================
+ Hits          0     4948     +4948     
- Misses        0      239      +239     
- Partials      0       20       +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@huwshimi huwshimi left a comment

Choose a reason for hiding this comment

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

This looks good, one test to add (feel free to merge this once you add that test).

@vladimir-cucu vladimir-cucu merged commit 20707b6 into canonical:main Jan 25, 2024
10 checks passed
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.

3 participants