This is an automated email from the ASF dual-hosted git repository.

warren pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit 6a5a7d900b74f5d596cfcaed9c7e89d66638fd70
Author: abeizn <[email protected]>
AuthorDate: Fri May 27 19:25:28 2022 +0800

    fix: calculatePrCherryPick has an error in SQL syntax
---
 plugins/refdiff/tasks/refs_pr_cherry_pick_calculator.go | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/refdiff/tasks/refs_pr_cherry_pick_calculator.go 
b/plugins/refdiff/tasks/refs_pr_cherry_pick_calculator.go
index e9fc4d45..ed257b9c 100644
--- a/plugins/refdiff/tasks/refs_pr_cherry_pick_calculator.go
+++ b/plugins/refdiff/tasks/refs_pr_cherry_pick_calculator.go
@@ -81,7 +81,7 @@ func CalculatePrCherryPick(taskCtx core.SubTaskContext) error 
{
                parentPrKey := ""
                if prTitleRegex != nil {
                        groups := prTitleRegex.FindStringSubmatch(pr.Title)
-                       if len(groups) > 0 {
+                       if len(groups) > 1 {
                                parentPrKey = groups[1]
                        }
                }
@@ -111,12 +111,12 @@ func CalculatePrCherryPick(taskCtx core.SubTaskContext) 
error {
 
        cursor2, err := db.Raw(
                `
-                       SELECT pr2.KEY                              AS 
parent_pr_key,
+                       SELECT pr2.pull_request_key                 AS 
parent_pr_key,
                               pr1.parent_pr_id                     AS 
parent_pr_id,
                               pr1.base_ref                         AS 
cherrypick_base_branch,
-                              pr1.KEY                              AS 
cherrypick_pr_key,
+                              pr1.pull_request_key                 AS 
cherrypick_pr_key,
                               repos.NAME                           AS 
repo_name,
-                              Concat(repos.url, '/pull/', pr2.KEY) AS 
parent_pr_url,
+                              Concat(repos.url, '/pull/', 
pr2.pull_request_key) AS parent_pr_url,
                                   pr2.created_date
                        FROM   pull_requests pr1
                               LEFT JOIN pull_requests pr2

Reply via email to