You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "mappjzc (via GitHub)" <gi...@apache.org> on 2023/03/31 04:13:37 UTC

[GitHub] [incubator-devlake] mappjzc commented on a diff in pull request #4824: feat: convert issue_repo_commit for tapd

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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org