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

abeizn 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 2259770d fix(gitlab): correct mr convertor
2259770d is described below

commit 2259770dd188312091bb7c79d7fa792a8184b7fa
Author: Yingchu Chen <[email protected]>
AuthorDate: Wed Oct 12 19:42:31 2022 +0800

    fix(gitlab): correct mr convertor
    
    closes #3394
---
 .../gitlab/e2e/snapshot_tables/pull_requests.csv   | 24 +++++++++++-----------
 plugins/gitlab/tasks/mr_convertor.go               |  4 ++--
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/plugins/gitlab/e2e/snapshot_tables/pull_requests.csv 
b/plugins/gitlab/e2e/snapshot_tables/pull_requests.csv
index 0fb73318..1e4f238d 100644
--- a/plugins/gitlab/e2e/snapshot_tables/pull_requests.csv
+++ b/plugins/gitlab/e2e/snapshot_tables/pull_requests.csv
@@ -1,25 +1,25 @@
 
id,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark,base_repo_id,head_repo_id,status,title,description,url,author_name,author_id,parent_pr_id,pull_request_key,created_date,merged_date,closed_date,type,component,merge_commit_sha,head_ref,base_ref,base_commit_sha,head_commit_sha
-gitlab:GitlabMergeRequest:1:110817220,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,16,,gitlab:GitlabProject:1:28584714,gitlab:GitlabProject:1:12345678,merged,Update
 packages.yml to point to dbt-labs instead of fishtown,With the company name 
change the old repo is 
deprecated.,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/16,GJMcClintock,gitlab:GitlabAccount:1:9439881,,16,2021-08-03T15:02:54.955+00:00,2021-08-12T06:12:54.329+00:00,,,,6f45b4
 [...]
-gitlab:GitlabMergeRequest:1:111383524,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,17,,gitlab:GitlabProject:1:0,gitlab:GitlabProject:1:12345678,closed,The
 package name changed -> 
https://hub.getdbt.com/dbt-labs/dbt_utils/latest/,,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/17,swiffer,gitlab:GitlabAccount:1:156402,,17,2021-08-07T06:50:25.458+00:00,,2021-08-07T06:51:14.933+00:00,,,,swiffer-master-patch-77533,master,,
-gitlab:GitlabMergeRequest:1:114994501,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,18,,gitlab:GitlabProject:1:29298577,gitlab:GitlabProject:1:12345678,opened,Add
 support for Snowpipe usage monitoring,Add models and docs for Snowflake pipes 
(Snowpipe) usage monitoring based on the views in Snowflake Usage 
schema,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/18,gary-beautypie,gitlab:GitlabAccount:1:9635687,,18,2021-09-01T21:15:30.334+00:00,
 [...]
-gitlab:GitlabMergeRequest:1:135775405,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,19,,gitlab:GitlabProject:1:32935405,gitlab:GitlabProject:1:12345678,opened,Updates
 for dbt 1.0,"This MR sets up the repo for dbt 1.0
+gitlab:GitlabMergeRequest:1:110817220,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,16,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:28584714,merged,Update
 packages.yml to point to dbt-labs instead of fishtown,With the company name 
change the old repo is 
deprecated.,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/16,GJMcClintock,gitlab:GitlabAccount:1:9439881,,16,2021-08-03T15:02:54.955+00:00,2021-08-12T06:12:54.329+00:00,,,,6f45b4
 [...]
+gitlab:GitlabMergeRequest:1:111383524,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,17,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:0,closed,The
 package name changed -> 
https://hub.getdbt.com/dbt-labs/dbt_utils/latest/,,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/17,swiffer,gitlab:GitlabAccount:1:156402,,17,2021-08-07T06:50:25.458+00:00,,2021-08-07T06:51:14.933+00:00,,,,swiffer-master-patch-77533,master,,
+gitlab:GitlabMergeRequest:1:114994501,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,18,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:29298577,opened,Add
 support for Snowpipe usage monitoring,Add models and docs for Snowflake pipes 
(Snowpipe) usage monitoring based on the views in Snowflake Usage 
schema,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/18,gary-beautypie,gitlab:GitlabAccount:1:9635687,,18,2021-09-01T21:15:30.334+00:00,
 [...]
+gitlab:GitlabMergeRequest:1:135775405,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,19,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:32935405,opened,Updates
 for dbt 1.0,"This MR sets up the repo for dbt 1.0
 A few configs were renamed.
 
 Could a new release be made for dbt 
1.0?",https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/19,johnj4,gitlab:GitlabAccount:1:10663622,,19,2022-01-18T19:59:30.723+00:00,,,,,,updates_for_dbt_1.0,master,,
-gitlab:GitlabMergeRequest:1:145012495,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,20,,gitlab:GitlabProject:1:34491818,gitlab:GitlabProject:1:12345678,closed,Draft:
 Update 
dbt_project.yml,,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/20,PedramNavid,gitlab:GitlabAccount:1:9722492,,20,2022-03-15T03:07:06.077+00:00,,2022-03-15T03:07:22.665+00:00,,,,PedramNavid-master-patch-20645,master,,
+gitlab:GitlabMergeRequest:1:145012495,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,20,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:34491818,closed,Draft:
 Update 
dbt_project.yml,,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/20,PedramNavid,gitlab:GitlabAccount:1:9722492,,20,2022-03-15T03:07:06.077+00:00,,2022-03-15T03:07:22.665+00:00,,,,PedramNavid-master-patch-20645,master,,
 
gitlab:GitlabMergeRequest:1:158698019,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,21,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:12345678,opened,Draft:
 Corrections for dbt 1,Closes 
https://gitlab.com/gitlab-data/analytics/-/issues/12941,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/21,paul_armstrong,gitlab:GitlabAccount:1:5618371,,21,2022-06-03T09:24:53.707+00:00,,,,,,updates_for_dbt_1_1,master,,
 
gitlab:GitlabMergeRequest:1:32348491,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,1,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:12345678,merged,"Resolve
 ""Add documentation to snowflake spend package""",Closes 
#1,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/1,emilie,gitlab:GitlabAccount:1:2295562,,1,2019-06-28T05:21:43.743+00:00,2019-06-28T14:32:06.192+00:00,,,,da1d6dea48f5972ffc683da6cff30934e7d6c52c,1-add-documentation-to-s
 [...]
-gitlab:GitlabMergeRequest:1:35064956,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,3,,gitlab:GitlabProject:1:13835497,gitlab:GitlabProject:1:12345678,merged,Update
 README to include steps to resolve a potential dbt-utils conflict,Closes 
#5,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/3,martinguindon,gitlab:GitlabAccount:1:3871284,,3,2019-08-15T19:34:32.706+00:00,2019-08-26T14:15:27.922+00:00,,,,d678bea9d47b42eb13512d1c9d6a592d80b432d4,5-u
 [...]
+gitlab:GitlabMergeRequest:1:35064956,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,3,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:13835497,merged,Update
 README to include steps to resolve a potential dbt-utils conflict,Closes 
#5,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/3,martinguindon,gitlab:GitlabAccount:1:3871284,,3,2019-08-15T19:34:32.706+00:00,2019-08-26T14:15:27.922+00:00,,,,d678bea9d47b42eb13512d1c9d6a592d80b432d4,5-u
 [...]
 
gitlab:GitlabMergeRequest:1:35841926,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,4,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:12345678,merged,"Resolve
 ""Config is not generic enough""",Closes 
#4,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/4,emilie,gitlab:GitlabAccount:1:2295562,,4,2019-08-26T15:32:49.557+00:00,2019-08-26T15:37:50.105+00:00,,,,e95b5db25e15a38e21d11cb45cc21bf17d5c407c,4-config-is-not-generic-enough,master,,
-gitlab:GitlabMergeRequest:1:53445063,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,5,,gitlab:GitlabProject:1:15706315,gitlab:GitlabProject:1:12345678,merged,Issue
 3 Base 
model,,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/5,nehiljain,gitlab:GitlabAccount:1:783199,,5,2020-03-24T12:46:15.891+00:00,2020-03-25T18:36:45.801+00:00,,,,f2ee4cf121a328ce39723506dc18e4661941971a,issue_3,master,,
-gitlab:GitlabMergeRequest:1:53627854,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,6,,gitlab:GitlabProject:1:15706063,gitlab:GitlabProject:1:12345678,merged,Update
 schema.yml typo in 
docs,,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/6,nehiljain,gitlab:GitlabAccount:1:783199,,6,2020-03-25T19:02:16.747+00:00,2020-03-25T19:04:19.844+00:00,,,,12dcc23a45adce0b12f8687438ec3a28274c7c30,patch-1,master,,
+gitlab:GitlabMergeRequest:1:53445063,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,5,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:15706315,merged,Issue
 3 Base 
model,,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/5,nehiljain,gitlab:GitlabAccount:1:783199,,5,2020-03-24T12:46:15.891+00:00,2020-03-25T18:36:45.801+00:00,,,,f2ee4cf121a328ce39723506dc18e4661941971a,issue_3,master,,
+gitlab:GitlabMergeRequest:1:53627854,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,6,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:15706063,merged,Update
 schema.yml typo in 
docs,,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/6,nehiljain,gitlab:GitlabAccount:1:783199,,6,2020-03-25T19:02:16.747+00:00,2020-03-25T19:04:19.844+00:00,,,,12dcc23a45adce0b12f8687438ec3a28274c7c30,patch-1,master,,
 
gitlab:GitlabMergeRequest:1:55146687,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,8,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:12345678,merged,"Resolve
 ""Document release process""",Closes 
#6,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/8,m_walker,gitlab:GitlabAccount:1:5212782,,8,2020-04-08T20:07:10.223+00:00,2020-04-08T20:52:11.150+00:00,,,,7c8245a3a5eda7f502737940aaf7944d99c58f2e,6-document-release-process,master,,
-gitlab:GitlabMergeRequest:1:55146787,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,9,,gitlab:GitlabProject:1:15706315,gitlab:GitlabProject:1:12345678,opened,Issue
 3: Transformed model for query 
performance,,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/9,nehiljain,gitlab:GitlabAccount:1:783199,,9,2020-04-08T20:09:08.130+00:00,,,,,,issue_3,master,,
+gitlab:GitlabMergeRequest:1:55146787,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,9,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:15706315,opened,Issue
 3: Transformed model for query 
performance,,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/9,nehiljain,gitlab:GitlabAccount:1:783199,,9,2020-04-08T20:09:08.130+00:00,,,,,,issue_3,master,,
 
gitlab:GitlabMergeRequest:1:58311001,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,10,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:12345678,merged,Update
 version in 
readme,,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/10,emilie,gitlab:GitlabAccount:1:2295562,,10,2020-05-11T17:09:12.265+00:00,2020-05-11T17:09:20.603+00:00,,,,66c0f1de49a0c876b8f93e8e0dce3327e766f59d,emilie-master-patch-23079,master,,
-gitlab:GitlabMergeRequest:1:62519057,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,11,,gitlab:GitlabProject:1:19569570,gitlab:GitlabProject:1:12345678,opened,Clustering
 metering 
models,,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/11,jainnehil,gitlab:GitlabAccount:1:842680,,11,2020-06-24T12:34:04.792+00:00,,,,,,clustering-metering,master,,
+gitlab:GitlabMergeRequest:1:62519057,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,11,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:19569570,opened,Clustering
 metering 
models,,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/11,jainnehil,gitlab:GitlabAccount:1:842680,,11,2020-06-24T12:34:04.792+00:00,,,,,,clustering-metering,master,,
 
gitlab:GitlabMergeRequest:1:65505080,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,12,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:12345678,merged,"Resolve
 ""Upgrade package for dbt 0.17""","Closes #11 
 
 * Upgrades to 0.17.0 format
 * Formatting changes to be in line with GitLab SQL Style 
Guide",https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/12,tayloramurphy,gitlab:GitlabAccount:1:1942272,,12,2020-07-24T17:47:08.238+00:00,2020-07-24T21:13:35.321+00:00,,,,9bfc136eb90802c2ce59956c34dde01bb3de0d50,11-upgrade-package-for-dbt-0-17,master,,
-gitlab:GitlabMergeRequest:1:68978485,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,13,,gitlab:GitlabProject:1:15706315,gitlab:GitlabProject:1:12345678,closed,Include
 more snowflake qrt 
columns,,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/13,aianus,gitlab:GitlabAccount:1:2478227,,13,2020-08-27T20:17:01.825+00:00,,2020-08-27T20:20:08.150+00:00,,,,include_more_snowflake_qrt_columns,master,,
-gitlab:GitlabMergeRequest:1:89243644,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,14,,gitlab:GitlabProject:1:24539973,gitlab:GitlabProject:1:12345678,merged,Update
 README.md to use the newest version as an example,Update README.md to use the 
newest version as an example. The old version doesn't work with the current 
version of 
dbt,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/14,ThomasLaPiana,gitlab:GitlabAccount:1:2061802,,14,2021-02-19T
 [...]
+gitlab:GitlabMergeRequest:1:68978485,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,13,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:15706315,closed,Include
 more snowflake qrt 
columns,,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/13,aianus,gitlab:GitlabAccount:1:2478227,,13,2020-08-27T20:17:01.825+00:00,,2020-08-27T20:20:08.150+00:00,,,,include_more_snowflake_qrt_columns,master,,
+gitlab:GitlabMergeRequest:1:89243644,"{""ConnectionId"":1,""ProjectId"":12345678}",_raw_gitlab_api_merge_requests,14,,gitlab:GitlabProject:1:12345678,gitlab:GitlabProject:1:24539973,merged,Update
 README.md to use the newest version as an example,Update README.md to use the 
newest version as an example. The old version doesn't work with the current 
version of 
dbt,https://gitlab.com/gitlab-data/snowflake_spend/-/merge_requests/14,ThomasLaPiana,gitlab:GitlabAccount:1:2061802,,14,2021-02-19T
 [...]
diff --git a/plugins/gitlab/tasks/mr_convertor.go 
b/plugins/gitlab/tasks/mr_convertor.go
index 35c2344c..c3c4e26a 100644
--- a/plugins/gitlab/tasks/mr_convertor.go
+++ b/plugins/gitlab/tasks/mr_convertor.go
@@ -68,8 +68,8 @@ func ConvertApiMergeRequests(taskCtx core.SubTaskContext) 
errors.Error {
                                DomainEntity: domainlayer.DomainEntity{
                                        Id: 
domainMrIdGenerator.Generate(data.Options.ConnectionId, gitlabMr.GitlabId),
                                },
-                               BaseRepoId:     
domainRepoIdGenerator.Generate(data.Options.ConnectionId, 
gitlabMr.SourceProjectId),
-                               HeadRepoId:     
domainRepoIdGenerator.Generate(data.Options.ConnectionId, 
gitlabMr.TargetProjectId),
+                               HeadRepoId:     
domainRepoIdGenerator.Generate(data.Options.ConnectionId, 
gitlabMr.SourceProjectId),
+                               BaseRepoId:     
domainRepoIdGenerator.Generate(data.Options.ConnectionId, 
gitlabMr.TargetProjectId),
                                Status:         gitlabMr.State,
                                PullRequestKey: gitlabMr.Iid,
                                Title:          gitlabMr.Title,

Reply via email to