MCPcopy
hub / github.com/apache/devlake / ExtractStoryBugs

Function ExtractStoryBugs

backend/plugins/tapd/tasks/story_bug_extractor.go:38–66  ·  view source on GitHub ↗
(taskCtx plugin.SubTaskContext)

Source from the content-addressed store, hash-verified

36}
37
38func ExtractStoryBugs(taskCtx plugin.SubTaskContext) errors.Error {
39 rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx, RAW_STORY_BUG_TABLE)
40 extractor, err := api.NewApiExtractor(api.ApiExtractorArgs{
41 RawDataSubTaskArgs: *rawDataSubTaskArgs,
42 Extract: func(row *api.RawData) ([]interface{}, errors.Error) {
43 toolL := models.TapdStoryBug{}
44 err := errors.Convert(json.Unmarshal(row.Data, &toolL))
45 if err != nil {
46 return nil, err
47 }
48 issue := models.Input{}
49 err = errors.Convert(json.Unmarshal(row.Input, &issue))
50 if err != nil {
51 return nil, err
52 }
53 toolL.IssueUpdated = issue.UpdateTime
54 toolL.ConnectionId = data.Options.ConnectionId
55 return []interface{}{
56 &toolL,
57 }, nil
58 },
59 })
60
61 if err != nil {
62 return err
63 }
64
65 return extractor.Execute()
66}

Callers

nothing calls this directly

Calls 3

ExecuteMethod · 0.95
CreateRawDataSubTaskArgsFunction · 0.70
ConvertMethod · 0.45

Tested by

no test coverage detected