From f80a8a35d415a96cd104665bfb41c154ec103067 Mon Sep 17 00:00:00 2001 From: Swaraj Kumar Date: Tue, 21 Oct 2025 16:33:45 +0530 Subject: [PATCH] UploadModel uploads with incorrect artifact ver ModelKey is updated to use the newArtifactversion instead of artifactVersion. Model Artifact updation is carried out first and then the modelKey is set. Issue-ID: AIMLFW-304 and AIMLFW-282 Change-Id: I71d626a419c1b273db89c4115f4b04656765d8de Signed-off-by: Swaraj Kumar --- apis/mmes_apis.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apis/mmes_apis.go b/apis/mmes_apis.go index 34e20e7..3c22883 100644 --- a/apis/mmes_apis.go +++ b/apis/mmes_apis.go @@ -336,8 +336,6 @@ func (m *MmeApiHandler) UploadModel(cont *gin.Context) { } artifactVersion := modelInfo.ModelId.ArtifactVersion - modelKey := fmt.Sprintf("%s_%s_%s", modelName, modelVersion, artifactVersion) - exportBucket := strings.ToLower(modelName) // Update the Artifact-Version newArtifactVersion, err := utils.IncrementArtifactVersion(artifactVersion) if err != nil { @@ -350,6 +348,9 @@ func (m *MmeApiHandler) UploadModel(cont *gin.Context) { }) return } + modelKey := fmt.Sprintf("%s_%s_%s", modelName, modelVersion, newArtifactVersion) + exportBucket := strings.ToLower(modelName) + modelInfo.ModelId.ArtifactVersion = newArtifactVersion if err := m.iDB.Update(*modelInfo); err != nil { statusCode := http.StatusInternalServerError -- 2.16.6