Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: ignore error and log warning when pipeline belongs to no issue (#1381)

Yilong Liadf374bbb6d9
diff --git a/server/task.go b/server/task.go
index 93a8bcd555..278a28247e 100644
--- a/server/task.go
+++ b/server/task.go
@@ -404,11 +404,13 @@ func (s *Server) changeTaskStatusWithPatch(ctx context.Context, task *api.Task,
// TODO(tianzhou): Refactor the followup code into chained onTaskStatusChange hook.
issue, err := s.store.GetIssueByPipelineID(ctx, task.PipelineID)
if err != nil {
- // Not all pipelines belong to an issue, so it's OK if ENOTFOUND
return nil, fmt.Errorf("failed to fetch containing issue after changing the task status: %v, err: %w", task.Name, err)
}
+ // Not all pipelines belong to an issue, so it's OK if issue is not found.
if issue == nil {
- return nil, fmt.Errorf("failed to find issue with pipeline ID %d, task: %s", task.PipelineID, task.Name)
+ s.l.Info("Pipeline has no linking issue",
+ zap.Int("pipelineID", task.PipelineID),
+ zap.String("task", task.Name))
}
// Create an activity