warren830 commented on code in PR #3760:
URL:
https://github.com/apache/incubator-devlake/pull/3760#discussion_r1027274290
##########
plugins/jenkins/tasks/build_stages_enricher.go:
##########
@@ -40,15 +36,14 @@ func EnrichApiBuildWithStages(taskCtx core.SubTaskContext)
errors.Error {
data := taskCtx.GetData().(*JenkinsTaskData)
db := taskCtx.GetDal()
clauses := []dal.Clause{
- dal.Select("distinct build_name"),
- dal.From(&models.JenkinsStage{}),
- dal.Join(`left join _tool_jenkins_builds tjb
- on
_tool_jenkins_stages.build_name = tjb.full_display_name
- and
_tool_jenkins_stages.connection_id = tjb.connection_id`),
- dal.Where(`_tool_jenkins_stages.connection_id = ?
- and tjb.job_path = ?
and tjb.job_name = ?`,
+ dal.Select("tjb.*"),
+ dal.From(`_tool_jenkins_builds tjb`),
+ dal.Join(`left join _tool_jenkins_stages tjs
+ on tjs.build_name =
tjb.full_display_name
+ and tjs.connection_id =
tjb.connection_id`),
+ dal.Where(`tjb.connection_id = ?
+ and tjb.job_path = ?
and tjb.job_name = ? and tjs.id is not null `,
Review Comment:
Nice
--
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]