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

Don't crash if modelregistries namespace is not present in the DSC #3248

Merged

Conversation

mturley
Copy link
Contributor

@mturley mturley commented Sep 24, 2024

Followup to #3239
Needed for https://issues.redhat.com/browse/RHOAIENG-12311

Description

See slack thread here. The above PR creates a situation where if model registry is not enabled on a cluster, the dashboard will crash on server start. This PR is an immediate fix for the crash, and I'll follow up with a second PR to switch us to using a ResourceWatcher so we make sure the namespace value is current in case it is not available yet when the dashboard starts.

This PR also fixes the same type in the frontend to make sure we are always being defensive when we try to read this value.

How Has This Been Tested?

Tested on https://console-openshift-console.apps.ods-qe-psi-01.osp.rh-ods.com/ which is old enough that its DSC has no modelregistry spec or status. Running the backend locally on main, verified that it crashes when using this cluster's API. Running the same way on this branch there is no crash.

Test Impact

N/A, no tests in the backend.

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change.

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

@mturley
Copy link
Contributor Author

mturley commented Sep 24, 2024

/hold
We're also not strict enough with the same type in the frontend, will fix momentarily

@openshift-ci openshift-ci bot added do-not-merge/hold This PR is hold for some reason and removed lgtm labels Sep 24, 2024
@mturley
Copy link
Contributor Author

mturley commented Sep 24, 2024

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold This PR is hold for some reason label Sep 24, 2024
@mturley mturley removed the approved label Sep 24, 2024
Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 85.04%. Comparing base (3af499a) to head (4abe660).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...nd/src/pages/modelRegistrySettings/CreateModal.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3248      +/-   ##
==========================================
- Coverage   85.06%   85.04%   -0.02%     
==========================================
  Files        1293     1293              
  Lines       28846    28846              
  Branches     7759     7759              
==========================================
- Hits        24538    24533       -5     
- Misses       4308     4313       +5     
Files with missing lines Coverage Δ
...lRegistry/context/ModelRegistrySelectorContext.tsx 100.00% <100.00%> (ø)
frontend/src/k8sTypes.ts 100.00% <ø> (ø)
...delRegistrySettings/ModelRegistriesPermissions.tsx 96.77% <100.00%> (ø)
...elRegistrySettings/useModelRegistryRoleBindings.ts 66.66% <100.00%> (ø)
...nd/src/pages/modelRegistrySettings/CreateModal.tsx 68.67% <0.00%> (ø)

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3af499a...4abe660. Read the comment docs.

@openshift-ci openshift-ci bot removed the lgtm label Sep 24, 2024
@openshift-ci openshift-ci bot added the lgtm label Sep 24, 2024
Copy link
Contributor

openshift-ci bot commented Sep 24, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewballantyne, gitdallas

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

@openshift-merge-bot openshift-merge-bot bot merged commit d5938bf into opendatahub-io:main Sep 24, 2024
8 checks passed
@mturley mturley deleted the RHOAIENG-12311-followup-fix branch September 24, 2024 23:36
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