-
Notifications
You must be signed in to change notification settings - Fork 153
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
Update archived models and archived versions components #3206
base: main
Are you sure you want to change the base?
Conversation
467d440
to
416e81d
Compare
if (isArchiveModel) { | ||
return ( | ||
<EmptyModelRegistryState | ||
testid="empty-archive-model-versions" | ||
title="No versions" | ||
description={`${rm?.name} has no registered versions.`} | ||
/> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had discussion with @yih-wang and I will update the Empty state for version with archived model.
416e81d
to
0c991e1
Compare
0c991e1
to
1690e07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ppadti there's one fix missing here - it is possible to see the wrong view for a model or version by going to the URL as if it was archived when it's not or vice versa. We should have the pages check whether the model and/or version is actually archived or not archived, and redirect to the correct place if you're at the wrong URL. This is a corner case, but it can come up if you have an old tab open on a model or version before its archived state changes or if you bookmark one.
Example:
If I have a model that is not archived and go its details page, that URL is:
/modelRegistry/modelregistry-sample/registeredModels/13/versions
and if I edit that to:
/modelRegistry/modelregistry-sample/registeredModels/archive/13/versions
I incorrectly see the archived view even though the model is not archived. The page should redirect me back to that first URL.
If I then archive that model and navigate to it, then change its URL to remove /archive/
, we get the opposite problem. Either way it should redirect me to the URL corresponding to the real model state.
The same is true of the archived / non-archived version pages. They should detect which page you should be on based on whether model or version are archived and redirect you there if you aren't already there.
A few other comments below as well, but the rest LGTM! Thanks for the hard work on this.
frontend/src/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetailsView.tsx
Outdated
Show resolved
Hide resolved
frontend/src/pages/modelRegistry/screens/ModelVersions/ModelDetailsView.tsx
Outdated
Show resolved
Hide resolved
title={`All the versions have been archived along with the model by ${ | ||
rm?.owner ?? '--' | ||
} on ${ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yih-wang @vconzola I don't think we can actually display who the models/versions were archived by. This code will display that they have been archived by whoever is the model owner, which may not be true if multiple users have access to the registry and someone else archived it. The API currently has no way to record who made a change unless we change the owner when someone archives something, which doesn't seem right.
I think maybe we need to instead not name a user here and say "All the versions have been archived along with the model on [date]". What do you think?
In the future we could ask the MR team to add a lastModifiedBy
field to the API for us to track who made changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense to me since we don't record any model activities for now.
I think maybe we need to instead not name a user here and say "All the versions have been archived along with the model on [date]". What do you think?
Sounds good!
ahh... Some how I missed this, I thought only the archived models logic is wrong for versions under that. I will update this. Thanks!! |
1690e07
to
1d0d692
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except the one question here and the test failures @ppadti
useEffect(() => { | ||
if (rm?.state === ModelState.ARCHIVED && mv?.id) { | ||
navigate( | ||
archiveModelVersionDetailsUrl( | ||
mv.id, | ||
mv.registeredModelId, | ||
preferredModelRegistry?.metadata.name, | ||
), | ||
); | ||
} else if (mv?.state === ModelState.ARCHIVED) { | ||
navigate( | ||
modelVersionArchiveDetailsUrl( | ||
mv.id, | ||
mv.registeredModelId, | ||
preferredModelRegistry?.metadata.name, | ||
), | ||
); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should all these new useEffects have dependency arrays? I'm not sure whether it matters since the if
conditions are the same perf impact as comparing dependencies across renders, but it may still be better to not run the effects every render in case we modify them later.
Closes: RHOAIENG-11509
Description
This PR aims to update
How Has This Been Tested?
view archived models
view archived version
in model detailsTest Impact
Added cypress test.
Request review criteria:
Self checklist (all need to be checked):
If you have UI changes:
After the PR is posted & before it merges:
main