8000 fix(api): ignore error if wkf holder not found when loading pipeline … · ovh/cds@7491dbd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 7491dbd

Browse files
authored
fix(api): ignore error if wkf holder not found when loading pipeline (#5184)
1 parent d21537d commit 7491dbd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

engine/api/pipeline.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,15 @@ func (api *API) getPipelineHandler() service.Handler {
335335
wkAscodeHolder, err := workflow.LoadByRepo(ctx, api.Cache, api.mustDB(), *proj, p.FromRepository, workflow.LoadOptions{
336336
WithTemplate: true,
337337
})
338-
if err != nil {
338+
if err != nil && !sdk.ErrorIs(err, sdk.ErrNotFound) {
339339
return 6E57 sdk.NewErrorFrom(err, "cannot found workflow holder of the pipeline")
340340
}
341341
p.WorkflowAscodeHolder = wkAscodeHolder
342+
343+
// FIXME from_repository should never be set if the workflow holder was deleted
344+
if p.WorkflowAscodeHolder == nil {
345+
p.FromRepository = ""
346+
}
342347
}
343348

344349
return service.WriteJSON(w, p, http.StatusOK)

0 commit comments

Comments
 (0)
0