-
Notifications
You must be signed in to change notification settings - Fork 167
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
changed the source of Owner and updated field to be searchable and so… #3095
changed the source of Owner and updated field to be searchable and so… #3095
Conversation
registeredModelRow.findOwner().contains('Author 1'); | ||
registeredModelRow.findOwner().should(($owner) => { | ||
const text = $owner.text(); | ||
expect(text).to.be.oneOf(['Author 1', '-']); |
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 think we should test both ways independently here (that the author shows up if the author prop is populated, that the '-' shows up if not).
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 line of code started failing with the new change, and I wasn't quite able to figure out why ( findOwner has the same textId 'registered-model-owner' so it should be good) . It's complaining that :"Timed out retrying after 10000ms: Expected to find content: 'Author 1' within the element:
but never did". Do you have maybe a suggestion what can be missing?
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.
It looks like you haven't updated the mock types and data. They still have the author in the 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.
So if I understood correctly I should delete "mockModelVersion({ author: 'Author 1' })" line 70 in that test file? - I tried, that didn't help. I also tried to delete that field from all the 3 parts within MockModelVersionType but then the test suite didn't even run.
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.
You'll need to also add the author prop to the RegisteredModel where your code is looking for it.
As for the tests not running in MockModelVersionType after removing all the model versions. I'm not sure, is that completely removed from everywhere or just within this case? If removed generally and tests fail after mocking that way, then there must be some test that is still falsely depending on that.
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.
ah, actually i can't do that as the mockRegisteredModel.ts
file wasn't touched yet. but basically:
then you could update the calls to mockRegisteredModel
in modelRegistry.cy.ts
to whatever owner/author you want, and the test to match. could use Author 1
if you want, but i think something with "Owner" would make more sense for the owner field so people don't get the two mixed up in reviewing/making tests.
or is there even an author field? you may have just had a typo below inModelDetailView
. Seems odd the detail view would use author
for "Owner" while the table row would use owner
for "Owner"
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.
Sorry, I just wrapped my head around the story and changes a bit more. I think you need to still treat author
the same way and keep it in modelVersion and just add owner
to the registeredModel. So the RM has an "owner" while the version has an "author".
Maybe @mturley has some input on this
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.
Yes, it's confusing but the RegisteredModel has an owner
but no author and the ModelVersion (and ModelArtifact, though that's not relevant) has an author
but no owner. Currently in the UI we are showing "Owner" and under the hood we're using the version's author
field.
There are two changes that prompted this story:
- The database now has
owner
on RegisteredModel, which previously didn't have either owner or author (which is why we were fetching the author from the model's latest version). - The UX microcopy is being updated so that we call it in the UI what it is in the database -- for models we call it "Owner" and use the
.owner
field, and for versions we'll call it "Author" and use the.author
field. (edit: the actual microcopy change for using the text "Author" on the versions is part of a separate story).
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 latter change to use "Author" in the UI wasn't originally part of this Jira issue, it was from a followup discussion, but I think making that change in this PR would be least confusing. Is that ok @YuliaKrimerman ?
Ignore this, I was growing the scope of the PR
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.
Actually --- scratch that last point, sorry. We don't have to touch anything with how Versions display the owner/author, that's out of scope here.
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.
A couple changes here.
author?: string; | ||
owner?: string; |
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.
we should only have owner
here, not author
. Same for the other two instances below in this file.
author?: string; | ||
owner?: string; |
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.
We shouldn't add either of these to ModelRegistryBase
- I know I had originally added author here when we were pairing on this @YuliaKrimerman but I was wrong, sorry. I hadn't realized it was called owner
for RegisteredModels.
The type updates we need are:
ModelRegistryBase - no change
RegisteredModel - add owner
ModelArtifact - no change (don't remove author
)
ModelVersion - no change (don't remove author
)
@@ -33,6 +33,7 @@ export const registerModel = async ( | |||
name: formData.modelName, | |||
description: formData.modelDescription, | |||
customProperties: {}, | |||
author, |
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.
This line will need to be:
owner: author,
because the property we're adding on RegisteredModel is owner
, but we can leave the function argument called author
because we're using the same value for the author
of the ModelVersion and ModelArtifact in the registerVersion
call below.
Alternatively, if you want you can change this registerModel
function so it takes an owner
instead of author
, then this line is just owner,
and then when we call registerVersion()
below you can pass owner
instead of author
.
I feel like I'm talking in circles, hopefully this makes sense.
author: 'Author 1', | ||
owner: 'Author 1', |
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.
Same deal here, we only need owner
for models.
@@ -286,9 +288,11 @@ describe('getPatchBody', () => { | |||
); | |||
expect(result).toEqual({ | |||
description: 'Description here', | |||
author: 'Author 1', |
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.
So we'll want to remove author
here as well.
registeredModelRow.findOwner().contains('Author 1'); | ||
registeredModelRow.findOwner().should(($owner) => { | ||
const text = $owner.text(); | ||
expect(text).to.be.oneOf(['Author 1', '-']); |
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.
Actually --- scratch that last point, sorry. We don't have to touch anything with how Versions display the owner/author, that's out of scope here.
Ready for hopefully final review @mturley @gitdallas |
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
Checked with Postman... the owner field gets picked up fine
c283776
to
e98646d
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.
LGTM!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gitdallas, manaswinidas, mturley 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 |
…rtable
https://issues.redhat.com/browse/RHOAIENG-7566
Description
Update the source of the Owner - now it's just a field that we get from the API response. I've attached the screenshot that shows where this field on the page now is coming from.
In addition I've made the owner a sortable field as well as a Search option. See screenshots attached.
How Has This Been Tested?
Tested on the Model Registry Cluster
Test Impact
Updated the tests to cover now both field options scenarios( with Author and when "-" )
Request review criteria:
Self checklist (all need to be checked):
If you have UI changes:
After the PR is posted & before it merges:
main