This is an automated email from the ASF dual-hosted git repository. lynwee pushed a commit to branch fix-0508 in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit 310d9b894d1bd1ef3642c263d5e082f1f70a62ac Author: d4x1 <1507509...@qq.com> AuthorDate: Thu May 8 19:30:08 2025 +0800 fix(framework): return empty project name when blueprint id is zero --- backend/server/services/pipeline.go | 3 +++ backend/server/services/pipeline_notification.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/server/services/pipeline.go b/backend/server/services/pipeline.go index 41e8d8c28..e5e187ac9 100644 --- a/backend/server/services/pipeline.go +++ b/backend/server/services/pipeline.go @@ -362,6 +362,9 @@ func getProjectName(pipeline *models.Pipeline) (string, errors.Error) { return "", errors.Default.New("pipeline is nil") } blueprintId := pipeline.BlueprintId + if blueprintId == 0 { + return "", nil + } dbBlueprint := &models.Blueprint{} err := db.First(dbBlueprint, dal.Where("id = ?", blueprintId)) if err != nil { diff --git a/backend/server/services/pipeline_notification.go b/backend/server/services/pipeline_notification.go index 2c25c44ce..5370abc34 100644 --- a/backend/server/services/pipeline_notification.go +++ b/backend/server/services/pipeline_notification.go @@ -23,7 +23,7 @@ import ( ) type PipelineNotificationParam struct { - ProjectName string + ProjectName string // can be an empty string, if pipeline is created and triggered by API PipelineID uint64 CreatedAt time.Time UpdatedAt time.Time