You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/09/19 11:44:48 UTC

[GitHub] [incubator-devlake] warren830 opened a new pull request, #3128: feat(github): add dora enrich

warren830 opened a new pull request, #3128:
URL: https://github.com/apache/incubator-devlake/pull/3128

   # Summary
   
   if request of blueprints for github contains `dora` in `transformation`, we add dora support for it 
   
   ### Does this close any open issues?
   relate to #3127
   
   
   ### Screenshots
   Include any relevant screenshots here.
   
   ### Other Information
   Any other information that is important to this PR.
   


-- 
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


[GitHub] [incubator-devlake] klesh commented on a diff in pull request #3128: feat(github): add dora enrich

Posted by GitBox <gi...@apache.org>.
klesh commented on code in PR #3128:
URL: https://github.com/apache/incubator-devlake/pull/3128#discussion_r974416905


##########
plugins/github/api/blueprint.go:
##########
@@ -141,11 +109,85 @@ func MakePipelinePlan(subtaskMetas []core.SubTaskMeta, connectionId uint64, scop
 				Options: map[string]interface{}{
 					"url":    cloneUrl.String(),
 					"repoId": didgen.NewDomainIdGenerator(&models.GithubRepo{}).Generate(connectionId, apiRepo.GithubId),
-					"proxy":  connection.Proxy,
+					"proxy":  proxy,
 				},
 			})
 		}
 		plan[i] = stage
+		// dora
+		if doraRules, ok := transformationRules["dora"]; ok && doraRules != nil {
+			j := i + 1
+			// add a new task to next stage
+			if plan[j] != nil {
+				j++
+			}
+			if j == len(plan) {
+				plan = append(plan, nil)
+			}
+			if err != nil {
+				return nil, err
+			}
+			if apiRepo.GithubId == 0 {
+				apiRepo, _, _, err = getApiRepo(connectionId, op)
+				if err != nil {
+					return nil, err
+				}
+			}
+			doraOption := make(map[string]interface{})
+			doraOption["repoId"] = didgen.NewDomainIdGenerator(&models.GithubRepo{}).Generate(connectionId, apiRepo.GithubId)
+			doraOption["tasks"] = []string{"EnrichTaskEnv"}
+			doraOption["transformation"] = doraRules
+			plan[j] = core.PipelineStage{
+				{
+					Plugin:  "dora",
+					Options: doraOption,
+				},
+			}
+			// remove it from github transformationRules
+			delete(transformationRules, "dora")

Review Comment:
   Why do we need to delete it?



-- 
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


[GitHub] [incubator-devlake] mappjzc commented on pull request #3128: feat(github): add dora enrich

Posted by GitBox <gi...@apache.org>.
mappjzc commented on PR #3128:
URL: https://github.com/apache/incubator-devlake/pull/3128#issuecomment-1252053302

   @warren830 because I see it is over and is out-of-date with the base branch,so I try to update it and merged it.


-- 
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


[GitHub] [incubator-devlake] warren830 commented on a diff in pull request #3128: feat(github): add dora enrich

Posted by GitBox <gi...@apache.org>.
warren830 commented on code in PR #3128:
URL: https://github.com/apache/incubator-devlake/pull/3128#discussion_r974862631


##########
plugins/github/api/blueprint.go:
##########
@@ -141,11 +109,85 @@ func MakePipelinePlan(subtaskMetas []core.SubTaskMeta, connectionId uint64, scop
 				Options: map[string]interface{}{
 					"url":    cloneUrl.String(),
 					"repoId": didgen.NewDomainIdGenerator(&models.GithubRepo{}).Generate(connectionId, apiRepo.GithubId),
-					"proxy":  connection.Proxy,
+					"proxy":  proxy,
 				},
 			})
 		}
 		plan[i] = stage
+		// dora
+		if doraRules, ok := transformationRules["dora"]; ok && doraRules != nil {
+			j := i + 1
+			// add a new task to next stage
+			if plan[j] != nil {
+				j++
+			}
+			if j == len(plan) {
+				plan = append(plan, nil)
+			}
+			if err != nil {
+				return nil, err
+			}
+			if apiRepo.GithubId == 0 {
+				apiRepo, _, _, err = getApiRepo(connectionId, op)
+				if err != nil {
+					return nil, err
+				}
+			}
+			doraOption := make(map[string]interface{})
+			doraOption["repoId"] = didgen.NewDomainIdGenerator(&models.GithubRepo{}).Generate(connectionId, apiRepo.GithubId)
+			doraOption["tasks"] = []string{"EnrichTaskEnv"}
+			doraOption["transformation"] = doraRules
+			plan[j] = core.PipelineStage{
+				{
+					Plugin:  "dora",
+					Options: doraOption,
+				},
+			}
+			// remove it from github transformationRules
+			delete(transformationRules, "dora")

Review Comment:
   Because we need to remove it from github bp



-- 
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


[GitHub] [incubator-devlake] warren830 commented on pull request #3128: feat(github): add dora enrich

Posted by GitBox <gi...@apache.org>.
warren830 commented on PR #3128:
URL: https://github.com/apache/incubator-devlake/pull/3128#issuecomment-1252022093

   > unit test fail
   
   yes, I am working on it


-- 
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


[GitHub] [incubator-devlake] warren830 commented on pull request #3128: feat(github): add dora enrich

Posted by GitBox <gi...@apache.org>.
warren830 commented on PR #3128:
URL: https://github.com/apache/incubator-devlake/pull/3128#issuecomment-1252047043

   @mappjzc why did you update the branch, I just updated, and I was waiting for the checks... Now I need to wait again...


-- 
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


[GitHub] [incubator-devlake] mappjzc commented on pull request #3128: feat(github): add dora enrich

Posted by GitBox <gi...@apache.org>.
mappjzc commented on PR #3128:
URL: https://github.com/apache/incubator-devlake/pull/3128#issuecomment-1252030345

   In the file BpHelper.go (created by make mock)
   ![image](https://user-images.githubusercontent.com/2921251/191210797-f2ff551d-b3fb-451f-b37f-b3c080d65414.png)
   
   it import github task.
   
   and as we know the github task import helper
   
   and as we know the helper import the mock...
   
   so circle import.


-- 
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


[GitHub] [incubator-devlake] warren830 commented on pull request #3128: feat(github): add dora enrich

Posted by GitBox <gi...@apache.org>.
warren830 commented on PR #3128:
URL: https://github.com/apache/incubator-devlake/pull/3128#issuecomment-1252045758

   > In the file BpHelper.go (created by make mock) ![image](https://user-images.githubusercontent.com/2921251/191210797-f2ff551d-b3fb-451f-b37f-b3c080d65414.png)
   > 
   > it import github task.
   > 
   > and as we know the github task import helper
   > 
   > and as we know the helper import the mock...
   > 
   > so circle import.
   
   Yes, that's what I fixed in the recent push 


-- 
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


[GitHub] [incubator-devlake] warren830 commented on pull request #3128: feat(github): add dora enrich

Posted by GitBox <gi...@apache.org>.
warren830 commented on PR #3128:
URL: https://github.com/apache/incubator-devlake/pull/3128#issuecomment-1252053756

   > 
   
   Get, thanks!


-- 
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


[GitHub] [incubator-devlake] mappjzc merged pull request #3128: feat(github): add dora enrich

Posted by GitBox <gi...@apache.org>.
mappjzc merged PR #3128:
URL: https://github.com/apache/incubator-devlake/pull/3128


-- 
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