-
Notifications
You must be signed in to change notification settings - Fork 178
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
Model Registry: Register New Version form #3078
Model Registry: Register New Version form #3078
Conversation
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.
When I'm trying to Register new version
via dropdown menu in the Registered models table.. after selecting model name.. the model location fields are pre-filled but in case of Register new version
button in the Versions table ... although the model name is prefilled, the model location fields aren't pre-filled, is this expected?
nope, that is not expected... thanks, good catch. |
53bfe29
to
401731f
Compare
bb50322
to
1328d73
Compare
Thanks for all the work @mturley! The only comment I have is regarding the visual style of the read-only fields (model registry and model name). I know you are following the mockup to use the read-only status for a text field. But recently I just noticed the other forms are using plain text to show the read-only values. See the image below. I think we should follow that consistency. I'm fine to either address it in this issue or leave it to post-mvp. Sorry for the duplicated work! |
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.
1328d73
to
7586ac5
Compare
@manaswinidas good catch, I've rebased and fixed that. I had to squash the commits to avoid a bunch of pain in rebasing on top of #3084, sorry if that makes it harder to re-review -- mostly I moved that PR's changes to RegisterModel into RegistrationCommonFormSections. @yih-wang no worries! yeah, do you mind including that somewhere we're tracking post-MVP refactors? I'm not sure the best place for it for now - we need to meet and follow up to make sure there are ENG issues opened for all those under https://issues.redhat.com/browse/RHOAIENG-10405 at some point soon. |
Signed-off-by: Mike Turley <[email protected]>
Signed-off-by: Mike Turley <[email protected]>
0c229ae
to
55d7029
Compare
Signed-off-by: Mike Turley <[email protected]>
55d7029
to
cc023cd
Compare
Signed-off-by: Mike Turley <[email protected]>
cc023cd
to
2dcc616
Compare
}, | ||
)[0]; | ||
|
||
export const filterArchiveVersions = (modelVersions: ModelVersion[]): ModelVersion[] => |
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.
could combine these to 2 by passing ModelState or even to 1 if you didn't mind doing models: ModelVersion[] | RegisteredModel[]
, doesn't matter though
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.
i see these were just moved from another place anyway 😆
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.
Yeah 😆 that's fair.. probably better to factor them out using generics or use ModelRegistryBase
, but that's tech debt for another time I think (or fine as-is if we never get to it)
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: 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 |
Add a ux issue RHOAIUX-317 to track the following work |
Closes RHOAIENG-7571
Description
Implements the "Register New Version" button in these places:
Depending on where the action was selected, the user will be redirected to one of these routes which both render the RegisterVersion page:
/modelRegistry/{mrName}/registerVersion
- Presents a typeahead select for choosing a model/modelRegistry/{mrName}/registeredModels/{registeredModelId}/registerVersion
- Pre-selects the model and disables the model fieldThe RegisterVersion form is mostly a subset of the RegisterModel form - Version Details and Model Location fields in both are factored out into a new component
RegistrationCommonFormSections
. The only difference is that instead of entering a model name and description we let the user select a model (or preselect it for them), and then we show some help text and prefill some fields based on the selected model.When a model is selected, the hook
usePrefillRegisterVersionFields
re-renders with a newregisteredModel
value which causes it to fetch the versions of that model, then fetch the artifacts for that version, finally deriving alatestVersion
andlatestArtifact
. TheuseEffect
in that hook is then triggered to update form values based onlatestArtifact
(source model format/version and model location endpoint/bucket/region), andlatestVersion
is returned and passed intoRegistrationCommonFormSections
where it is used to show the "Current version is ..." help text.If the model selection changes and the selected model has no version/artifact, nothing will be prefilled. If it has a version and artifact but the URI on that artifact is malformed (cannot be parsed into endpoint/bucket/region), only the source model format/version is prefilled. Any fields that can't be prefilled are reset to empty, so switching between models should not leave behind values prefilled from another model.
Registering a new version from the registered models table (no preselected model):
Selecting a model prefills fields:
Registering a new version from a registered model's page (when there are no versions):
Registering a new version from a registered model's page (when there are already versions):
Model is preselected and fields are already filled:
cc @yih-wang
How Has This Been Tested?
Tested on modelregistry-ui cluster. Tried registering versions by reaching the form from all 3 buttons, covered all cases described above re: prefilling.
Test Impact
Unit tests added for new
getLastCreatedItem
util, and tests moved for utils that moved (filterArchiveVersions
,filterLiveVersions
).Cypress tests added to cover all cases of prefilling/clearing behavior, form validation, and creating expected resources on submit in each case.
Request review criteria:
Self checklist (all need to be checked):
If you have UI changes:
After the PR is posted & before it merges:
main