Skip to content

Commit c4e8544

Browse files
Merge branch 'main' into fix/github-add-missing-runid
2 parents 0119ad7 + 30960f3 commit c4e8544

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

backend/server/services/pipeline.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,14 @@ func dequeuePipeline(runningParallelLabels []string) (pipeline *models.Pipeline,
292292
if err != nil {
293293
panic(err)
294294
}
295+
296+
// Notify that the pipeline has started
297+
go func(pipelineId uint64) {
298+
if notifyErr := NotifyExternal(pipelineId); notifyErr != nil {
299+
globalPipelineLog.Error(notifyErr, "failed to send pipeline started notification for pipeline #%d", pipelineId)
300+
}
301+
}(pipeline.ID)
302+
295303
return
296304
}
297305
if tx.IsErrorNotFound(err) {
@@ -363,6 +371,7 @@ func getProjectName(pipeline *models.Pipeline) (string, errors.Error) {
363371
}
364372
blueprintId := pipeline.BlueprintId
365373
if blueprintId == 0 {
374+
// skip get project name if pipeline is not bound to a blueprint
366375
return "", nil
367376
}
368377
dbBlueprint := &models.Blueprint{}

backend/server/services/pipeline_helper.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ func CreateDbPipeline(newPipeline *models.NewPipeline) (pipeline *models.Pipelin
110110
// update tasks state
111111
errors.Must(tx.Update(dbPipeline))
112112
dbPipeline.Labels = newPipeline.Labels
113+
114+
// Notify that the pipeline has been created
115+
go func(pipelineId uint64) {
116+
if notifyErr := NotifyExternal(pipelineId); notifyErr != nil {
117+
globalPipelineLog.Error(notifyErr, "failed to send pipeline created notification for pipeline #%d", pipelineId)
118+
}
119+
}(dbPipeline.ID)
120+
113121
return dbPipeline, nil
114122
}
115123

0 commit comments

Comments
 (0)