From e98646db7e33ccd0141ef732512c3ecd3179844c Mon Sep 17 00:00:00 2001 From: Yulia Krimerman Date: Thu, 15 Aug 2024 16:29:43 -0400 Subject: [PATCH] ' ' --- frontend/src/__mocks__/mockRegisteredModel.ts | 3 --- .../cypress/tests/mocked/modelRegistry/modelRegistry.cy.ts | 5 ++++- .../tests/mocked/modelRegistry/registeredModelArchive.cy.ts | 4 ++++ frontend/src/concepts/modelRegistry/types.ts | 5 +++-- .../modelRegistry/screens/ModelVersions/ModelDetailsView.tsx | 2 +- .../src/pages/modelRegistry/screens/RegisterModel/utils.ts | 2 +- .../src/pages/modelRegistry/screens/__tests__/utils.spec.ts | 2 -- 7 files changed, 13 insertions(+), 10 deletions(-) diff --git a/frontend/src/__mocks__/mockRegisteredModel.ts b/frontend/src/__mocks__/mockRegisteredModel.ts index 404bc59c8f..7a34f843d1 100644 --- a/frontend/src/__mocks__/mockRegisteredModel.ts +++ b/frontend/src/__mocks__/mockRegisteredModel.ts @@ -4,7 +4,6 @@ import { createModelRegistryLabelsObject } from './utils'; type MockRegisteredModelType = { id?: string; name?: string; - author?: string; owner?: string; state?: ModelState; description?: string; @@ -13,7 +12,6 @@ type MockRegisteredModelType = { export const mockRegisteredModel = ({ name = 'test', - author = 'Author 1', owner = 'Author 1', state = ModelState.LIVE, description = '', @@ -27,7 +25,6 @@ export const mockRegisteredModel = ({ lastUpdateTimeSinceEpoch: '1710404288975', name, state, - author, owner, customProperties: createModelRegistryLabelsObject(labels), }); diff --git a/frontend/src/__tests__/cypress/cypress/tests/mocked/modelRegistry/modelRegistry.cy.ts b/frontend/src/__tests__/cypress/cypress/tests/mocked/modelRegistry/modelRegistry.cy.ts index 2265324edd..495f4a5719 100644 --- a/frontend/src/__tests__/cypress/cypress/tests/mocked/modelRegistry/modelRegistry.cy.ts +++ b/frontend/src/__tests__/cypress/cypress/tests/mocked/modelRegistry/modelRegistry.cy.ts @@ -66,7 +66,10 @@ const initIntercepts = ({ ], }), ], - modelVersions = [mockModelVersion({ name: 'model version' })], + modelVersions = [ + mockModelVersion({ author: 'Author 1' }), + mockModelVersion({ name: 'model version' }), + ], allowed = true, }: HandlersProps) => { cy.interceptOdh( diff --git a/frontend/src/__tests__/cypress/cypress/tests/mocked/modelRegistry/registeredModelArchive.cy.ts b/frontend/src/__tests__/cypress/cypress/tests/mocked/modelRegistry/registeredModelArchive.cy.ts index 8feea1aab0..1c8d9acf98 100644 --- a/frontend/src/__tests__/cypress/cypress/tests/mocked/modelRegistry/registeredModelArchive.cy.ts +++ b/frontend/src/__tests__/cypress/cypress/tests/mocked/modelRegistry/registeredModelArchive.cy.ts @@ -171,6 +171,7 @@ describe('Restoring archive model', () => { description: '', externalID: '1234132asdfasdf', state: 'LIVE', + owner: 'Author 1', }); }); }); @@ -200,6 +201,7 @@ describe('Restoring archive model', () => { description: '', externalID: '1234132asdfasdf', state: 'LIVE', + owner: 'Author 1', }); }); }); @@ -233,6 +235,7 @@ describe('Archiving model', () => { description: '', externalID: '1234132asdfasdf', state: 'ARCHIVED', + owner: 'Author 1', }); }); }); @@ -266,6 +269,7 @@ describe('Archiving model', () => { description: '', externalID: '1234132asdfasdf', state: 'ARCHIVED', + owner: 'Author 1', }); }); }); diff --git a/frontend/src/concepts/modelRegistry/types.ts b/frontend/src/concepts/modelRegistry/types.ts index e0dc58a031..142809ce35 100644 --- a/frontend/src/concepts/modelRegistry/types.ts +++ b/frontend/src/concepts/modelRegistry/types.ts @@ -85,8 +85,6 @@ export type ModelRegistryBase = { id: string; name: string; externalID?: string; - author?: string; - owner?: string; description?: string; createTimeSinceEpoch?: string; lastUpdateTimeSinceEpoch: string; @@ -96,6 +94,7 @@ export type ModelRegistryBase = { export type ModelArtifact = ModelRegistryBase & { uri?: string; state?: ModelArtifactState; + author?: string; modelFormatName?: string; storageKey?: string; storagePath?: string; @@ -106,11 +105,13 @@ export type ModelArtifact = ModelRegistryBase & { export type ModelVersion = ModelRegistryBase & { state?: ModelState; + author?: string; registeredModelId: string; }; export type RegisteredModel = ModelRegistryBase & { state?: ModelState; + owner?: string; }; export type InferenceService = ModelRegistryBase & { diff --git a/frontend/src/pages/modelRegistry/screens/ModelVersions/ModelDetailsView.tsx b/frontend/src/pages/modelRegistry/screens/ModelVersions/ModelDetailsView.tsx index 09c8ffc6e2..1bef66780c 100644 --- a/frontend/src/pages/modelRegistry/screens/ModelVersions/ModelDetailsView.tsx +++ b/frontend/src/pages/modelRegistry/screens/ModelVersions/ModelDetailsView.tsx @@ -82,7 +82,7 @@ const ModelDetailsView: React.FC = ({ registeredModel: rm - {rm.author || '-'} + {rm.owner || '-'} { it('returns a given RegisteredModel with id/name/timestamps removed, customProperties updated and other values unchanged', () => { const registeredModel = mockRegisteredModel({ id: '1', - author: 'Author 1', owner: 'Author 1', name: 'test-model', description: 'Description here', @@ -288,7 +287,6 @@ describe('getPatchBody', () => { ); expect(result).toEqual({ description: 'Description here', - author: 'Author 1', customProperties: { label1: { string_value: '', metadataType: ModelRegistryMetadataType.STRING }, },