From 89a0dc0f630465dabb108cc3be563920fe6b07ed Mon Sep 17 00:00:00 2001 From: Guiheux Steven Date: Fri, 28 Jun 2019 13:33:28 +0200 Subject: [PATCH] fix(api): load pipelines when parsing workflow for an as code workflow run (#4405) --- engine/api/workflow/workflow_parser.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/api/workflow/workflow_parser.go b/engine/api/workflow/workflow_parser.go index 335d1280ce..5e1529985e 100644 --- a/engine/api/workflow/workflow_parser.go +++ b/engine/api/workflow/workflow_parser.go @@ -70,8 +70,9 @@ func ParseAndImport(ctx context.Context, db gorp.SqlExecutor, store cache.Store, return nil, nil, errW } - // Browse all node to find IDs - if err := IsValid(ctx, store, db, w, proj, u, LoadOptions{}); err != nil { + // Load deep pipelines if we come from workflow run ( so we have hook uuid ). + // We need deep pipelines to be able to run stages/jobs + if err := IsValid(ctx, store, db, w, proj, u, LoadOptions{DeepPipeline: opts.HookUUID != ""}); err != nil { return nil, nil, sdk.WrapError(err, "Workflow is not valid") }