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/06/20 07:49:42 UTC

[incubator-devlake] branch main updated: refactor(gitlab): add conn id to pipeline

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


The following commit(s) were added to refs/heads/main by this push:
     new 12318357 refactor(gitlab): add conn id to pipeline
12318357 is described below

commit 12318357a9759f6264d1e507f03e206492da91ea
Author: Yingchu Chen <yi...@merico.dev>
AuthorDate: Sun Jun 19 20:13:36 2022 +0800

    refactor(gitlab): add conn id to pipeline
---
 plugins/gitlab/e2e/issues_test.go                  |  1 -
 plugins/gitlab/e2e/pipelines_test.go               | 69 ++++++++++++++++++++++
 .../e2e/raw_tables/_raw_gitlab_api_pipeline.csv    | 21 +++++++
 .../e2e/snapshot_tables/_tool_gitlab_pipelines.csv | 21 +++++++
 plugins/gitlab/tasks/pipeline_extractor.go         |  2 +-
 5 files changed, 112 insertions(+), 2 deletions(-)

diff --git a/plugins/gitlab/e2e/issues_test.go b/plugins/gitlab/e2e/issues_test.go
index b1dd24e9..3a1ebe8f 100644
--- a/plugins/gitlab/e2e/issues_test.go
+++ b/plugins/gitlab/e2e/issues_test.go
@@ -46,7 +46,6 @@ func TestGitlabIssueDataFlow(t *testing.T) {
 	// verify extraction
 	dataflowTester.FlushTabler(&models.GitlabIssue{})
 	dataflowTester.FlushTabler(&models.GitlabIssueLabel{})
-	dataflowTester.FlushTabler(&models.GitlabUser{})
 	dataflowTester.Subtask(tasks.ExtractApiIssuesMeta, taskData)
 	dataflowTester.VerifyTable(
 		models.GitlabIssue{},
diff --git a/plugins/gitlab/e2e/pipelines_test.go b/plugins/gitlab/e2e/pipelines_test.go
new file mode 100644
index 00000000..54495bd6
--- /dev/null
+++ b/plugins/gitlab/e2e/pipelines_test.go
@@ -0,0 +1,69 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package e2e
+
+import (
+	"fmt"
+	"testing"
+
+	"github.com/apache/incubator-devlake/helpers/e2ehelper"
+	"github.com/apache/incubator-devlake/plugins/gitlab/impl"
+	"github.com/apache/incubator-devlake/plugins/gitlab/models"
+	"github.com/apache/incubator-devlake/plugins/gitlab/tasks"
+)
+
+func TestGitlabPipelineDataFlow(t *testing.T) {
+
+	var gitlab impl.Gitlab
+	dataflowTester := e2ehelper.NewDataFlowTester(t, "gitlab", gitlab)
+
+	taskData := &tasks.GitlabTaskData{
+		Options: &tasks.GitlabOptions{
+			ConnectionId: 1,
+			ProjectId:    20171709,
+		},
+	}
+	// import raw data table
+	dataflowTester.ImportCsvIntoRawTable("./raw_tables/_raw_gitlab_api_pipeline.csv",
+		"_raw_gitlab_api_pipeline")
+
+	// verify extraction
+	dataflowTester.FlushTabler(&models.GitlabPipeline{})
+	dataflowTester.Subtask(tasks.ExtractApiPipelinesMeta, taskData)
+	dataflowTester.VerifyTable(
+		models.GitlabPipeline{},
+		fmt.Sprintf("./snapshot_tables/%s.csv", models.GitlabPipeline{}.TableName()),
+		[]string{"connection_id", "gitlab_id"},
+		[]string{
+			"project_id",
+			"gitlab_created_at",
+			"status",
+			"ref",
+			"sha",
+			"web_url",
+			"duration",
+			"started_at",
+			"finished_at",
+			"coverage",
+			"_raw_data_params",
+			"_raw_data_table",
+			"_raw_data_id",
+			"_raw_data_remark",
+		},
+	)
+}
diff --git a/plugins/gitlab/e2e/raw_tables/_raw_gitlab_api_pipeline.csv b/plugins/gitlab/e2e/raw_tables/_raw_gitlab_api_pipeline.csv
new file mode 100644
index 00000000..98b99379
--- /dev/null
+++ b/plugins/gitlab/e2e/raw_tables/_raw_gitlab_api_pipeline.csv
@@ -0,0 +1,21 @@
+id,params,data,url,input,created_at
+152,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":457474837,""iid"":1,""project_id"":20171709,""sha"":""b1b82852d48b516a18e56c5bab0ebf54b8f4ccfd"",""ref"":""renovate/pin-dependencies"",""status"":""failed"",""source"":""external"",""created_at"":""2022-01-27T10:07:09.429Z"",""updated_at"":""2022-01-27T10:07:09.553Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/457474837""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page=100&sort=asc&w [...]
+153,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":457474996,""iid"":2,""project_id"":20171709,""sha"":""739ab912e6e1ed27cecd8a2d00bfd6fa52afd90a"",""ref"":""renovate/jest-monorepo"",""status"":""failed"",""source"":""external"",""created_at"":""2022-01-27T10:07:18.884Z"",""updated_at"":""2022-01-27T10:07:19.043Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/457474996""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page=100&sort=asc&with [...]
+154,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":457475160,""iid"":3,""project_id"":20171709,""sha"":""44d127e0ab7dbc4bc259b55929c9d00b62fc3bf4"",""ref"":""renovate/lodash-monorepo"",""status"":""failed"",""source"":""external"",""created_at"":""2022-01-27T10:07:26.435Z"",""updated_at"":""2022-01-27T10:07:26.638Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/457475160""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page=100&sort=asc&wi [...]
+155,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":457475337,""iid"":4,""project_id"":20171709,""sha"":""10a6464b6bd2cf4b59b8ac37ce1466e013f5a20d"",""ref"":""renovate/shx-0.x"",""status"":""failed"",""source"":""external"",""created_at"":""2022-01-27T10:07:36.502Z"",""updated_at"":""2022-01-27T10:07:37.545Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/457475337""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page=100&sort=asc&with_stats [...]
+156,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":485811050,""iid"":5,""project_id"":20171709,""sha"":""c791ea6949d6b4aadf79b15ba666cb690c6527ac"",""ref"":""EE-7121"",""status"":""failed"",""source"":""push"",""created_at"":""2022-03-07T06:26:42.109Z"",""updated_at"":""2022-03-07T06:26:42.109Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/485811050""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page=100&sort=asc&with_stats=true,null,20 [...]
+157,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":485811059,""iid"":6,""project_id"":20171709,""sha"":""c791ea6949d6b4aadf79b15ba666cb690c6527ac"",""ref"":""refs/merge-requests/74/head"",""status"":""failed"",""source"":""merge_request_event"",""created_at"":""2022-03-07T06:26:43.784Z"",""updated_at"":""2022-03-07T06:26:43.784Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/485811059""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page=1 [...]
+158,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":485813816,""iid"":7,""project_id"":20171709,""sha"":""ecc7c0b2874c812ed882c9effbbda26e0abc7110"",""ref"":""EE-7121"",""status"":""failed"",""source"":""push"",""created_at"":""2022-03-07T06:33:56.824Z"",""updated_at"":""2022-03-07T06:33:56.824Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/485813816""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page=100&sort=asc&with_stats=true,null,20 [...]
+159,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":485813830,""iid"":8,""project_id"":20171709,""sha"":""ecc7c0b2874c812ed882c9effbbda26e0abc7110"",""ref"":""refs/merge-requests/74/head"",""status"":""failed"",""source"":""merge_request_event"",""created_at"":""2022-03-07T06:33:58.889Z"",""updated_at"":""2022-03-07T06:33:58.889Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/485813830""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page=1 [...]
+160,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":485814501,""iid"":9,""project_id"":20171709,""sha"":""6a3346f8434cc65fbe3f7a80a0edec5b4014a733"",""ref"":""EE-7121"",""status"":""failed"",""source"":""push"",""created_at"":""2022-03-07T06:35:28.111Z"",""updated_at"":""2022-03-07T06:35:28.111Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/485814501""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page=100&sort=asc&with_stats=true,null,20 [...]
+161,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":485814516,""iid"":10,""project_id"":20171709,""sha"":""6a3346f8434cc65fbe3f7a80a0edec5b4014a733"",""ref"":""refs/merge-requests/74/head"",""status"":""failed"",""source"":""merge_request_event"",""created_at"":""2022-03-07T06:35:31.255Z"",""updated_at"":""2022-03-07T06:35:31.255Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/485814516""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page= [...]
+162,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":485814871,""iid"":11,""project_id"":20171709,""sha"":""f731732471961fed061a01fa99631f69e861c4a2"",""ref"":""refs/merge-requests/74/head"",""status"":""failed"",""source"":""merge_request_event"",""created_at"":""2022-03-07T06:36:50.020Z"",""updated_at"":""2022-03-07T06:37:32.103Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/485814871""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page= [...]
+163,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":485817670,""iid"":12,""project_id"":20171709,""sha"":""5b95c5aebce1eae6a1b95ecf6fbc870851455375"",""ref"":""refs/merge-requests/74/head"",""status"":""failed"",""source"":""merge_request_event"",""created_at"":""2022-03-07T06:45:09.471Z"",""updated_at"":""2022-03-07T07:17:46.305Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/485817670""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page= [...]
+164,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":485837602,""iid"":13,""project_id"":20171709,""sha"":""a79e2aaeee9916338a11b665cb4201f24627f3f1"",""ref"":""refs/merge-requests/74/head"",""status"":""failed"",""source"":""merge_request_event"",""created_at"":""2022-03-07T07:20:45.859Z"",""updated_at"":""2022-03-07T07:28:00.277Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/485837602""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page= [...]
+165,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":485842553,""iid"":14,""project_id"":20171709,""sha"":""9e0934cedcd83abab8d34c5bb0f597c7837a55f0"",""ref"":""refs/merge-requests/74/head"",""status"":""failed"",""source"":""merge_request_event"",""created_at"":""2022-03-07T07:30:47.018Z"",""updated_at"":""2022-03-07T07:35:34.998Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/485842553""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page= [...]
+166,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":485845850,""iid"":15,""project_id"":20171709,""sha"":""b3b581940f6d4d3226db31e48eab2b3b73f4c6db"",""ref"":""refs/merge-requests/74/head"",""status"":""failed"",""source"":""merge_request_event"",""created_at"":""2022-03-07T07:38:58.611Z"",""updated_at"":""2022-03-07T07:45:58.412Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/485845850""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page= [...]
+167,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":485852752,""iid"":16,""project_id"":20171709,""sha"":""82df93eeb72c71271dad5a85359f39661de899fe"",""ref"":""refs/merge-requests/74/head"",""status"":""failed"",""source"":""merge_request_event"",""created_at"":""2022-03-07T07:46:09.385Z"",""updated_at"":""2022-03-07T07:51:28.709Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/485852752""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page= [...]
+168,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":485865876,""iid"":17,""project_id"":20171709,""sha"":""db45efd231dbaca1337bd29bc1f65f404754e6bd"",""ref"":""refs/merge-requests/74/head"",""status"":""failed"",""source"":""merge_request_event"",""created_at"":""2022-03-07T08:04:56.406Z"",""updated_at"":""2022-03-07T08:12:56.453Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/485865876""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page= [...]
+169,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":485877118,""iid"":18,""project_id"":20171709,""sha"":""09f81b1b2d083411c0bfecd32d7728479b594503"",""ref"":""refs/merge-requests/74/head"",""status"":""failed"",""source"":""merge_request_event"",""created_at"":""2022-03-07T08:22:48.943Z"",""updated_at"":""2022-03-07T08:27:38.364Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/485877118""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page= [...]
+170,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":485905167,""iid"":19,""project_id"":20171709,""sha"":""cce432655861efafcd05edc8de09e305c772d2b8"",""ref"":""refs/merge-requests/74/head"",""status"":""failed"",""source"":""merge_request_event"",""created_at"":""2022-03-07T09:02:09.994Z"",""updated_at"":""2022-03-07T09:13:37.013Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/485905167""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page= [...]
+171,"{""ConnectionId"":1,""ProjectId"":20171709}","{""id"":485932863,""iid"":20,""project_id"":20171709,""sha"":""12fc3a42080bb98ca520817bd4fe0ca33c0bb279"",""ref"":""refs/merge-requests/74/head"",""status"":""success"",""source"":""merge_request_event"",""created_at"":""2022-03-07T09:34:57.476Z"",""updated_at"":""2022-03-07T09:41:36.267Z"",""web_url"":""https://gitlab.com/merico-dev/ee/charts/-/pipelines/485932863""}",https://gitlab.com/api/v4/projects/20171709/pipelines?page=1&per_page [...]
diff --git a/plugins/gitlab/e2e/snapshot_tables/_tool_gitlab_pipelines.csv b/plugins/gitlab/e2e/snapshot_tables/_tool_gitlab_pipelines.csv
new file mode 100644
index 00000000..19dd54a8
--- /dev/null
+++ b/plugins/gitlab/e2e/snapshot_tables/_tool_gitlab_pipelines.csv
@@ -0,0 +1,21 @@
+connection_id,gitlab_id,project_id,gitlab_created_at,status,ref,sha,web_url,duration,started_at,finished_at,coverage,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark
+1,457474837,20171709,2022-01-27T10:07:09.429+00:00,failed,renovate/pin-dependencies,b1b82852d48b516a18e56c5bab0ebf54b8f4ccfd,https://gitlab.com/merico-dev/ee/charts/-/pipelines/457474837,0,2022-01-27T10:07:09.429+00:00,2022-01-27T10:07:09.553+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,152,
+1,457474996,20171709,2022-01-27T10:07:18.884+00:00,failed,renovate/jest-monorepo,739ab912e6e1ed27cecd8a2d00bfd6fa52afd90a,https://gitlab.com/merico-dev/ee/charts/-/pipelines/457474996,0,2022-01-27T10:07:18.884+00:00,2022-01-27T10:07:19.043+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,153,
+1,457475160,20171709,2022-01-27T10:07:26.435+00:00,failed,renovate/lodash-monorepo,44d127e0ab7dbc4bc259b55929c9d00b62fc3bf4,https://gitlab.com/merico-dev/ee/charts/-/pipelines/457475160,0,2022-01-27T10:07:26.435+00:00,2022-01-27T10:07:26.638+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,154,
+1,457475337,20171709,2022-01-27T10:07:36.502+00:00,failed,renovate/shx-0.x,10a6464b6bd2cf4b59b8ac37ce1466e013f5a20d,https://gitlab.com/merico-dev/ee/charts/-/pipelines/457475337,1,2022-01-27T10:07:36.502+00:00,2022-01-27T10:07:37.545+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,155,
+1,485811050,20171709,2022-03-07T06:26:42.109+00:00,failed,EE-7121,c791ea6949d6b4aadf79b15ba666cb690c6527ac,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485811050,0,2022-03-07T06:26:42.109+00:00,2022-03-07T06:26:42.109+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,156,
+1,485811059,20171709,2022-03-07T06:26:43.784+00:00,failed,refs/merge-requests/74/head,c791ea6949d6b4aadf79b15ba666cb690c6527ac,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485811059,0,2022-03-07T06:26:43.784+00:00,2022-03-07T06:26:43.784+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,157,
+1,485813816,20171709,2022-03-07T06:33:56.824+00:00,failed,EE-7121,ecc7c0b2874c812ed882c9effbbda26e0abc7110,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485813816,0,2022-03-07T06:33:56.824+00:00,2022-03-07T06:33:56.824+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,158,
+1,485813830,20171709,2022-03-07T06:33:58.889+00:00,failed,refs/merge-requests/74/head,ecc7c0b2874c812ed882c9effbbda26e0abc7110,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485813830,0,2022-03-07T06:33:58.889+00:00,2022-03-07T06:33:58.889+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,159,
+1,485814501,20171709,2022-03-07T06:35:28.111+00:00,failed,EE-7121,6a3346f8434cc65fbe3f7a80a0edec5b4014a733,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485814501,0,2022-03-07T06:35:28.111+00:00,2022-03-07T06:35:28.111+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,160,
+1,485814516,20171709,2022-03-07T06:35:31.255+00:00,failed,refs/merge-requests/74/head,6a3346f8434cc65fbe3f7a80a0edec5b4014a733,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485814516,0,2022-03-07T06:35:31.255+00:00,2022-03-07T06:35:31.255+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,161,
+1,485814871,20171709,2022-03-07T06:36:50.020+00:00,failed,refs/merge-requests/74/head,f731732471961fed061a01fa99631f69e861c4a2,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485814871,42,2022-03-07T06:36:50.020+00:00,2022-03-07T06:37:32.103+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,162,
+1,485817670,20171709,2022-03-07T06:45:09.471+00:00,failed,refs/merge-requests/74/head,5b95c5aebce1eae6a1b95ecf6fbc870851455375,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485817670,1956,2022-03-07T06:45:09.471+00:00,2022-03-07T07:17:46.305+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,163,
+1,485837602,20171709,2022-03-07T07:20:45.859+00:00,failed,refs/merge-requests/74/head,a79e2aaeee9916338a11b665cb4201f24627f3f1,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485837602,434,2022-03-07T07:20:45.859+00:00,2022-03-07T07:28:00.277+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,164,
+1,485842553,20171709,2022-03-07T07:30:47.018+00:00,failed,refs/merge-requests/74/head,9e0934cedcd83abab8d34c5bb0f597c7837a55f0,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485842553,287,2022-03-07T07:30:47.018+00:00,2022-03-07T07:35:34.998+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,165,
+1,485845850,20171709,2022-03-07T07:38:58.611+00:00,failed,refs/merge-requests/74/head,b3b581940f6d4d3226db31e48eab2b3b73f4c6db,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485845850,419,2022-03-07T07:38:58.611+00:00,2022-03-07T07:45:58.412+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,166,
+1,485852752,20171709,2022-03-07T07:46:09.385+00:00,failed,refs/merge-requests/74/head,82df93eeb72c71271dad5a85359f39661de899fe,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485852752,319,2022-03-07T07:46:09.385+00:00,2022-03-07T07:51:28.709+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,167,
+1,485865876,20171709,2022-03-07T08:04:56.406+00:00,failed,refs/merge-requests/74/head,db45efd231dbaca1337bd29bc1f65f404754e6bd,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485865876,480,2022-03-07T08:04:56.406+00:00,2022-03-07T08:12:56.453+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,168,
+1,485877118,20171709,2022-03-07T08:22:48.943+00:00,failed,refs/merge-requests/74/head,09f81b1b2d083411c0bfecd32d7728479b594503,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485877118,289,2022-03-07T08:22:48.943+00:00,2022-03-07T08:27:38.364+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,169,
+1,485905167,20171709,2022-03-07T09:02:09.994+00:00,failed,refs/merge-requests/74/head,cce432655861efafcd05edc8de09e305c772d2b8,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485905167,687,2022-03-07T09:02:09.994+00:00,2022-03-07T09:13:37.013+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,170,
+1,485932863,20171709,2022-03-07T09:34:57.476+00:00,success,refs/merge-requests/74/head,12fc3a42080bb98ca520817bd4fe0ca33c0bb279,https://gitlab.com/merico-dev/ee/charts/-/pipelines/485932863,398,2022-03-07T09:34:57.476+00:00,2022-03-07T09:41:36.267+00:00,,"{""ConnectionId"":1,""ProjectId"":20171709}",_raw_gitlab_api_pipeline,171,
diff --git a/plugins/gitlab/tasks/pipeline_extractor.go b/plugins/gitlab/tasks/pipeline_extractor.go
index bed10494..c0ee288b 100644
--- a/plugins/gitlab/tasks/pipeline_extractor.go
+++ b/plugins/gitlab/tasks/pipeline_extractor.go
@@ -78,7 +78,7 @@ func ExtractApiPipelines(taskCtx core.SubTaskContext) error {
 
 			// use data.Options.ProjectId to set the value of ProjectId for it
 			gitlabPipeline.ProjectId = data.Options.ProjectId
-
+			gitlabPipeline.ConnectionId = data.Options.ConnectionId
 			results := make([]interface{}, 0, 1)
 			results = append(results, gitlabPipeline)