mappjzc commented on code in PR #4824:
URL: 
https://github.com/apache/incubator-devlake/pull/4824#discussion_r1153991978


##########
backend/plugins/tapd/tasks/story_commit_converter.go:
##########
@@ -47,14 +49,33 @@ func ConvertStoryCommit(taskCtx plugin.SubTaskContext) 
errors.Error {
                Input:              cursor,
                Convert: func(inputRow interface{}) ([]interface{}, 
errors.Error) {
                        toolL := inputRow.(*models.TapdStoryCommit)
-                       domainL := &crossdomain.IssueCommit{
+                       results := make([]interface{}, 0, 2)
+                       issueCommit := &crossdomain.IssueCommit{
                                IssueId:   
issueIdGen.Generate(data.Options.ConnectionId, toolL.StoryId),
                                CommitSha: toolL.CommitId,
                        }
+                       results = append(results, issueCommit)
+                       if toolL.WebURL != `` {

Review Comment:
   here can combine a share function.



##########
backend/plugins/tapd/tasks/bug_commit_converter.go:
##########
@@ -49,14 +51,33 @@ func ConvertBugCommit(taskCtx plugin.SubTaskContext) 
errors.Error {
                Input:              cursor,
                Convert: func(inputRow interface{}) ([]interface{}, 
errors.Error) {
                        toolL := inputRow.(*models.TapdBugCommit)
-                       domainL := &crossdomain.IssueCommit{
+                       results := make([]interface{}, 0, 2)
+                       issueCommit := &crossdomain.IssueCommit{
                                IssueId:   
issueIdGen.Generate(data.Options.ConnectionId, toolL.BugId),
                                CommitSha: toolL.CommitId,
                        }
+                       results = append(results, issueCommit)
+                       if toolL.WebURL != `` {

Review Comment:
   here can combine a share function.



##########
backend/plugins/tapd/tasks/task_commit_converter.go:
##########
@@ -50,14 +52,33 @@ func ConvertTaskCommit(taskCtx plugin.SubTaskContext) 
errors.Error {
                Input:              cursor,
                Convert: func(inputRow interface{}) ([]interface{}, 
errors.Error) {
                        toolL := inputRow.(*models.TapdTaskCommit)
-                       domainL := &crossdomain.IssueCommit{
+                       results := make([]interface{}, 0, 2)
+                       issueCommit := &crossdomain.IssueCommit{
                                IssueId:   
issueIdGen.Generate(data.Options.ConnectionId, toolL.TaskId),
                                CommitSha: toolL.CommitId,
                        }
+                       results = append(results, issueCommit)
+                       if toolL.WebURL != `` {

Review Comment:
   here can combine a share function.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to