From 4749082244b371e7d1adda0413533578d98e589b Mon Sep 17 00:00:00 2001 From: YolanFery Date: Thu, 14 Nov 2024 14:09:24 +0100 Subject: [PATCH] fix: Prevent saving pipeline versions with the same name --- openhexa/cli/api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openhexa/cli/api.py b/openhexa/cli/api.py index a140cda..d9da825 100644 --- a/openhexa/cli/api.py +++ b/openhexa/cli/api.py @@ -77,6 +77,7 @@ class PipelineDefinitionErrorCode(enum.Enum): PIPELINE_DOES_NOT_SUPPORT_PARAMETERS = "PIPELINE_DOES_NOT_SUPPORT_PARAMETERS" INVALID_TIMEOUT_VALUE = "INVALID_TIMEOUT_VALUE" + DUPLICATE_PIPELINE_VERSION_NAME = "DUPLICATE_PIPELINE_VERSION_NAME" class PermissionDenied(Exception): @@ -589,6 +590,8 @@ def upload_pipeline( raise InvalidDefinitionError( "Timeout value is invalid : ensure that it's no negative and inferior to 12 hours." ) + elif PipelineDefinitionErrorCode.DUPLICATE_PIPELINE_VERSION_NAME.value in data["uploadPipeline"]["errors"]: + raise InvalidDefinitionError("The pipeline version name is already used. Please choose another name.") else: raise Exception(data["uploadPipeline"]["errors"])