MCPcopy Create free account
hub / github.com/bytebase/bytebase / GetTaskRunV1

Method GetTaskRunV1

backend/store/task_run.go:193–205  ·  view source on GitHub ↗

GetTaskRunV1 gets a task run.

(ctx context.Context, find *FindTaskRunMessage)

Source from the content-addressed store, hash-verified

191
192// GetTaskRunV1 gets a task run.
193func (s *Store) GetTaskRunV1(ctx context.Context, find *FindTaskRunMessage) (*TaskRunMessage, error) {
194 taskRuns, err := s.ListTaskRuns(ctx, find)
195 if err != nil {
196 return nil, err
197 }
198 if len(taskRuns) == 0 {
199 return nil, nil
200 }
201 if len(taskRuns) > 1 {
202 return nil, errors.Errorf("expected to get one task run, but got %d", len(taskRuns))
203 }
204 return taskRuns[0], nil
205}
206
207// UpdateTaskRunStatus updates task run status.
208func (s *Store) UpdateTaskRunStatus(ctx context.Context, patch *TaskRunStatusPatch) (*TaskRunMessage, error) {

Callers 4

runStandardMigrationMethod · 0.80
GetTaskRunMethod · 0.80
GetTaskRunLogMethod · 0.80
createRevisionsMethod · 0.80

Calls 2

ListTaskRunsMethod · 0.95
ErrorfMethod · 0.80

Tested by

no test coverage detected