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

abeizn pushed a commit to branch fix-zentao-repo-url-bug
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/fix-zentao-repo-url-bug by 
this push:
     new 001f19d0d fix: zentao repo url parse error
001f19d0d is described below

commit 001f19d0d5645beaf6cd40750fe288b9799defe2
Author: abeizn <[email protected]>
AuthorDate: Thu Nov 9 17:04:49 2023 +0800

    fix: zentao repo url parse error
---
 backend/plugins/zentao/tasks/bug_commits_extractor.go   | 3 ++-
 backend/plugins/zentao/tasks/story_commits_extractor.go | 3 ++-
 backend/plugins/zentao/tasks/task_commits_extractor.go  | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/backend/plugins/zentao/tasks/bug_commits_extractor.go 
b/backend/plugins/zentao/tasks/bug_commits_extractor.go
index 498e9bb89..6a634557a 100644
--- a/backend/plugins/zentao/tasks/bug_commits_extractor.go
+++ b/backend/plugins/zentao/tasks/bug_commits_extractor.go
@@ -20,6 +20,7 @@ package tasks
 import (
        "encoding/json"
        "net/url"
+       "path"
        "regexp"
 
        "github.com/apache/incubator-devlake/core/errors"
@@ -93,7 +94,7 @@ func ExtractBugCommits(taskCtx plugin.SubTaskContext) 
errors.Error {
                                return nil, errors.Default.WrapRaw(err)
                        }
                        bugCommits.Host = u.Host
-                       bugCommits.RepoRevision = u.Path
+                       bugCommits.RepoRevision = "/" + path.Base(u.Path)
 
                        results := make([]interface{}, 0)
                        results = append(results, bugCommits)
diff --git a/backend/plugins/zentao/tasks/story_commits_extractor.go 
b/backend/plugins/zentao/tasks/story_commits_extractor.go
index 97243db25..4a5d133da 100644
--- a/backend/plugins/zentao/tasks/story_commits_extractor.go
+++ b/backend/plugins/zentao/tasks/story_commits_extractor.go
@@ -20,6 +20,7 @@ package tasks
 import (
        "encoding/json"
        "net/url"
+       "path"
        "regexp"
 
        "github.com/apache/incubator-devlake/core/errors"
@@ -89,7 +90,7 @@ func ExtractStoryCommits(taskCtx plugin.SubTaskContext) 
errors.Error {
                        }
 
                        storyCommits.Host = u.Host
-                       storyCommits.RepoRevision = u.Path
+                       storyCommits.RepoRevision = "/" + path.Base(u.Path)
 
                        results := make([]interface{}, 0)
                        results = append(results, storyCommits)
diff --git a/backend/plugins/zentao/tasks/task_commits_extractor.go 
b/backend/plugins/zentao/tasks/task_commits_extractor.go
index 533df08e7..5f52c3ebc 100644
--- a/backend/plugins/zentao/tasks/task_commits_extractor.go
+++ b/backend/plugins/zentao/tasks/task_commits_extractor.go
@@ -20,6 +20,7 @@ package tasks
 import (
        "encoding/json"
        "net/url"
+       "path"
        "regexp"
 
        "github.com/apache/incubator-devlake/core/errors"
@@ -89,7 +90,7 @@ func ExtractTaskCommits(taskCtx plugin.SubTaskContext) 
errors.Error {
                        }
 
                        taskCommits.Host = u.Host
-                       taskCommits.RepoRevision = u.Path
+                       taskCommits.RepoRevision = "/" + path.Base(u.Path)
 
                        results := make([]interface{}, 0)
                        results = append(results, taskCommits)

Reply via email to