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 ffa91d881 feat: run.type enrichment includes the `head_branch` field 
(#6201)
ffa91d881 is described below

commit ffa91d8818b6239d7aa00a232f4b16e8980506ac
Author: Klesh Wong <[email protected]>
AuthorDate: Mon Oct 9 16:22:25 2023 +0800

    feat: run.type enrichment includes the `head_branch` field (#6201)
    
    Closes #6128
---
 backend/plugins/github/e2e/raw_tables/_raw_github_api_runs.csv          | 2 +-
 backend/plugins/github/e2e/snapshot_tables/_tool_github_runs.csv        | 2 +-
 .../github/e2e/snapshot_tables/_tool_github_runs_no_prod_regex.csv      | 2 +-
 backend/plugins/github/e2e/snapshot_tables/cicd_pipeline_commits.csv    | 2 +-
 backend/plugins/github/e2e/snapshot_tables/cicd_pipelines.csv           | 2 +-
 backend/plugins/github/tasks/cicd_run_extractor.go                      | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/backend/plugins/github/e2e/raw_tables/_raw_github_api_runs.csv 
b/backend/plugins/github/e2e/raw_tables/_raw_github_api_runs.csv
index 392716833..d072a22dc 100644
--- a/backend/plugins/github/e2e/raw_tables/_raw_github_api_runs.csv
+++ b/backend/plugins/github/e2e/raw_tables/_raw_github_api_runs.csv
@@ -17,5 +17,5 @@ id,params,data,url,input,created_at
 
16,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}","{""id"":2566218975,""name"":""Tests"",""node_id"":""WFR_kwLOB_z1Gs6Y9WTf"",""head_branch"":""master"",""head_sha"":""32664cb1408f8d9ffa7236335025a4cd94a306ce"",""path"":"".github/workflows/ci.yml"",""run_number"":72,""event"":""push"",""status"":""in_progress"",""conclusion"":null,""workflow_id"":5904663,""check_suite_id"":7099938409,""check_suite_node_id"":""CS_kwDOB_z1Gs8AAAABpzB2aQ"",""url"":""https://api.github.com/repos/panjf200
 [...]
 
17,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}","{""id"":2559507315,""name"":""CodeQL"",""node_id"":""WFR_kwLOB_z1Gs6Yjvtz"",""head_branch"":""master"",""head_sha"":""f85611741eb1f5451697ac589008d28f240887fc"",""path"":"".github/workflows/codeql.yml"",""run_number"":142,""event"":""schedule"",""status"":""in_progress"",""conclusion"":null,""workflow_id"":5904664,""check_suite_id"":7087322798,""check_suite_node_id"":""CS_kwDOB_z1Gs8AAAABpm_2rg"",""url"":""https://api.github.com/repo
 [...]
 
18,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}","{""id"":2559400714,""name"":""Tests"",""node_id"":""WFR_kwLOB_z1Gs6YjVsK"",""head_branch"":""Fix_rm_redundancy_code"",""head_sha"":""5dd23ddff8621e6ae36eb24b20d4c4a06dd73dc9"",""path"":"".github/workflows/ci.yml"",""run_number"":71,""event"":""pull_request"",""status"":""completed"",""conclusion"":""success"",""workflow_id"":5904663,""check_suite_id"":7087122719,""check_suite_node_id"":""CS_kwDOB_z1Gs8AAAABpmzpHw"",""url"":""https://
 [...]
-19,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}","{""id"":2559400713,""name"":""Lint"",""node_id"":""WFR_kwLOB_z1Gs6YjVsJ"",""head_branch"":""Fix_rm_redundancy_code"",""head_sha"":""5dd23ddff8621e6ae36eb24b20d4c4a06dd73dc9"",""path"":"".github/workflows/lint.yml"",""run_number"":71,""event"":""pull_request"",""status"":""completed"",""conclusion"":""success"",""workflow_id"":5904665,""check_suite_id"":7087122718,""check_suite_node_id"":""CS_kwDOB_z1Gs8AAAABpmzpHg"",""url"":""https:/
 [...]
+19,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}","{""id"":2559400713,""name"":""Lint"",""node_id"":""WFR_kwLOB_z1Gs6YjVsJ"",""head_branch"":""CodeQL"",""head_sha"":""5dd23ddff8621e6ae36eb24b20d4c4a06dd73dc9"",""path"":"".github/workflows/lint.yml"",""run_number"":71,""event"":""pull_request"",""status"":""completed"",""conclusion"":""success"",""workflow_id"":5904665,""check_suite_id"":7087122718,""check_suite_node_id"":""CS_kwDOB_z1Gs8AAAABpmzpHg"",""url"":""https://api.github.com/
 [...]
 
20,"{""ConnectionId"":1,""Name"":""panjf2000/ants""}","{""id"":2559400712,""name"":""CodeQL"",""node_id"":""WFR_kwLOB_z1Gs6YjVsI"",""head_branch"":""Fix_rm_redundancy_code"",""head_sha"":""5dd23ddff8621e6ae36eb24b20d4c4a06dd73dc9"",""path"":"".github/workflows/codeql.yml"",""run_number"":141,""event"":""pull_request"",""status"":""completed"",""conclusion"":""success"",""workflow_id"":5904664,""check_suite_id"":7087122717,""check_suite_node_id"":""CS_kwDOB_z1Gs8AAAABpmzpHQ"",""url"":""ht
 [...]
\ No newline at end of file
diff --git a/backend/plugins/github/e2e/snapshot_tables/_tool_github_runs.csv 
b/backend/plugins/github/e2e/snapshot_tables/_tool_github_runs.csv
index a6ad58e20..c4e5c1a03 100644
--- a/backend/plugins/github/e2e/snapshot_tables/_tool_github_runs.csv
+++ b/backend/plugins/github/e2e/snapshot_tables/_tool_github_runs.csv
@@ -1,6 +1,6 @@
 
connection_id,repo_id,id,name,node_id,head_branch,head_sha,path,run_number,event,status,conclusion,workflow_id,check_suite_id,check_suite_node_id,url,html_url,github_created_at,github_updated_at,run_attempt,run_started_at,jobs_url,logs_url,check_suite_url,artifacts_url,cancel_url,rerun_url,workflow_url,type,environment
 
1,134018330,2559400712,CodeQL,WFR_kwLOB_z1Gs6YjVsI,Fix_rm_redundancy_code,5dd23ddff8621e6ae36eb24b20d4c4a06dd73dc9,.github/workflows/codeql.yml,141,pull_request,completed,success,5904664,7087122717,CS_kwDOB_z1Gs8AAAABpmzpHQ,https://api.github.com/repos/panjf2000/ants/actions/runs/2559400712,https://github.com/panjf2000/ants/actions/runs/2559400712,2022-06-25T04:17:45.000+00:00,2022-06-26T12:36:58.000+00:00,2,2022-06-26T12:35:50.000+00:00,https://api.github.com/repos/panjf2000/ants/action
 [...]
-1,134018330,2559400713,Lint,WFR_kwLOB_z1Gs6YjVsJ,Fix_rm_redundancy_code,5dd23ddff8621e6ae36eb24b20d4c4a06dd73dc9,.github/workflows/lint.yml,71,pull_request,completed,success,5904665,7087122718,CS_kwDOB_z1Gs8AAAABpmzpHg,https://api.github.com/repos/panjf2000/ants/actions/runs/2559400713,https://github.com/panjf2000/ants/actions/runs/2559400713,2022-06-25T04:17:45.000+00:00,2022-06-26T12:36:22.000+00:00,2,2022-06-26T12:35:50.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/run
 [...]
+1,134018330,2559400713,Lint,WFR_kwLOB_z1Gs6YjVsJ,CodeQL,5dd23ddff8621e6ae36eb24b20d4c4a06dd73dc9,.github/workflows/lint.yml,71,pull_request,completed,success,5904665,7087122718,CS_kwDOB_z1Gs8AAAABpmzpHg,https://api.github.com/repos/panjf2000/ants/actions/runs/2559400713,https://github.com/panjf2000/ants/actions/runs/2559400713,2022-06-25T04:17:45.000+00:00,2022-06-26T12:36:22.000+00:00,2,2022-06-26T12:35:50.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2559400713/job
 [...]
 
1,134018330,2559400714,Tests,WFR_kwLOB_z1Gs6YjVsK,Fix_rm_redundancy_code,5dd23ddff8621e6ae36eb24b20d4c4a06dd73dc9,.github/workflows/ci.yml,71,pull_request,completed,success,5904663,7087122719,CS_kwDOB_z1Gs8AAAABpmzpHw,https://api.github.com/repos/panjf2000/ants/actions/runs/2559400714,https://github.com/panjf2000/ants/actions/runs/2559400714,2022-06-25T04:17:45.000+00:00,2022-06-26T12:41:24.000+00:00,2,2022-06-26T12:35:50.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs
 [...]
 
1,134018330,2559507315,CodeQL,WFR_kwLOB_z1Gs6Yjvtz,master,f85611741eb1f5451697ac589008d28f240887fc,.github/workflows/codeql.yml,142,schedule,in_progress,,5904664,7087322798,CS_kwDOB_z1Gs8AAAABpm_2rg,https://api.github.com/repos/panjf2000/ants/actions/runs/2559507315,https://github.com/panjf2000/ants/actions/runs/2559507315,2022-06-25T05:02:56.000+00:00,2022-06-25T05:03:53.000+00:00,1,2022-06-25T05:02:56.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2559507315/jobs,ht
 [...]
 
1,134018330,2566218975,Tests,WFR_kwLOB_z1Gs6Y9WTf,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/ci.yml,72,push,in_progress,,5904663,7099938409,CS_kwDOB_z1Gs8AAAABpzB2aQ,https://api.github.com/repos/panjf2000/ants/actions/runs/2566218975,https://github.com/panjf2000/ants/actions/runs/2566218975,2022-06-27T01:29:54.000+00:00,2022-06-27T01:37:33.000+00:00,1,2022-06-27T01:29:54.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2566218975/jobs,https://api.
 [...]
diff --git 
a/backend/plugins/github/e2e/snapshot_tables/_tool_github_runs_no_prod_regex.csv
 
b/backend/plugins/github/e2e/snapshot_tables/_tool_github_runs_no_prod_regex.csv
index 1b86c263f..e4b8c60f2 100644
--- 
a/backend/plugins/github/e2e/snapshot_tables/_tool_github_runs_no_prod_regex.csv
+++ 
b/backend/plugins/github/e2e/snapshot_tables/_tool_github_runs_no_prod_regex.csv
@@ -1,6 +1,6 @@
 
connection_id,repo_id,id,name,node_id,head_branch,head_sha,path,run_number,event,status,conclusion,workflow_id,check_suite_id,check_suite_node_id,url,html_url,github_created_at,github_updated_at,run_attempt,run_started_at,jobs_url,logs_url,check_suite_url,artifacts_url,cancel_url,rerun_url,workflow_url,type,environment
 
1,134018330,2559400712,CodeQL,WFR_kwLOB_z1Gs6YjVsI,Fix_rm_redundancy_code,5dd23ddff8621e6ae36eb24b20d4c4a06dd73dc9,.github/workflows/codeql.yml,141,pull_request,completed,success,5904664,7087122717,CS_kwDOB_z1Gs8AAAABpmzpHQ,https://api.github.com/repos/panjf2000/ants/actions/runs/2559400712,https://github.com/panjf2000/ants/actions/runs/2559400712,2022-06-25T04:17:45.000+00:00,2022-06-26T12:36:58.000+00:00,2,2022-06-26T12:35:50.000+00:00,https://api.github.com/repos/panjf2000/ants/action
 [...]
-1,134018330,2559400713,Lint,WFR_kwLOB_z1Gs6YjVsJ,Fix_rm_redundancy_code,5dd23ddff8621e6ae36eb24b20d4c4a06dd73dc9,.github/workflows/lint.yml,71,pull_request,completed,success,5904665,7087122718,CS_kwDOB_z1Gs8AAAABpmzpHg,https://api.github.com/repos/panjf2000/ants/actions/runs/2559400713,https://github.com/panjf2000/ants/actions/runs/2559400713,2022-06-25T04:17:45.000+00:00,2022-06-26T12:36:22.000+00:00,2,2022-06-26T12:35:50.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/run
 [...]
+1,134018330,2559400713,Lint,WFR_kwLOB_z1Gs6YjVsJ,CodeQL,5dd23ddff8621e6ae36eb24b20d4c4a06dd73dc9,.github/workflows/lint.yml,71,pull_request,completed,success,5904665,7087122718,CS_kwDOB_z1Gs8AAAABpmzpHg,https://api.github.com/repos/panjf2000/ants/actions/runs/2559400713,https://github.com/panjf2000/ants/actions/runs/2559400713,2022-06-25T04:17:45.000+00:00,2022-06-26T12:36:22.000+00:00,2,2022-06-26T12:35:50.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2559400713/job
 [...]
 
1,134018330,2559400714,Tests,WFR_kwLOB_z1Gs6YjVsK,Fix_rm_redundancy_code,5dd23ddff8621e6ae36eb24b20d4c4a06dd73dc9,.github/workflows/ci.yml,71,pull_request,completed,success,5904663,7087122719,CS_kwDOB_z1Gs8AAAABpmzpHw,https://api.github.com/repos/panjf2000/ants/actions/runs/2559400714,https://github.com/panjf2000/ants/actions/runs/2559400714,2022-06-25T04:17:45.000+00:00,2022-06-26T12:41:24.000+00:00,2,2022-06-26T12:35:50.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs
 [...]
 
1,134018330,2559507315,CodeQL,WFR_kwLOB_z1Gs6Yjvtz,master,f85611741eb1f5451697ac589008d28f240887fc,.github/workflows/codeql.yml,142,schedule,in_progress,,5904664,7087322798,CS_kwDOB_z1Gs8AAAABpm_2rg,https://api.github.com/repos/panjf2000/ants/actions/runs/2559507315,https://github.com/panjf2000/ants/actions/runs/2559507315,2022-06-25T05:02:56.000+00:00,2022-06-25T05:03:53.000+00:00,1,2022-06-25T05:02:56.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2559507315/jobs,ht
 [...]
 
1,134018330,2566218975,Tests,WFR_kwLOB_z1Gs6Y9WTf,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/ci.yml,72,push,in_progress,,5904663,7099938409,CS_kwDOB_z1Gs8AAAABpzB2aQ,https://api.github.com/repos/panjf2000/ants/actions/runs/2566218975,https://github.com/panjf2000/ants/actions/runs/2566218975,2022-06-27T01:29:54.000+00:00,2022-06-27T01:37:33.000+00:00,1,2022-06-27T01:29:54.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2566218975/jobs,https://api.
 [...]
diff --git 
a/backend/plugins/github/e2e/snapshot_tables/cicd_pipeline_commits.csv 
b/backend/plugins/github/e2e/snapshot_tables/cicd_pipeline_commits.csv
index ae412e744..c077965d4 100644
--- a/backend/plugins/github/e2e/snapshot_tables/cicd_pipeline_commits.csv
+++ b/backend/plugins/github/e2e/snapshot_tables/cicd_pipeline_commits.csv
@@ -1,6 +1,6 @@
 pipeline_id,commit_sha,branch,repo_id,repo_url
 
github:GithubRun:1:134018330:2559400712,5dd23ddff8621e6ae36eb24b20d4c4a06dd73dc9,Fix_rm_redundancy_code,github:GithubRepo:1:134018330,https://github.com/panjf2000/ants
-github:GithubRun:1:134018330:2559400713,5dd23ddff8621e6ae36eb24b20d4c4a06dd73dc9,Fix_rm_redundancy_code,github:GithubRepo:1:134018330,https://github.com/panjf2000/ants
+github:GithubRun:1:134018330:2559400713,5dd23ddff8621e6ae36eb24b20d4c4a06dd73dc9,CodeQL,github:GithubRepo:1:134018330,https://github.com/panjf2000/ants
 
github:GithubRun:1:134018330:2559400714,5dd23ddff8621e6ae36eb24b20d4c4a06dd73dc9,Fix_rm_redundancy_code,github:GithubRepo:1:134018330,https://github.com/panjf2000/ants
 
github:GithubRun:1:134018330:2559507315,f85611741eb1f5451697ac589008d28f240887fc,master,github:GithubRepo:1:134018330,https://github.com/panjf2000/ants
 
github:GithubRun:1:134018330:2566218975,32664cb1408f8d9ffa7236335025a4cd94a306ce,master,github:GithubRepo:1:134018330,https://github.com/panjf2000/ants
diff --git a/backend/plugins/github/e2e/snapshot_tables/cicd_pipelines.csv 
b/backend/plugins/github/e2e/snapshot_tables/cicd_pipelines.csv
index 74b1cb571..652a0f98d 100644
--- a/backend/plugins/github/e2e/snapshot_tables/cicd_pipelines.csv
+++ b/backend/plugins/github/e2e/snapshot_tables/cicd_pipelines.csv
@@ -1,6 +1,6 @@
 
id,name,result,status,type,duration_sec,environment,created_date,finished_date,cicd_scope_id
 
github:GithubRun:1:134018330:2559400712,CodeQL,SUCCESS,DONE,DEPLOYMENT,116353,PRODUCTION,2022-06-25T04:17:45.000+00:00,2022-06-26T12:36:58.000+00:00,github:GithubRepo:1:134018330
-github:GithubRun:1:134018330:2559400713,Lint,SUCCESS,DONE,,116317,,2022-06-25T04:17:45.000+00:00,2022-06-26T12:36:22.000+00:00,github:GithubRepo:1:134018330
+github:GithubRun:1:134018330:2559400713,Lint,SUCCESS,DONE,,116317,PRODUCTION,2022-06-25T04:17:45.000+00:00,2022-06-26T12:36:22.000+00:00,github:GithubRepo:1:134018330
 
github:GithubRun:1:134018330:2559400714,Tests,SUCCESS,DONE,,116619,,2022-06-25T04:17:45.000+00:00,2022-06-26T12:41:24.000+00:00,github:GithubRepo:1:134018330
 
github:GithubRun:1:134018330:2559507315,CodeQL,,IN_PROGRESS,DEPLOYMENT,0,PRODUCTION,2022-06-25T05:02:56.000+00:00,2022-06-25T05:03:53.000+00:00,github:GithubRepo:1:134018330
 
github:GithubRun:1:134018330:2566218975,Tests,,IN_PROGRESS,,0,,2022-06-27T01:29:54.000+00:00,2022-06-27T01:37:33.000+00:00,github:GithubRepo:1:134018330
diff --git a/backend/plugins/github/tasks/cicd_run_extractor.go 
b/backend/plugins/github/tasks/cicd_run_extractor.go
index a62edef91..a852814f9 100644
--- a/backend/plugins/github/tasks/cicd_run_extractor.go
+++ b/backend/plugins/github/tasks/cicd_run_extractor.go
@@ -92,7 +92,7 @@ func ExtractRuns(taskCtx plugin.SubTaskContext) errors.Error {
                                RerunURL:         githubRun.RerunURL,
                                WorkflowURL:      githubRun.WorkflowURL,
                                Type:             
data.RegexEnricher.ReturnNameIfMatched(devops.DEPLOYMENT, githubRun.Name),
-                               Environment:      
data.RegexEnricher.ReturnNameIfOmittedOrMatched(devops.PRODUCTION, 
githubRun.Name),
+                               Environment:      
data.RegexEnricher.ReturnNameIfOmittedOrMatched(devops.PRODUCTION, 
githubRun.Name, githubRun.HeadBranch),
                        }
                        results = append(results, githubRunResult)
                        return results, nil

Reply via email to