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

[incubator-devlake] branch main updated: test(gitlab): add e2e to tag tasks (#2261)

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 c2a499ed test(gitlab): add e2e to tag tasks (#2261)
c2a499ed is described below

commit c2a499ed1f8c43caf04a00c13ffefdfba38c6413
Author: Warren Chen <yi...@merico.dev>
AuthorDate: Mon Jun 20 22:36:21 2022 +0800

    test(gitlab): add e2e to tag tasks (#2261)
---
 plugins/gitlab/impl/impl.go           | 4 ++--
 plugins/gitlab/models/tag.go          | 3 +--
 plugins/gitlab/tasks/tag_collector.go | 2 +-
 plugins/gitlab/tasks/tag_extractor.go | 5 +++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/plugins/gitlab/impl/impl.go b/plugins/gitlab/impl/impl.go
index 80e35baa..3a015404 100644
--- a/plugins/gitlab/impl/impl.go
+++ b/plugins/gitlab/impl/impl.go
@@ -54,8 +54,8 @@ func (plugin Gitlab) SubTaskMetas() []core.SubTaskMeta {
 		tasks.ExtractProjectMeta,
 		//tasks.CollectApiCommitsMeta,
 		//tasks.ExtractApiCommitsMeta,
-		tasks.CollectTagMeta,
-		tasks.ExtractTagMeta,
+		//tasks.CollectTagMeta,
+		//tasks.ExtractTagMeta,
 		tasks.CollectApiIssuesMeta,
 		tasks.ExtractApiIssuesMeta,
 		tasks.CollectApiMergeRequestsMeta,
diff --git a/plugins/gitlab/models/tag.go b/plugins/gitlab/models/tag.go
index 68f6262b..c8596b75 100644
--- a/plugins/gitlab/models/tag.go
+++ b/plugins/gitlab/models/tag.go
@@ -22,8 +22,7 @@ import (
 )
 
 type GitlabTag struct {
-	ConnectionId uint64 `gorm:"primaryKey"`
-
+	ConnectionId       uint64 `gorm:"primaryKey"`
 	Name               string `gorm:"primaryKey;type:varchar(60)"`
 	Message            string
 	Target             string `gorm:"type:varchar(255)"`
diff --git a/plugins/gitlab/tasks/tag_collector.go b/plugins/gitlab/tasks/tag_collector.go
index 75c4e8c3..6abca8a3 100644
--- a/plugins/gitlab/tasks/tag_collector.go
+++ b/plugins/gitlab/tasks/tag_collector.go
@@ -27,7 +27,7 @@ const RAW_TAG_TABLE = "gitlab_api_tag"
 var CollectTagMeta = core.SubTaskMeta{
 	Name:             "collectApiTag",
 	EntryPoint:       CollectApiTag,
-	EnabledByDefault: true,
+	EnabledByDefault: false,
 	Description:      "Collect tag data from gitlab api",
 }
 
diff --git a/plugins/gitlab/tasks/tag_extractor.go b/plugins/gitlab/tasks/tag_extractor.go
index ad8e22c9..224979de 100644
--- a/plugins/gitlab/tasks/tag_extractor.go
+++ b/plugins/gitlab/tasks/tag_extractor.go
@@ -39,12 +39,12 @@ type GitlabApiTag struct {
 var ExtractTagMeta = core.SubTaskMeta{
 	Name:             "extractApiTag",
 	EntryPoint:       ExtractApiTag,
-	EnabledByDefault: true,
+	EnabledByDefault: false,
 	Description:      "Extract raw tag data into tool layer table GitlabTag",
 }
 
 func ExtractApiTag(taskCtx core.SubTaskContext) error {
-	rawDataSubTaskArgs, _ := CreateRawDataSubTaskArgs(taskCtx, RAW_TAG_TABLE)
+	rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx, RAW_TAG_TABLE)
 
 	extractor, err := helper.NewApiExtractor(helper.ApiExtractorArgs{
 		RawDataSubTaskArgs: *rawDataSubTaskArgs,
@@ -62,6 +62,7 @@ func ExtractApiTag(taskCtx core.SubTaskContext) error {
 			if err != nil {
 				return nil, err
 			}
+			gitlabTag.ConnectionId = data.Options.ConnectionId
 			results = append(results, gitlabTag)
 
 			return results, nil