Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat : HEXA-1124 button to create a new pipeline from a template #887

Merged

Conversation

YolanFery
Copy link
Contributor

GraphQL endpoint to create a new pipeline from a template

Changes

  • Endpoint and model method to create a pipeline
  • Add source_template to pipeline to keep a reference of the template used to create this pipeline
  • Unit test to cover creation of pipeline and duplicate creation of pipeline

How/what to test

Creating a pipeline from a template using GraphQL endpoint is working

@YolanFery YolanFery merged commit fee5a93 into main Dec 24, 2024
4 checks passed
@YolanFery YolanFery deleted the HEXA-1124-button-to-create-a-new-pipeline-from-a-template branch December 24, 2024 08:47
except PipelineTemplateVersion.DoesNotExist:
return {"success": False, "errors": ["PIPELINE_TEMPLATE_VERSION_NOT_FOUND"]}

pipeline_code = f"{template_version.template.source_pipeline.code} (from Template)"
Copy link
Contributor

@nazarfil nazarfil Dec 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give more context about this comment? The (from Template) would be appended to the pipeline code and would break the parsing if we would reuse it as it.
So I would like to know if the expected flow is for the user to open the pipeline code and edit it, and the comment line will indicate that code is copied form template and has to be edited?
If the goal of it is to mark it as code form template then i would append it as a python comment "/n # (from Template)"

Copy link
Contributor Author

@YolanFery YolanFery Dec 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for raising this

The intent was to create a different name for the pipeline that is created but you are correct that it makes the code unparseable. In addition to mis-align the python code and the Database object (the @pipeline(code= , name= ) would need to be modified )

So, as part of #885, I am using the same name as the original Pipeline to avoid such complexity at this point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants