You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by wa...@apache.org on 2022/09/06 09:47:25 UTC

[incubator-devlake] 02/03: feat: github add cicd_pipeline_repos

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 f517c9b6ee7dd0d5aa7c8e33d1f0a1a10f204d30
Author: abeizn <zi...@merico.dev>
AuthorDate: Tue Sep 6 16:28:39 2022 +0800

    feat: github add cicd_pipeline_repos
---
 plugins/github/tasks/cicd_pipeline_convertor.go | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/github/tasks/cicd_pipeline_convertor.go b/plugins/github/tasks/cicd_pipeline_convertor.go
index f8665dd5..65dca697 100644
--- a/plugins/github/tasks/cicd_pipeline_convertor.go
+++ b/plugins/github/tasks/cicd_pipeline_convertor.go
@@ -18,9 +18,7 @@ limitations under the License.
 package tasks
 
 import (
-	"fmt"
 	"reflect"
-	"strconv"
 
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 
@@ -73,7 +71,8 @@ func ConvertPipelines(taskCtx core.SubTaskContext) error {
 			line := inputRow.(*githubModels.GithubPipeline)
 			domainPipeline := &devops.CICDPipeline{
 				DomainEntity: domainlayer.DomainEntity{Id: pipelineIdGen.Generate(data.Options.ConnectionId, repoId, line.Branch, line.Commit)},
-				Name:         fmt.Sprintf("%d", line.RepoId),
+				Name: didgen.NewDomainIdGenerator(&githubModels.GithubRepo{}).
+					Generate(line.ConnectionId, line.RepoId),
 				Type:         line.Type,
 				DurationSec:  uint64(line.Duration),
 				CreatedDate:  *line.StartedDate,
@@ -97,7 +96,8 @@ func ConvertPipelines(taskCtx core.SubTaskContext) error {
 				DomainEntity: domainlayer.DomainEntity{Id: pipelineIdGen.Generate(data.Options.ConnectionId, repoId, line.Branch, line.Commit)},
 				CommitSha:    line.Commit,
 				Branch:       line.Branch,
-				Repo:         strconv.Itoa(repoId),
+				Repo: didgen.NewDomainIdGenerator(&githubModels.GithubRepo{}).
+					Generate(line.ConnectionId, line.RepoId),
 			}
 
 			return []interface{}{