diff --git a/cli/run_util_pipeline_test.go b/cli/run_util_pipeline_test.go index 6b2ceec5..9a58d8c6 100644 --- a/cli/run_util_pipeline_test.go +++ b/cli/run_util_pipeline_test.go @@ -41,7 +41,7 @@ pipelines: dag: workflows: a: {} - a1: { source: a, inputs: [key: value] } + a1: { uses: a, inputs: [key: value] } b: { depends_on: [a] } c: { depends_on: [a] } d: { depends_on: [a] } @@ -109,7 +109,7 @@ pipelines: dag: workflows: a: {} - b: { source: c } + b: { uses: c } workflows: a: {} ` @@ -120,7 +120,7 @@ pipelines: dag: workflows: a: {} - b: { source: c } + b: { uses: c } workflows: a: {} b: {} diff --git a/models/models.go b/models/models.go index 7f42c803..824c9170 100644 --- a/models/models.go +++ b/models/models.go @@ -82,8 +82,7 @@ type GraphPipelineWorkflowModel struct { AbortOnFail bool `json:"abort_on_fail,omitempty" yaml:"abort_on_fail,omitempty"` RunIf GraphPipelineRunIfModel `json:"run_if,omitempty" yaml:"run_if,omitempty"` ShouldAlwaysRun GraphPipelineAlwaysRunMode `json:"should_always_run,omitempty" yaml:"should_always_run,omitempty"` - // TODO: the name is not final - Source string `json:"source,omitempty" yaml:"source,omitempty"` + Uses string `json:"uses,omitempty" yaml:"uses,omitempty"` } type GraphPipelineRunIfModel struct { diff --git a/models/models_methods.go b/models/models_methods.go index 6c4198c3..f28e7e08 100644 --- a/models/models_methods.go +++ b/models/models_methods.go @@ -604,10 +604,10 @@ func validateDAGPipeline(pipelineID string, pipeline *PipelineModel, config *Bit return fmt.Errorf("workflow (%s) defined in pipeline (%s) is a utility workflow", pipelineWorkflowID, pipelineID) } - isWorkflowVariant := pipelineWorkflow.Source != "" + isWorkflowVariant := pipelineWorkflow.Uses != "" if isWorkflowVariant { - if _, ok := config.Workflows[pipelineWorkflow.Source]; !ok { - return fmt.Errorf("workflow (%s) referenced in pipeline (%s) in workflow variant (%s) is not found in the workflow definitions", pipelineWorkflow.Source, pipelineID, pipelineWorkflowID) + if _, ok := config.Workflows[pipelineWorkflow.Uses]; !ok { + return fmt.Errorf("workflow (%s) referenced in pipeline (%s) in workflow variant (%s) is not found in the workflow definitions", pipelineWorkflow.Uses, pipelineID, pipelineWorkflowID) } if _, ok := config.Workflows[pipelineWorkflowID]; ok {