Skip to content

Commit

Permalink
fix issue (#3624)
Browse files Browse the repository at this point in the history
  • Loading branch information
YuliaKrimerman authored Jan 8, 2025
1 parent 5560ba2 commit 9a2449c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,16 @@ describe('updateTimestamps', () => {

expect(mockApi.patchModelVersion).toHaveBeenCalledWith(
{},
{ state: ModelState.LIVE },
{
state: ModelState.LIVE,
customProperties: {
_lastModified: {
metadataType: ModelRegistryMetadataType.STRING,
// eslint-disable-next-line camelcase
string_value: '2024-01-01T00:00:00.000Z',
},
},
},
fakeModelVersionId,
);
});
Expand Down
18 changes: 17 additions & 1 deletion frontend/src/concepts/modelRegistry/utils/updateTimestamps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,23 @@ export const bumpModelVersionTimestamp = async (
}

try {
await api.patchModelVersion({}, { state: ModelState.LIVE }, modelVersionId);
const currentTime = new Date().toISOString();
await api.patchModelVersion(
{},
{
// This is a workaround to update the timestamp on the backend. There is a bug opened for model registry team
// to fix this issue. see https://issues.redhat.com/browse/RHOAIENG-17614
state: ModelState.LIVE,
customProperties: {
_lastModified: {
metadataType: ModelRegistryMetadataType.STRING,
// eslint-disable-next-line camelcase
string_value: currentTime,
},
},
},
modelVersionId,
);
} catch (error) {
throw new Error(
`Failed to update model version timestamp: ${
Expand Down

0 comments on commit 9a2449c

Please sign in to comment.