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

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


The following commit(s) were added to refs/heads/main by this push:
     new e8210965c fix: tasks name fixed (#5384)
e8210965c is described below

commit e8210965c0142df325e1fbed77cdc1bcb089c206
Author: mappjzc <[email protected]>
AuthorDate: Wed Jun 7 11:33:35 2023 +0800

    fix: tasks name fixed (#5384)
    
    Fix the gitextractor tasks names displayed.
    In the status page it to be readable and consistent.
    
    Nddtfjiang <[email protected]>
---
 backend/plugins/bitbucket/api/blueprint_V200_test.go     | 1 +
 backend/plugins/bitbucket/api/blueprint_v200.go          | 1 +
 backend/plugins/gitextractor/tasks/git_repo_collector.go | 4 +++-
 backend/plugins/github/api/blueprint_V200_test.go        | 1 +
 backend/plugins/github/api/blueprint_v200.go             | 1 +
 backend/plugins/gitlab/api/blueprint_V200_test.go        | 1 +
 backend/plugins/gitlab/api/blueprint_v200.go             | 1 +
 config-ui/src/pages/pipeline/components/task/index.tsx   | 2 +-
 8 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/backend/plugins/bitbucket/api/blueprint_V200_test.go 
b/backend/plugins/bitbucket/api/blueprint_V200_test.go
index 06f61c59d..f1473da4d 100644
--- a/backend/plugins/bitbucket/api/blueprint_V200_test.go
+++ b/backend/plugins/bitbucket/api/blueprint_V200_test.go
@@ -88,6 +88,7 @@ func TestMakeDataSourcePipelinePlanV200(t *testing.T) {
                                Options: map[string]interface{}{
                                        "proxy":  "",
                                        "repoId": 
"bitbucket:BitbucketRepo:1:likyh/likyhphp",
+                                       "name":   "likyh/likyhphp",
                                        "url":    
"https://Username:Password@this_is_cloneUrl";,
                                },
                        },
diff --git a/backend/plugins/bitbucket/api/blueprint_v200.go 
b/backend/plugins/bitbucket/api/blueprint_v200.go
index 415c7725e..add31560c 100644
--- a/backend/plugins/bitbucket/api/blueprint_v200.go
+++ b/backend/plugins/bitbucket/api/blueprint_v200.go
@@ -127,6 +127,7 @@ func makeDataSourcePipelinePlanV200(
                                Plugin: "gitextractor",
                                Options: map[string]interface{}{
                                        "url":    cloneUrl.String(),
+                                       "name":   repo.BitbucketId,
                                        "repoId": 
didgen.NewDomainIdGenerator(&models.BitbucketRepo{}).Generate(connection.ID, 
repo.BitbucketId),
                                        "proxy":  connection.Proxy,
                                },
diff --git a/backend/plugins/gitextractor/tasks/git_repo_collector.go 
b/backend/plugins/gitextractor/tasks/git_repo_collector.go
index 4a595c555..45090f760 100644
--- a/backend/plugins/gitextractor/tasks/git_repo_collector.go
+++ b/backend/plugins/gitextractor/tasks/git_repo_collector.go
@@ -18,14 +18,16 @@ limitations under the License.
 package tasks
 
 import (
+       "strings"
+
        "github.com/apache/incubator-devlake/core/errors"
        "github.com/apache/incubator-devlake/core/plugin"
        "github.com/apache/incubator-devlake/plugins/gitextractor/parser"
-       "strings"
 )
 
 type GitExtractorOptions struct {
        RepoId     string `json:"repoId"`
+       Name       string `jsno:"name"`
        Url        string `json:"url"`
        User       string `json:"user"`
        Password   string `json:"password"`
diff --git a/backend/plugins/github/api/blueprint_V200_test.go 
b/backend/plugins/github/api/blueprint_V200_test.go
index 870a90128..4113f0622 100644
--- a/backend/plugins/github/api/blueprint_V200_test.go
+++ b/backend/plugins/github/api/blueprint_V200_test.go
@@ -90,6 +90,7 @@ func TestMakeDataSourcePipelinePlanV200(t *testing.T) {
                                Options: map[string]interface{}{
                                        "proxy":  "",
                                        "repoId": "github:GithubRepo:1:12345",
+                                       "name":   "test/testRepo",
                                        "url":    
"https://git:123@this_is_cloneUrl";,
                                },
                        },
diff --git a/backend/plugins/github/api/blueprint_v200.go 
b/backend/plugins/github/api/blueprint_v200.go
index 7fdc82e35..c788e4b7e 100644
--- a/backend/plugins/github/api/blueprint_v200.go
+++ b/backend/plugins/github/api/blueprint_v200.go
@@ -135,6 +135,7 @@ func makeDataSourcePipelinePlanV200(
                                Plugin: "gitextractor",
                                Options: map[string]interface{}{
                                        "url":    cloneUrl.String(),
+                                       "name":   githubRepo.Name,
                                        "repoId": 
didgen.NewDomainIdGenerator(&models.GithubRepo{}).Generate(connection.ID, 
githubRepo.GithubId),
                                        "proxy":  connection.Proxy,
                                },
diff --git a/backend/plugins/gitlab/api/blueprint_V200_test.go 
b/backend/plugins/gitlab/api/blueprint_V200_test.go
index 0f4cc8bb3..7e3b13d1e 100644
--- a/backend/plugins/gitlab/api/blueprint_V200_test.go
+++ b/backend/plugins/gitlab/api/blueprint_V200_test.go
@@ -143,6 +143,7 @@ func TestMakeDataSourcePipelinePlanV200(t *testing.T) {
                                Options: map[string]interface{}{
                                        "proxy":  "",
                                        "repoId": expectRepoId,
+                                       "name":   testName,
                                        "url":    
"https://git:nddtf@this_is_cloneUrl";,
                                },
                        },
diff --git a/backend/plugins/gitlab/api/blueprint_v200.go 
b/backend/plugins/gitlab/api/blueprint_v200.go
index 1a773030e..c5f96934f 100644
--- a/backend/plugins/gitlab/api/blueprint_v200.go
+++ b/backend/plugins/gitlab/api/blueprint_v200.go
@@ -165,6 +165,7 @@ func makePipelinePlanV200(
                                Plugin: "gitextractor",
                                Options: map[string]interface{}{
                                        "url":    cloneUrl.String(),
+                                       "name":   gitlabProject.Name,
                                        "repoId": 
didgen.NewDomainIdGenerator(&models.GitlabProject{}).Generate(connection.ID, 
gitlabProject.GitlabId),
                                        "proxy":  connection.Proxy,
                                },
diff --git a/config-ui/src/pages/pipeline/components/task/index.tsx 
b/config-ui/src/pages/pipeline/components/task/index.tsx
index 8787348f6..4288b81c3 100644
--- a/config-ui/src/pages/pipeline/components/task/index.tsx
+++ b/config-ui/src/pages/pipeline/components/task/index.tsx
@@ -48,7 +48,7 @@ export const PipelineTask = ({ task }: Props) => {
         name = `${name}:${options.name}`;
         break;
       case ['gitextractor'].includes(config.plugin):
-        name = `${name}:${options.repoId}`;
+        name = `${name}:${options.name}`;
         break;
       case ['dora'].includes(config.plugin):
         name = `${name}:${options.projectName}`;

Reply via email to