Skip to content

Commit

Permalink
fix: Prevent saving pipeline versions with the same name
Browse files Browse the repository at this point in the history
  • Loading branch information
YolanFery committed Nov 14, 2024
1 parent 965ba0b commit 4749082
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions openhexa/cli/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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"])

Expand Down

0 comments on commit 4749082

Please sign in to comment.