Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix: list auto rollout tasks with an open or no issue (#8653)
p0ny9fdf735ac1e2
diff --git a/backend/store/task.go b/backend/store/task.goindex ff6743799a..f5ec53f1d8 100644--- a/backend/store/task.go+++ b/backend/store/task.go@@ -395,17 +395,23 @@ func (s *Store) BatchSkipTasks(ctx context.Context, taskUIDs []int, comment strireturn nil}-// ListNotSkippedTasksWithNoTaskRun returns tasks that have no task run.+// ListNotSkippedTasksWithNoTaskRun returns tasks that+// 1. have no task runs+// 2. are not skipped+// 3. are associated with an open issue or no issue.func (s *Store) ListNotSkippedTasksWithNoTaskRun(ctx context.Context) ([]int, error) {rows, err := s.db.db.QueryContext(ctx, `SELECTtask.idFROM task+ LEFT JOIN pipeline ON pipeline.id = task.pipeline_id+ LEFT JOIN issue ON issue.pipeline_id = pipeline.idLEFT JOIN LATERAL(SELECT 1 AS e FROM task_run WHERE task_run.task_id = task.id LIMIT 1) task_runON TRUEWHERE task_run.e IS NULLAND COALESCE((task.payload->>'skipped')::BOOLEAN, FALSE) IS FALSE+ AND COALESCE(issue.status, 'OPEN') = 'OPEN'ORDER BY task.id`)if err != nil {return nil, err