This is an automated email from the ASF dual-hosted git repository.
lynwee pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new 2aff306af fix(framework): return empty project name when blueprint id
is zero (#8432)
2aff306af is described below
commit 2aff306af0de85e432b2a2948221e23a10e06434
Author: Lynwee <[email protected]>
AuthorDate: Thu May 8 19:39:14 2025 +0800
fix(framework): return empty project name when blueprint id is zero (#8432)
---
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