MCPcopy Index your code
hub / github.com/bytebase/bytebase / ListTasks

Method ListTasks

backend/store/task.go:391–407  ·  view source on GitHub ↗

ListTasks retrieves a list of tasks based on find.

(ctx context.Context, find *TaskFind)

Source from the content-addressed store, hash-verified

389
390// ListTasks retrieves a list of tasks based on find.
391func (s *Store) ListTasks(ctx context.Context, find *TaskFind) ([]*TaskMessage, error) {
392 tx, err := s.GetDB().BeginTx(ctx, &sql.TxOptions{ReadOnly: true})
393 if err != nil {
394 return nil, err
395 }
396 defer tx.Rollback()
397
398 tasks, err := s.listTasksImpl(ctx, tx, find)
399 if err != nil {
400 return nil, errors.Wrapf(err, "failed to list tasks")
401 }
402
403 if err := tx.Commit(); err != nil {
404 return nil, err
405 }
406 return tasks, nil
407}
408
409// ListTaskStatusCountByPlanIDs returns aggregated task counts by project, plan, environment and API-visible status.
410func (s *Store) ListTaskStatusCountByPlanIDs(ctx context.Context, projectIDs []string, planIDs []int64) ([]*TaskStatusCount, error) {

Callers 11

GetTaskByIDMethod · 0.95
checkPlanCompletionMethod · 0.80
newSchedulingContextFunction · 0.80
GetRolloutMethod · 0.80
ListRolloutsMethod · 0.80
CreateRolloutMethod · 0.80
GetTaskRunSessionMethod · 0.80
BatchRunTasksMethod · 0.80
BatchSkipTasksMethod · 0.80
doExportFromIssueMethod · 0.80

Calls 2

GetDBMethod · 0.95
listTasksImplMethod · 0.95

Tested by

no test coverage detected