Skip to content

Commit 93e597e

Browse files
authored
fix: Prevent saving pipeline versions with the same name (#220)
1 parent 965ba0b commit 93e597e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

openhexa/cli/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class PipelineDefinitionErrorCode(enum.Enum):
7777

7878
PIPELINE_DOES_NOT_SUPPORT_PARAMETERS = "PIPELINE_DOES_NOT_SUPPORT_PARAMETERS"
7979
INVALID_TIMEOUT_VALUE = "INVALID_TIMEOUT_VALUE"
80+
DUPLICATE_PIPELINE_VERSION_NAME = "DUPLICATE_PIPELINE_VERSION_NAME"
8081

8182

8283
class PermissionDenied(Exception):
@@ -589,6 +590,8 @@ def upload_pipeline(
589590
raise InvalidDefinitionError(
590591
"Timeout value is invalid : ensure that it's no negative and inferior to 12 hours."
591592
)
593+
elif PipelineDefinitionErrorCode.DUPLICATE_PIPELINE_VERSION_NAME.value in data["uploadPipeline"]["errors"]:
594+
raise InvalidDefinitionError("The pipeline version name is already used. Please choose another name.")
592595
else:
593596
raise Exception(data["uploadPipeline"]["errors"])
594597

0 commit comments

Comments
 (0)