This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch kw-disabled-bp-should-reject-trigger
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit 6a4f1ea35afc34974e9e5e5563eefd3754ca5da7
Author: Klesh Wong <[email protected]>
AuthorDate: Fri Dec 29 14:16:52 2023 +0800

    fix: trigger bp api should reject disabled bp
---
 backend/server/services/blueprint.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/backend/server/services/blueprint.go 
b/backend/server/services/blueprint.go
index 4dd94b9f6..fa2850895 100644
--- a/backend/server/services/blueprint.go
+++ b/backend/server/services/blueprint.go
@@ -406,6 +406,9 @@ func TriggerBlueprint(id uint64, syncPolicy 
*models.SyncPolicy, shouldSanitize b
                logger.Error(err, "GetBlueprint, id: %d", id)
                return nil, err
        }
+       if !blueprint.Enable {
+               return nil, errors.BadInput.New("blueprint is not enabled")
+       }
        blueprint.SkipCollectors = syncPolicy.SkipCollectors
        blueprint.FullSync = syncPolicy.FullSync
        pipeline, err := createPipelineByBlueprint(blueprint, syncPolicy)

Reply via email to