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

Function convertToTaskRuns

backend/api/v1/rollout_service_converter.go:26–36  ·  view source on GitHub ↗
(ctx context.Context, s *store.Store, taskRuns []*store.TaskRunMessage)

Source from the content-addressed store, hash-verified

24}
25
26func convertToTaskRuns(ctx context.Context, s *store.Store, taskRuns []*store.TaskRunMessage) ([]*v1pb.TaskRun, error) {
27 var taskRunsV1 []*v1pb.TaskRun
28 for _, taskRun := range taskRuns {
29 taskRunV1, err := convertToTaskRun(ctx, s, taskRun)
30 if err != nil {
31 return nil, errors.Wrapf(err, "failed to convert task run")
32 }
33 taskRunsV1 = append(taskRunsV1, taskRunV1)
34 }
35 return taskRunsV1, nil
36}
37
38func convertToTaskRun(ctx context.Context, s *store.Store, taskRun *store.TaskRunMessage) (*v1pb.TaskRun, error) {
39 stageID := common.FormatStageID(taskRun.Environment)

Callers 1

ListTaskRunsMethod · 0.85

Calls 1

convertToTaskRunFunction · 0.85

Tested by

no test coverage detected