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
commit 05df3d9d8740f792e360ae8fe1c321493aca9c8d Author: linyh <[email protected]> AuthorDate: Thu Sep 15 18:22:45 2022 +0800 fix: fix for dora e2e --- models/domainlayer/devops/cicd_pipeline_repo.go | 2 +- plugins/dora/e2e/env_enricher_test.go | 2 +- .../{lake_cicd_pipeline_repos.csv => lake_cicd_pipeline_commits.csv} | 2 +- plugins/dora/tasks/cicd_task_env_enricher.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/models/domainlayer/devops/cicd_pipeline_repo.go b/models/domainlayer/devops/cicd_pipeline_repo.go index 4abc307a..a9bcf3fd 100644 --- a/models/domainlayer/devops/cicd_pipeline_repo.go +++ b/models/domainlayer/devops/cicd_pipeline_repo.go @@ -24,7 +24,7 @@ type CiCDPipelineCommit struct { PipelineId string `gorm:"primaryKey;type:varchar(255)"` CommitSha string `gorm:"primaryKey;type:varchar(255)"` Branch string `gorm:"type:varchar(255)"` - Repo string `gorm:"type:varchar(255)"` + Repo string `gorm:"index;type:varchar(255)"` } func (CiCDPipelineCommit) TableName() string { diff --git a/plugins/dora/e2e/env_enricher_test.go b/plugins/dora/e2e/env_enricher_test.go index b300bbdd..9d62de1d 100644 --- a/plugins/dora/e2e/env_enricher_test.go +++ b/plugins/dora/e2e/env_enricher_test.go @@ -44,7 +44,7 @@ func TestEnrichEnvDataFlow(t *testing.T) { dataflowTester.FlushTabler(&devops.CICDTask{}) // import raw data table - dataflowTester.ImportCsvIntoTabler("./raw_tables/lake_cicd_pipeline_repos.csv", &devops.CiCDPipelineRepo{}) + dataflowTester.ImportCsvIntoTabler("./raw_tables/lake_cicd_pipeline_commits.csv", &devops.CiCDPipelineCommit{}) dataflowTester.ImportCsvIntoTabler("./raw_tables/lake_cicd_tasks.csv", &devops.CICDTask{}) // verify converter diff --git a/plugins/dora/e2e/raw_tables/lake_cicd_pipeline_repos.csv b/plugins/dora/e2e/raw_tables/lake_cicd_pipeline_commits.csv similarity index 98% rename from plugins/dora/e2e/raw_tables/lake_cicd_pipeline_repos.csv rename to plugins/dora/e2e/raw_tables/lake_cicd_pipeline_commits.csv index 44fe3de2..387384d8 100644 --- a/plugins/dora/e2e/raw_tables/lake_cicd_pipeline_repos.csv +++ b/plugins/dora/e2e/raw_tables/lake_cicd_pipeline_commits.csv @@ -1,4 +1,4 @@ -id,created_at,updated_at,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark,commit_sha,branch,repo +pipeline_id,created_at,updated_at,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark,commit_sha,branch,repo github:GithubRun:1:3022052551,2022-09-15 03:20:03.452,2022-09-15 03:20:03.452,"","",0,"",74cc484551329c7f92dc03519398dba62f96f128,apache,github:GithubRepo:1:384111310 github:GithubRun:1:3022052555,2022-09-15 03:20:03.452,2022-09-15 03:20:03.452,"","",0,"",74cc484551329c7f92dc03519398dba62f96f128,apache,github:GithubRepo:1:384111310 github:GithubRun:1:3022052557,2022-09-15 03:20:03.452,2022-09-15 03:20:03.452,"","",0,"",74cc484551329c7f92dc03519398dba62f96f128,apache,github:GithubRepo:1:384111310 diff --git a/plugins/dora/tasks/cicd_task_env_enricher.go b/plugins/dora/tasks/cicd_task_env_enricher.go index e7d5a52c..f03ee9ff 100644 --- a/plugins/dora/tasks/cicd_task_env_enricher.go +++ b/plugins/dora/tasks/cicd_task_env_enricher.go @@ -53,7 +53,7 @@ func EnrichTasksEnv(taskCtx core.SubTaskContext) (err errors.Error) { cursor, err := db.Cursor( dal.From(&devops.CICDTask{}), - dal.Join("left join cicd_pipeline_repos cpr on cpr.repo=? and pipeline_id = cpr.id ", repoId), + dal.Join("left join cicd_pipeline_commits cpr on cpr.repo=? and cicd_tasks.pipeline_id = cpr.pipeline_id ", repoId), dal.Where("status=?", devops.DONE)) if err != nil { return err
