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 c87508b25 refactor(github): refactor for dora (#4962)
c87508b25 is described below

commit c87508b256894a50835d7d733e710f6ae7526034
Author: Warren Chen <[email protected]>
AuthorDate: Wed Apr 19 15:28:33 2023 +0800

    refactor(github): refactor for dora (#4962)
---
 .../github/e2e/{cicd_test.go => cicd_job_test.go}  | 39 +++-------------
 .../github/e2e/{cicd_test.go => cicd_run_test.go}  | 32 +++----------
 .../e2e/snapshot_tables/_tool_github_jobs.csv      | 42 ++++++++---------
 .../e2e/snapshot_tables/_tool_github_runs.csv      | 42 ++++++++---------
 .../github/e2e/snapshot_tables/cicd_tasks.csv      | 16 +++----
 backend/plugins/github/github.go                   |  4 +-
 backend/plugins/github/impl/impl.go                | 14 +++++-
 backend/plugins/github/models/job.go               |  1 +
 .../20230418_add_env_to_run_and_job.go             | 54 ++++++++++++++++++++++
 .../github/models/migrationscripts/register.go     |  1 +
 backend/plugins/github/models/run.go               |  1 +
 backend/plugins/github/tasks/cicd_job_convertor.go |  8 +---
 backend/plugins/github/tasks/cicd_job_extractor.go |  5 +-
 backend/plugins/github/tasks/cicd_run_convertor.go |  2 +
 backend/plugins/github/tasks/cicd_run_extractor.go |  5 +-
 backend/plugins/github/tasks/task_data.go          |  1 +
 16 files changed, 145 insertions(+), 122 deletions(-)

diff --git a/backend/plugins/github/e2e/cicd_test.go 
b/backend/plugins/github/e2e/cicd_job_test.go
similarity index 61%
copy from backend/plugins/github/e2e/cicd_test.go
copy to backend/plugins/github/e2e/cicd_job_test.go
index 476ec3c8c..86ef28c0c 100644
--- a/backend/plugins/github/e2e/cicd_test.go
+++ b/backend/plugins/github/e2e/cicd_job_test.go
@@ -19,6 +19,7 @@ package e2e
 
 import (
        "github.com/apache/incubator-devlake/core/models/common"
+       helper "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
        "testing"
 
        "github.com/apache/incubator-devlake/core/models/domainlayer/devops"
@@ -28,49 +29,21 @@ import (
        "github.com/apache/incubator-devlake/plugins/github/tasks"
 )
 
-func TestGithubCICDDataFlow(t *testing.T) {
+func TestGithubCICDJobDataFlow(t *testing.T) {
        var github impl.Github
        dataflowTester := e2ehelper.NewDataFlowTester(t, "github", github)
-
+       regexEnricher := helper.NewRegexEnricher()
+       _ = regexEnricher.TryAdd(devops.DEPLOYMENT, "deploywindows.*")
+       _ = regexEnricher.TryAdd(devops.PRODUCTION, "deploywindows.*")
        taskData := &tasks.GithubTaskData{
                Options: &tasks.GithubOptions{
                        ConnectionId: 1,
                        Name:         "panjf2000/ants",
                        GithubId:     134018330,
-                       GithubTransformationRule: 
&models.GithubTransformationRule{
-                               DeploymentPattern: `deploy.*`,
-                               ProductionPattern: `deploywindows.*`,
-                       },
                },
+               RegexEnricher: regexEnricher,
        }
 
-       // import raw data table
-       // SELECT * FROM _raw_github_api_runs INTO OUTFILE 
"/tmp/_raw_github_api_runs.csv" FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY 
'"' LINES TERMINATED BY '\r\n';
-       
dataflowTester.ImportCsvIntoRawTable("./raw_tables/_raw_github_api_runs.csv", 
"_raw_github_api_runs")
-       
dataflowTester.ImportCsvIntoTabler("./raw_tables/_tool_github_repos.csv", 
&models.GithubRepo{})
-
-       // verify extraction
-       dataflowTester.FlushTabler(&models.GithubRun{})
-       dataflowTester.FlushTabler(&devops.CICDPipeline{})
-       dataflowTester.FlushTabler(&devops.CiCDPipelineCommit{})
-
-       dataflowTester.Subtask(tasks.ExtractRunsMeta, taskData)
-       dataflowTester.VerifyTableWithOptions(&models.GithubRun{}, 
e2ehelper.TableOptions{
-               CSVRelPath:  "./snapshot_tables/_tool_github_runs.csv",
-               IgnoreTypes: []interface{}{common.NoPKModel{}},
-       })
-
-       dataflowTester.Subtask(tasks.ConvertRunsMeta, taskData)
-       dataflowTester.VerifyTableWithOptions(&devops.CICDPipeline{}, 
e2ehelper.TableOptions{
-               CSVRelPath:  "./snapshot_tables/cicd_pipelines.csv",
-               IgnoreTypes: []interface{}{common.NoPKModel{}},
-       })
-
-       dataflowTester.VerifyTableWithOptions(&devops.CiCDPipelineCommit{}, 
e2ehelper.TableOptions{
-               CSVRelPath:  "./snapshot_tables/cicd_pipeline_commits.csv",
-               IgnoreTypes: []interface{}{common.NoPKModel{}},
-       })
-
        // import raw data table
        // SELECT * FROM _raw_github_api_jobs INTO OUTFILE 
"/tmp/_raw_github_api_jobs.csv" FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY 
'"' LINES TERMINATED BY '\r\n';
        
dataflowTester.ImportCsvIntoRawTable("./raw_tables/_raw_github_api_jobs.csv", 
"_raw_github_api_jobs")
diff --git a/backend/plugins/github/e2e/cicd_test.go 
b/backend/plugins/github/e2e/cicd_run_test.go
similarity index 71%
rename from backend/plugins/github/e2e/cicd_test.go
rename to backend/plugins/github/e2e/cicd_run_test.go
index 476ec3c8c..e69a692d7 100644
--- a/backend/plugins/github/e2e/cicd_test.go
+++ b/backend/plugins/github/e2e/cicd_run_test.go
@@ -19,6 +19,7 @@ package e2e
 
 import (
        "github.com/apache/incubator-devlake/core/models/common"
+       helper "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
        "testing"
 
        "github.com/apache/incubator-devlake/core/models/domainlayer/devops"
@@ -28,20 +29,19 @@ import (
        "github.com/apache/incubator-devlake/plugins/github/tasks"
 )
 
-func TestGithubCICDDataFlow(t *testing.T) {
+func TestGithubCICDRunDataFlow(t *testing.T) {
        var github impl.Github
        dataflowTester := e2ehelper.NewDataFlowTester(t, "github", github)
-
+       regexEnricher := helper.NewRegexEnricher()
+       _ = regexEnricher.TryAdd(devops.DEPLOYMENT, "CodeQL.*")
+       _ = regexEnricher.TryAdd(devops.PRODUCTION, "CodeQL.*")
        taskData := &tasks.GithubTaskData{
                Options: &tasks.GithubOptions{
                        ConnectionId: 1,
                        Name:         "panjf2000/ants",
                        GithubId:     134018330,
-                       GithubTransformationRule: 
&models.GithubTransformationRule{
-                               DeploymentPattern: `deploy.*`,
-                               ProductionPattern: `deploywindows.*`,
-                       },
                },
+               RegexEnricher: regexEnricher,
        }
 
        // import raw data table
@@ -70,24 +70,4 @@ func TestGithubCICDDataFlow(t *testing.T) {
                CSVRelPath:  "./snapshot_tables/cicd_pipeline_commits.csv",
                IgnoreTypes: []interface{}{common.NoPKModel{}},
        })
-
-       // import raw data table
-       // SELECT * FROM _raw_github_api_jobs INTO OUTFILE 
"/tmp/_raw_github_api_jobs.csv" FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY 
'"' LINES TERMINATED BY '\r\n';
-       
dataflowTester.ImportCsvIntoRawTable("./raw_tables/_raw_github_api_jobs.csv", 
"_raw_github_api_jobs")
-
-       // verify extraction
-       dataflowTester.FlushTabler(&models.GithubJob{})
-       dataflowTester.FlushTabler(&devops.CICDTask{})
-
-       dataflowTester.Subtask(tasks.ExtractJobsMeta, taskData)
-       dataflowTester.VerifyTableWithOptions(&models.GithubJob{}, 
e2ehelper.TableOptions{
-               CSVRelPath:  "./snapshot_tables/_tool_github_jobs.csv",
-               IgnoreTypes: []interface{}{common.NoPKModel{}},
-       })
-
-       dataflowTester.Subtask(tasks.ConvertJobsMeta, taskData)
-       dataflowTester.VerifyTableWithOptions(&devops.CICDTask{}, 
e2ehelper.TableOptions{
-               CSVRelPath:  "./snapshot_tables/cicd_tasks.csv",
-               IgnoreTypes: []interface{}{common.NoPKModel{}},
-       })
 }
diff --git a/backend/plugins/github/e2e/snapshot_tables/_tool_github_jobs.csv 
b/backend/plugins/github/e2e/snapshot_tables/_tool_github_jobs.csv
index 9ff8cdd21..9d15f738a 100644
--- a/backend/plugins/github/e2e/snapshot_tables/_tool_github_jobs.csv
+++ b/backend/plugins/github/e2e/snapshot_tables/_tool_github_jobs.csv
@@ -1,21 +1,21 @@
-connection_id,repo_id,id,run_id,run_url,node_id,head_sha,url,html_url,status,conclusion,started_at,completed_at,name,steps,check_run_url,labels,runner_id,runner_name,runner_group_id,type
-1,134018330,1924918168,577324558,https://api.github.com/repos/panjf2000/ants/actions/runs/577324558,MDg6Q2hlY2tSdW4xOTI0OTE4MTY4,cb4adab28f63313592a9a395656b8413184ea336,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924918168,https://github.com/panjf2000/ants/runs/1924918168?check_suite_focus=true,COMPLETED,SUCCESS,2021-02-18T06:59:13.000+00:00,2021-02-18T06:59:33.000+00:00,Golangci-Lint,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": "" 
[...]
-1,134018330,1924918171,577324554,https://api.github.com/repos/panjf2000/ants/actions/runs/577324554,MDg6Q2hlY2tSdW4xOTI0OTE4MTcx,cb4adab28f63313592a9a395656b8413184ea336,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924918171,https://github.com/panjf2000/ants/runs/1924918171?check_suite_focus=true,COMPLETED,CANCELLED,2021-02-18T06:59:13.000+00:00,2021-02-18T07:01:18.000+00:00,deployubuntu,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": " 
[...]
-1,134018330,1924918191,577324554,https://api.github.com/repos/panjf2000/ants/actions/runs/577324554,MDg6Q2hlY2tSdW4xOTI0OTE4MTkx,cb4adab28f63313592a9a395656b8413184ea336,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924918191,https://github.com/panjf2000/ants/runs/1924918191?check_suite_focus=true,COMPLETED,CANCELLED,2021-02-18T06:59:21.000+00:00,2021-02-18T07:01:18.000+00:00,deploymacos,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": "" 
[...]
-1,134018330,1924918205,577324554,https://api.github.com/repos/panjf2000/ants/actions/runs/577324554,MDg6Q2hlY2tSdW4xOTI0OTE4MjA1,cb4adab28f63313592a9a395656b8413184ea336,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924918205,https://github.com/panjf2000/ants/runs/1924918205?check_suite_focus=true,COMPLETED,CANCELLED,2021-02-18T06:59:15.000+00:00,2021-02-18T07:01:09.000+00:00,deploywindows,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"":  
[...]
-1,134018330,1924918228,577324554,https://api.github.com/repos/panjf2000/ants/actions/runs/577324554,MDg6Q2hlY2tSdW4xOTI0OTE4MjI4,cb4adab28f63313592a9a395656b8413184ea336,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924918228,https://github.com/panjf2000/ants/runs/1924918228?check_suite_focus=true,COMPLETED,CANCELLED,2021-02-18T06:59:13.000+00:00,2021-02-18T07:01:18.000+00:00,deployubuntu,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": " 
[...]
-1,134018330,1924918243,577324554,https://api.github.com/repos/panjf2000/ants/actions/runs/577324554,MDg6Q2hlY2tSdW4xOTI0OTE4MjQz,cb4adab28f63313592a9a395656b8413184ea336,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924918243,https://github.com/panjf2000/ants/runs/1924918243?check_suite_focus=true,COMPLETED,CANCELLED,2021-02-18T06:59:19.000+00:00,2021-02-18T07:01:18.000+00:00,deploymacos,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": "" 
[...]
-1,134018330,1924918261,577324554,https://api.github.com/repos/panjf2000/ants/actions/runs/577324554,MDg6Q2hlY2tSdW4xOTI0OTE4MjYx,cb4adab28f63313592a9a395656b8413184ea336,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924918261,https://github.com/panjf2000/ants/runs/1924918261?check_suite_focus=true,COMPLETED,CANCELLED,2021-02-18T06:59:15.000+00:00,2021-02-18T07:01:09.000+00:00,deploywindows,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"":  
[...]
-1,134018330,1924918319,577324571,https://api.github.com/repos/panjf2000/ants/actions/runs/577324571,MDg6Q2hlY2tSdW4xOTI0OTE4MzE5,cb4adab28f63313592a9a395656b8413184ea336,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924918319,https://github.com/panjf2000/ants/runs/1924918319?check_suite_focus=true,COMPLETED,SUCCESS,2021-02-18T06:59:16.000+00:00,2021-02-18T07:00:17.000+00:00,Analyze,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": 
""succes [...]
-1,134018330,1924932184,577330055,https://api.github.com/repos/panjf2000/ants/actions/runs/577330055,MDg6Q2hlY2tSdW4xOTI0OTMyMTg0,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924932184,https://github.com/panjf2000/ants/runs/1924932184?check_suite_focus=true,COMPLETED,SUCCESS,2021-02-18T07:02:02.000+00:00,2021-02-18T07:02:56.000+00:00,Analyze,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": 
""succes [...]
-1,134018330,1924932219,577330056,https://api.github.com/repos/panjf2000/ants/actions/runs/577330056,MDg6Q2hlY2tSdW4xOTI0OTMyMjE5,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924932219,https://github.com/panjf2000/ants/runs/1924932219?check_suite_focus=true,COMPLETED,SUCCESS,2021-02-18T07:02:03.000+00:00,2021-02-18T07:05:03.000+00:00,deployubuntu,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": ""s 
[...]
-1,134018330,1924932237,577330056,https://api.github.com/repos/panjf2000/ants/actions/runs/577330056,MDg6Q2hlY2tSdW4xOTI0OTMyMjM3,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924932237,https://github.com/panjf2000/ants/runs/1924932237?check_suite_focus=true,IN_PROGRESS,,2021-02-18T07:02:06.000+00:00,2021-02-18T07:04:44.000+00:00,deploymacos,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": 
""success [...]
-1,134018330,1924932251,577330056,https://api.github.com/repos/panjf2000/ants/actions/runs/577330056,MDg6Q2hlY2tSdW4xOTI0OTMyMjUx,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924932251,https://github.com/panjf2000/ants/runs/1924932251?check_suite_focus=true,IN_PROGRESS,,2021-02-18T07:02:03.000+00:00,2021-02-18T07:05:57.000+00:00,deploywindows,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": 
""succe [...]
-1,134018330,1924932263,577330057,https://api.github.com/repos/panjf2000/ants/actions/runs/577330057,MDg6Q2hlY2tSdW4xOTI0OTMyMjYz,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924932263,https://github.com/panjf2000/ants/runs/1924932263?check_suite_focus=true,COMPLETED,FAILURE,2021-02-18T07:02:05.000+00:00,2021-02-18T07:02:19.000+00:00,Golangci-Lint,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": "" 
[...]
-1,134018330,1924932266,577330056,https://api.github.com/repos/panjf2000/ants/actions/runs/577330056,MDg6Q2hlY2tSdW4xOTI0OTMyMjY2,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924932266,https://github.com/panjf2000/ants/runs/1924932266?check_suite_focus=true,COMPLETED,SUCCESS,2021-02-18T07:02:03.000+00:00,2021-02-18T07:04:44.000+00:00,deployubuntu,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": ""s 
[...]
-1,134018330,1924932293,577330056,https://api.github.com/repos/panjf2000/ants/actions/runs/577330056,MDg6Q2hlY2tSdW4xOTI0OTMyMjkz,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924932293,https://github.com/panjf2000/ants/runs/1924932293?check_suite_focus=true,COMPLETED,SUCCESS,2021-02-18T07:02:06.000+00:00,2021-02-18T07:04:44.000+00:00,deploymacos,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": ""su 
[...]
-1,134018330,1924932319,577330056,https://api.github.com/repos/panjf2000/ants/actions/runs/577330056,MDg6Q2hlY2tSdW4xOTI0OTMyMzE5,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924932319,https://github.com/panjf2000/ants/runs/1924932319?check_suite_focus=true,COMPLETED,SUCCESS,2021-02-18T07:02:03.000+00:00,2021-02-18T07:05:53.000+00:00,deploywindows,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": "" 
[...]
-1,134018330,1940449839,583528173,https://api.github.com/repos/panjf2000/ants/actions/runs/583528173,MDg6Q2hlY2tSdW4xOTQwNDQ5ODM5,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1940449839,https://github.com/panjf2000/ants/runs/1940449839?check_suite_focus=true,COMPLETED,SUCCESS,2021-02-20T05:10:17.000+00:00,2021-02-20T05:11:12.000+00:00,Analyze,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": 
""succes [...]
-1,134018330,1992620044,604839350,https://api.github.com/repos/panjf2000/ants/actions/runs/604839350,MDg6Q2hlY2tSdW4xOTkyNjIwMDQ0,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1992620044,https://github.com/panjf2000/ants/runs/1992620044?check_suite_focus=true,COMPLETED,FAILURE,2021-02-27T05:10:19.000+00:00,2021-02-27T05:11:20.000+00:00,Analyze,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": 
""succes [...]
-1,134018330,2011825638,613518923,https://api.github.com/repos/panjf2000/ants/actions/runs/613518923,MDg6Q2hlY2tSdW4yMDExODI1NjM4,5431f73492ade2e5b947a98f6032595c32cf730e,https://api.github.com/repos/panjf2000/ants/actions/jobs/2011825638,https://github.com/panjf2000/ants/runs/2011825638?check_suite_focus=true,COMPLETED,SUCCESS,2021-03-02T09:24:49.000+00:00,2021-03-02T09:25:11.000+00:00,Golangci-Lint,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": "" 
[...]
-1,134018330,2139659897,664533609,https://api.github.com/repos/panjf2000/ants/actions/runs/664533609,MDg6Q2hlY2tSdW4yMTM5NjU5ODk3,e45d13c6303d4ec82d16cd4111a49a7de0ad0712,https://api.github.com/repos/panjf2000/ants/actions/jobs/2139659897,https://github.com/panjf2000/ants/runs/2139659897?check_suite_focus=true,COMPLETED,SUCCESS,2021-03-18T12:39:24.000+00:00,2021-03-18T12:40:35.000+00:00,Analyze,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": 
""succes [...]
+connection_id,repo_id,id,run_id,run_url,node_id,head_sha,url,html_url,status,conclusion,started_at,completed_at,name,steps,check_run_url,labels,runner_id,runner_name,runner_group_id,type,environment
+1,134018330,1924918168,577324558,https://api.github.com/repos/panjf2000/ants/actions/runs/577324558,MDg6Q2hlY2tSdW4xOTI0OTE4MTY4,cb4adab28f63313592a9a395656b8413184ea336,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924918168,https://github.com/panjf2000/ants/runs/1924918168?check_suite_focus=true,COMPLETED,SUCCESS,2021-02-18T06:59:13.000+00:00,2021-02-18T06:59:33.000+00:00,Golangci-Lint,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": "" 
[...]
+1,134018330,1924918171,577324554,https://api.github.com/repos/panjf2000/ants/actions/runs/577324554,MDg6Q2hlY2tSdW4xOTI0OTE4MTcx,cb4adab28f63313592a9a395656b8413184ea336,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924918171,https://github.com/panjf2000/ants/runs/1924918171?check_suite_focus=true,COMPLETED,CANCELLED,2021-02-18T06:59:13.000+00:00,2021-02-18T07:01:18.000+00:00,deployubuntu,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": " 
[...]
+1,134018330,1924918191,577324554,https://api.github.com/repos/panjf2000/ants/actions/runs/577324554,MDg6Q2hlY2tSdW4xOTI0OTE4MTkx,cb4adab28f63313592a9a395656b8413184ea336,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924918191,https://github.com/panjf2000/ants/runs/1924918191?check_suite_focus=true,COMPLETED,CANCELLED,2021-02-18T06:59:21.000+00:00,2021-02-18T07:01:18.000+00:00,deploymacos,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": "" 
[...]
+1,134018330,1924918205,577324554,https://api.github.com/repos/panjf2000/ants/actions/runs/577324554,MDg6Q2hlY2tSdW4xOTI0OTE4MjA1,cb4adab28f63313592a9a395656b8413184ea336,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924918205,https://github.com/panjf2000/ants/runs/1924918205?check_suite_focus=true,COMPLETED,CANCELLED,2021-02-18T06:59:15.000+00:00,2021-02-18T07:01:09.000+00:00,deploywindows,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"":  
[...]
+1,134018330,1924918228,577324554,https://api.github.com/repos/panjf2000/ants/actions/runs/577324554,MDg6Q2hlY2tSdW4xOTI0OTE4MjI4,cb4adab28f63313592a9a395656b8413184ea336,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924918228,https://github.com/panjf2000/ants/runs/1924918228?check_suite_focus=true,COMPLETED,CANCELLED,2021-02-18T06:59:13.000+00:00,2021-02-18T07:01:18.000+00:00,deployubuntu,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": " 
[...]
+1,134018330,1924918243,577324554,https://api.github.com/repos/panjf2000/ants/actions/runs/577324554,MDg6Q2hlY2tSdW4xOTI0OTE4MjQz,cb4adab28f63313592a9a395656b8413184ea336,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924918243,https://github.com/panjf2000/ants/runs/1924918243?check_suite_focus=true,COMPLETED,CANCELLED,2021-02-18T06:59:19.000+00:00,2021-02-18T07:01:18.000+00:00,deploymacos,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": "" 
[...]
+1,134018330,1924918261,577324554,https://api.github.com/repos/panjf2000/ants/actions/runs/577324554,MDg6Q2hlY2tSdW4xOTI0OTE4MjYx,cb4adab28f63313592a9a395656b8413184ea336,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924918261,https://github.com/panjf2000/ants/runs/1924918261?check_suite_focus=true,COMPLETED,CANCELLED,2021-02-18T06:59:15.000+00:00,2021-02-18T07:01:09.000+00:00,deploywindows,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"":  
[...]
+1,134018330,1924918319,577324571,https://api.github.com/repos/panjf2000/ants/actions/runs/577324571,MDg6Q2hlY2tSdW4xOTI0OTE4MzE5,cb4adab28f63313592a9a395656b8413184ea336,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924918319,https://github.com/panjf2000/ants/runs/1924918319?check_suite_focus=true,COMPLETED,SUCCESS,2021-02-18T06:59:16.000+00:00,2021-02-18T07:00:17.000+00:00,Analyze,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": 
""succes [...]
+1,134018330,1924932184,577330055,https://api.github.com/repos/panjf2000/ants/actions/runs/577330055,MDg6Q2hlY2tSdW4xOTI0OTMyMTg0,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924932184,https://github.com/panjf2000/ants/runs/1924932184?check_suite_focus=true,COMPLETED,SUCCESS,2021-02-18T07:02:02.000+00:00,2021-02-18T07:02:56.000+00:00,Analyze,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": 
""succes [...]
+1,134018330,1924932219,577330056,https://api.github.com/repos/panjf2000/ants/actions/runs/577330056,MDg6Q2hlY2tSdW4xOTI0OTMyMjE5,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924932219,https://github.com/panjf2000/ants/runs/1924932219?check_suite_focus=true,COMPLETED,SUCCESS,2021-02-18T07:02:03.000+00:00,2021-02-18T07:05:03.000+00:00,deployubuntu,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": ""s 
[...]
+1,134018330,1924932237,577330056,https://api.github.com/repos/panjf2000/ants/actions/runs/577330056,MDg6Q2hlY2tSdW4xOTI0OTMyMjM3,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924932237,https://github.com/panjf2000/ants/runs/1924932237?check_suite_focus=true,IN_PROGRESS,,2021-02-18T07:02:06.000+00:00,2021-02-18T07:04:44.000+00:00,deploymacos,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": 
""success [...]
+1,134018330,1924932251,577330056,https://api.github.com/repos/panjf2000/ants/actions/runs/577330056,MDg6Q2hlY2tSdW4xOTI0OTMyMjUx,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924932251,https://github.com/panjf2000/ants/runs/1924932251?check_suite_focus=true,IN_PROGRESS,,2021-02-18T07:02:03.000+00:00,2021-02-18T07:05:57.000+00:00,deploywindows,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": 
""succe [...]
+1,134018330,1924932263,577330057,https://api.github.com/repos/panjf2000/ants/actions/runs/577330057,MDg6Q2hlY2tSdW4xOTI0OTMyMjYz,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924932263,https://github.com/panjf2000/ants/runs/1924932263?check_suite_focus=true,COMPLETED,FAILURE,2021-02-18T07:02:05.000+00:00,2021-02-18T07:02:19.000+00:00,Golangci-Lint,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": "" 
[...]
+1,134018330,1924932266,577330056,https://api.github.com/repos/panjf2000/ants/actions/runs/577330056,MDg6Q2hlY2tSdW4xOTI0OTMyMjY2,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924932266,https://github.com/panjf2000/ants/runs/1924932266?check_suite_focus=true,COMPLETED,SUCCESS,2021-02-18T07:02:03.000+00:00,2021-02-18T07:04:44.000+00:00,deployubuntu,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": ""s 
[...]
+1,134018330,1924932293,577330056,https://api.github.com/repos/panjf2000/ants/actions/runs/577330056,MDg6Q2hlY2tSdW4xOTI0OTMyMjkz,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924932293,https://github.com/panjf2000/ants/runs/1924932293?check_suite_focus=true,COMPLETED,SUCCESS,2021-02-18T07:02:06.000+00:00,2021-02-18T07:04:44.000+00:00,deploymacos,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": ""su 
[...]
+1,134018330,1924932319,577330056,https://api.github.com/repos/panjf2000/ants/actions/runs/577330056,MDg6Q2hlY2tSdW4xOTI0OTMyMzE5,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1924932319,https://github.com/panjf2000/ants/runs/1924932319?check_suite_focus=true,COMPLETED,SUCCESS,2021-02-18T07:02:03.000+00:00,2021-02-18T07:05:53.000+00:00,deploywindows,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": "" 
[...]
+1,134018330,1940449839,583528173,https://api.github.com/repos/panjf2000/ants/actions/runs/583528173,MDg6Q2hlY2tSdW4xOTQwNDQ5ODM5,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1940449839,https://github.com/panjf2000/ants/runs/1940449839?check_suite_focus=true,COMPLETED,SUCCESS,2021-02-20T05:10:17.000+00:00,2021-02-20T05:11:12.000+00:00,Analyze,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": 
""succes [...]
+1,134018330,1992620044,604839350,https://api.github.com/repos/panjf2000/ants/actions/runs/604839350,MDg6Q2hlY2tSdW4xOTkyNjIwMDQ0,fd8d670fd09489e6ea7693c0a382ba85d2694f16,https://api.github.com/repos/panjf2000/ants/actions/jobs/1992620044,https://github.com/panjf2000/ants/runs/1992620044?check_suite_focus=true,COMPLETED,FAILURE,2021-02-27T05:10:19.000+00:00,2021-02-27T05:11:20.000+00:00,Analyze,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": 
""succes [...]
+1,134018330,2011825638,613518923,https://api.github.com/repos/panjf2000/ants/actions/runs/613518923,MDg6Q2hlY2tSdW4yMDExODI1NjM4,5431f73492ade2e5b947a98f6032595c32cf730e,https://api.github.com/repos/panjf2000/ants/actions/jobs/2011825638,https://github.com/panjf2000/ants/runs/2011825638?check_suite_focus=true,COMPLETED,SUCCESS,2021-03-02T09:24:49.000+00:00,2021-03-02T09:25:11.000+00:00,Golangci-Lint,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": "" 
[...]
+1,134018330,2139659897,664533609,https://api.github.com/repos/panjf2000/ants/actions/runs/664533609,MDg6Q2hlY2tSdW4yMTM5NjU5ODk3,e45d13c6303d4ec82d16cd4111a49a7de0ad0712,https://api.github.com/repos/panjf2000/ants/actions/jobs/2139659897,https://github.com/panjf2000/ants/runs/2139659897?check_suite_focus=true,COMPLETED,SUCCESS,2021-03-18T12:39:24.000+00:00,2021-03-18T12:40:35.000+00:00,Analyze,"[{""name"":
 ""Set up job"", ""number"": 1, ""status"": ""completed"", ""conclusion"": 
""succes [...]
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 c59c15bff..a6ad58e20 100644
--- a/backend/plugins/github/e2e/snapshot_tables/_tool_github_runs.csv
+++ b/backend/plugins/github/e2e/snapshot_tables/_tool_github_runs.csv
@@ -1,21 +1,21 @@
-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
-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,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.
 [...]
-1,134018330,2566218976,CodeQL,WFR_kwLOB_z1Gs6Y9WTg,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,143,push,completed,success,5904664,7099938410,CS_kwDOB_z1Gs8AAAABpzB2ag,https://api.github.com/repos/panjf2000/ants/actions/runs/2566218976,https://github.com/panjf2000/ants/actions/runs/2566218976,2022-06-27T01:29:54.000+00:00,2022-06-27T01:30:55.000+00:00,1,2022-06-27T01:29:54.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2566218976/jobs,h
 [...]
-1,134018330,2566218977,Lint,WFR_kwLOB_z1Gs6Y9WTh,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/lint.yml,72,push,completed,failure,5904665,7099938411,CS_kwDOB_z1Gs8AAAABpzB2aw,https://api.github.com/repos/panjf2000/ants/actions/runs/2566218977,https://github.com/panjf2000/ants/actions/runs/2566218977,2022-06-27T01:29:54.000+00:00,2022-06-27T01:30:28.000+00:00,1,2022-06-27T01:29:54.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2566218977/jobs,https:
 [...]
-1,134018330,2589885628,Tests,WFR_kwLOB_z1Gs6aXoS8,master,fa938334e73faf88a15b59622ab1da61a643c5da,.github/workflows/ci.yml,75,pull_request,completed,success,5904663,7161479138,CS_kwDOB_z1Gs8AAAABqtt_4g,https://api.github.com/repos/panjf2000/ants/actions/runs/2589885628,https://github.com/panjf2000/ants/actions/runs/2589885628,2022-06-30T12:23:37.000+00:00,2022-07-01T13:40:47.000+00:00,2,2022-07-01T13:34:14.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2589885628/jobs
 [...]
-1,134018330,2589885635,CodeQL,WFR_kwLOB_z1Gs6aXoTD,master,fa938334e73faf88a15b59622ab1da61a643c5da,.github/workflows/codeql.yml,146,pull_request,completed,failure,5904664,7161479152,CS_kwDOB_z1Gs8AAAABqtt_8A,https://api.github.com/repos/panjf2000/ants/actions/runs/2589885635,https://github.com/panjf2000/ants/actions/runs/2589885635,2022-06-30T12:23:37.000+00:00,2022-07-01T13:35:19.000+00:00,2,2022-07-01T13:34:14.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/258988563
 [...]
-1,134018330,2589885639,Lint,WFR_kwLOB_z1Gs6aXoTH,master,fa938334e73faf88a15b59622ab1da61a643c5da,.github/workflows/lint.yml,75,pull_request,completed,success,5904665,7161479158,CS_kwDOB_z1Gs8AAAABqtt_9g,https://api.github.com/repos/panjf2000/ants/actions/runs/2589885639,https://github.com/panjf2000/ants/actions/runs/2589885639,2022-06-30T12:23:37.000+00:00,2022-07-01T13:34:43.000+00:00,2,2022-07-01T13:34:14.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2589885639/job
 [...]
-1,134018330,2600408985,CodeQL,WFR_kwLOB_z1Gs6a_xeZ,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,147,schedule,completed,success,5904664,7187902086,CS_kwDOB_z1Gs8AAAABrG6uhg,https://api.github.com/repos/panjf2000/ants/actions/runs/2600408985,https://github.com/panjf2000/ants/actions/runs/2600408985,2022-07-02T05:05:26.000+00:00,2022-07-02T05:06:23.000+00:00,1,2022-07-02T05:05:26.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2600408985/jo
 [...]
-1,134018330,2639945362,CodeQL,WFR_kwLOB_z1Gs6dWl6S,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,148,schedule,completed,success,5904664,7284226378,CS_kwDOB_z1Gs8AAAABsix5Sg,https://api.github.com/repos/panjf2000/ants/actions/runs/2639945362,https://github.com/panjf2000/ants/actions/runs/2639945362,2022-07-09T05:02:44.000+00:00,2022-07-09T05:03:48.000+00:00,1,2022-07-09T05:02:44.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2639945362/jo
 [...]
-1,134018330,2680721264,CodeQL,WFR_kwLOB_z1Gs6fyI9w,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,149,schedule,completed,success,5904664,7383284464,CS_kwDOB_z1Gs8AAAABuBP68A,https://api.github.com/repos/panjf2000/ants/actions/runs/2680721264,https://github.com/panjf2000/ants/actions/runs/2680721264,2022-07-16T05:03:38.000+00:00,2022-07-16T05:04:51.000+00:00,1,2022-07-16T05:03:38.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2680721264/jo
 [...]
-1,134018330,2722539966,CodeQL,WFR_kwLOB_z1Gs6iRqm-,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,150,schedule,completed,success,5904664,7487244521,CS_kwDOB_z1Gs8AAAABvkZI6Q,https://api.github.com/repos/panjf2000/ants/actions/runs/2722539966,https://github.com/panjf2000/ants/actions/runs/2722539966,2022-07-23T05:04:59.000+00:00,2022-07-23T05:05:58.000+00:00,1,2022-07-23T05:04:59.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2722539966/jo
 [...]
-1,134018330,2764660507,CodeQL,WFR_kwLOB_z1Gs6kyV8b,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,151,schedule,completed,success,5904664,7589122087,CS_kwDOB_z1Gs8AAAABxFjQJw,https://api.github.com/repos/panjf2000/ants/actions/runs/2764660507,https://github.com/panjf2000/ants/actions/runs/2764660507,2022-07-30T05:06:06.000+00:00,2022-07-30T05:07:04.000+00:00,1,2022-07-30T05:06:06.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2764660507/jo
 [...]
-1,134018330,2807709308,CodeQL,WFR_kwLOB_z1Gs6nWj58,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,154,schedule,completed,success,5904664,7693176674,CS_kwDOB_z1Gs8AAAAByoyPYg,https://api.github.com/repos/panjf2000/ants/actions/runs/2807709308,https://github.com/panjf2000/ants/actions/runs/2807709308,2022-08-06T05:02:43.000+00:00,2022-08-06T05:03:58.000+00:00,1,2022-08-06T05:02:43.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2807709308/jo
 [...]
-1,134018330,2850801364,CodeQL,WFR_kwLOB_z1Gs6p68bU,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,155,schedule,completed,success,5904664,7797647541,CS_kwDOB_z1Gs8AAAAB0MaotQ,https://api.github.com/repos/panjf2000/ants/actions/runs/2850801364,https://github.com/panjf2000/ants/actions/runs/2850801364,2022-08-13T05:02:51.000+00:00,2022-08-13T05:03:45.000+00:00,1,2022-08-13T05:02:51.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2850801364/jo
 [...]
-1,134018330,2893573709,CodeQL,WFR_kwLOB_z1Gs6seG5N,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,156,schedule,completed,success,5904664,7899725937,CS_kwDOB_z1Gs8AAAAB1txAcQ,https://api.github.com/repos/panjf2000/ants/actions/runs/2893573709,https://github.com/panjf2000/ants/actions/runs/2893573709,2022-08-20T05:04:53.000+00:00,2022-08-20T05:06:10.000+00:00,1,2022-08-20T05:04:53.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2893573709/jo
 [...]
-1,134018330,2938072864,CodeQL,WFR_kwLOB_z1Gs6vH28g,master,06e6934c35c336b1a2bd3005fb21dc3914a45747,.github/workflows/codeql.yml,157,schedule,completed,success,5904664,8009261503,CS_kwDOB_z1Gs8AAAAB3WOhvw,https://api.github.com/repos/panjf2000/ants/actions/runs/2938072864,https://github.com/panjf2000/ants/actions/runs/2938072864,2022-08-27T05:13:50.000+00:00,2022-08-27T05:15:06.000+00:00,1,2022-08-27T05:13:50.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2938072864/jo
 [...]
-1,134018330,2983238245,CodeQL,WFR_kwLOB_z1Gs6x0Jpl,master,06e6934c35c336b1a2bd3005fb21dc3914a45747,.github/workflows/codeql.yml,158,schedule,completed,success,5904664,8117851893,CS_kwDOB_z1Gs8AAAAB49yW9Q,https://api.github.com/repos/panjf2000/ants/actions/runs/2983238245,https://github.com/panjf2000/ants/actions/runs/2983238245,2022-09-03T05:15:09.000+00:00,2022-09-03T05:16:16.000+00:00,1,2022-09-03T05:15:09.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2983238245/jo
 [...]
+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,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.
 [...]
+1,134018330,2566218976,CodeQL,WFR_kwLOB_z1Gs6Y9WTg,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,143,push,completed,success,5904664,7099938410,CS_kwDOB_z1Gs8AAAABpzB2ag,https://api.github.com/repos/panjf2000/ants/actions/runs/2566218976,https://github.com/panjf2000/ants/actions/runs/2566218976,2022-06-27T01:29:54.000+00:00,2022-06-27T01:30:55.000+00:00,1,2022-06-27T01:29:54.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2566218976/jobs,h
 [...]
+1,134018330,2566218977,Lint,WFR_kwLOB_z1Gs6Y9WTh,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/lint.yml,72,push,completed,failure,5904665,7099938411,CS_kwDOB_z1Gs8AAAABpzB2aw,https://api.github.com/repos/panjf2000/ants/actions/runs/2566218977,https://github.com/panjf2000/ants/actions/runs/2566218977,2022-06-27T01:29:54.000+00:00,2022-06-27T01:30:28.000+00:00,1,2022-06-27T01:29:54.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2566218977/jobs,https:
 [...]
+1,134018330,2589885628,Tests,WFR_kwLOB_z1Gs6aXoS8,master,fa938334e73faf88a15b59622ab1da61a643c5da,.github/workflows/ci.yml,75,pull_request,completed,success,5904663,7161479138,CS_kwDOB_z1Gs8AAAABqtt_4g,https://api.github.com/repos/panjf2000/ants/actions/runs/2589885628,https://github.com/panjf2000/ants/actions/runs/2589885628,2022-06-30T12:23:37.000+00:00,2022-07-01T13:40:47.000+00:00,2,2022-07-01T13:34:14.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2589885628/jobs
 [...]
+1,134018330,2589885635,CodeQL,WFR_kwLOB_z1Gs6aXoTD,master,fa938334e73faf88a15b59622ab1da61a643c5da,.github/workflows/codeql.yml,146,pull_request,completed,failure,5904664,7161479152,CS_kwDOB_z1Gs8AAAABqtt_8A,https://api.github.com/repos/panjf2000/ants/actions/runs/2589885635,https://github.com/panjf2000/ants/actions/runs/2589885635,2022-06-30T12:23:37.000+00:00,2022-07-01T13:35:19.000+00:00,2,2022-07-01T13:34:14.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/258988563
 [...]
+1,134018330,2589885639,Lint,WFR_kwLOB_z1Gs6aXoTH,master,fa938334e73faf88a15b59622ab1da61a643c5da,.github/workflows/lint.yml,75,pull_request,completed,success,5904665,7161479158,CS_kwDOB_z1Gs8AAAABqtt_9g,https://api.github.com/repos/panjf2000/ants/actions/runs/2589885639,https://github.com/panjf2000/ants/actions/runs/2589885639,2022-06-30T12:23:37.000+00:00,2022-07-01T13:34:43.000+00:00,2,2022-07-01T13:34:14.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2589885639/job
 [...]
+1,134018330,2600408985,CodeQL,WFR_kwLOB_z1Gs6a_xeZ,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,147,schedule,completed,success,5904664,7187902086,CS_kwDOB_z1Gs8AAAABrG6uhg,https://api.github.com/repos/panjf2000/ants/actions/runs/2600408985,https://github.com/panjf2000/ants/actions/runs/2600408985,2022-07-02T05:05:26.000+00:00,2022-07-02T05:06:23.000+00:00,1,2022-07-02T05:05:26.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2600408985/jo
 [...]
+1,134018330,2639945362,CodeQL,WFR_kwLOB_z1Gs6dWl6S,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,148,schedule,completed,success,5904664,7284226378,CS_kwDOB_z1Gs8AAAABsix5Sg,https://api.github.com/repos/panjf2000/ants/actions/runs/2639945362,https://github.com/panjf2000/ants/actions/runs/2639945362,2022-07-09T05:02:44.000+00:00,2022-07-09T05:03:48.000+00:00,1,2022-07-09T05:02:44.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2639945362/jo
 [...]
+1,134018330,2680721264,CodeQL,WFR_kwLOB_z1Gs6fyI9w,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,149,schedule,completed,success,5904664,7383284464,CS_kwDOB_z1Gs8AAAABuBP68A,https://api.github.com/repos/panjf2000/ants/actions/runs/2680721264,https://github.com/panjf2000/ants/actions/runs/2680721264,2022-07-16T05:03:38.000+00:00,2022-07-16T05:04:51.000+00:00,1,2022-07-16T05:03:38.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2680721264/jo
 [...]
+1,134018330,2722539966,CodeQL,WFR_kwLOB_z1Gs6iRqm-,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,150,schedule,completed,success,5904664,7487244521,CS_kwDOB_z1Gs8AAAABvkZI6Q,https://api.github.com/repos/panjf2000/ants/actions/runs/2722539966,https://github.com/panjf2000/ants/actions/runs/2722539966,2022-07-23T05:04:59.000+00:00,2022-07-23T05:05:58.000+00:00,1,2022-07-23T05:04:59.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2722539966/jo
 [...]
+1,134018330,2764660507,CodeQL,WFR_kwLOB_z1Gs6kyV8b,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,151,schedule,completed,success,5904664,7589122087,CS_kwDOB_z1Gs8AAAABxFjQJw,https://api.github.com/repos/panjf2000/ants/actions/runs/2764660507,https://github.com/panjf2000/ants/actions/runs/2764660507,2022-07-30T05:06:06.000+00:00,2022-07-30T05:07:04.000+00:00,1,2022-07-30T05:06:06.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2764660507/jo
 [...]
+1,134018330,2807709308,CodeQL,WFR_kwLOB_z1Gs6nWj58,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,154,schedule,completed,success,5904664,7693176674,CS_kwDOB_z1Gs8AAAAByoyPYg,https://api.github.com/repos/panjf2000/ants/actions/runs/2807709308,https://github.com/panjf2000/ants/actions/runs/2807709308,2022-08-06T05:02:43.000+00:00,2022-08-06T05:03:58.000+00:00,1,2022-08-06T05:02:43.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2807709308/jo
 [...]
+1,134018330,2850801364,CodeQL,WFR_kwLOB_z1Gs6p68bU,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,155,schedule,completed,success,5904664,7797647541,CS_kwDOB_z1Gs8AAAAB0MaotQ,https://api.github.com/repos/panjf2000/ants/actions/runs/2850801364,https://github.com/panjf2000/ants/actions/runs/2850801364,2022-08-13T05:02:51.000+00:00,2022-08-13T05:03:45.000+00:00,1,2022-08-13T05:02:51.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2850801364/jo
 [...]
+1,134018330,2893573709,CodeQL,WFR_kwLOB_z1Gs6seG5N,master,32664cb1408f8d9ffa7236335025a4cd94a306ce,.github/workflows/codeql.yml,156,schedule,completed,success,5904664,7899725937,CS_kwDOB_z1Gs8AAAAB1txAcQ,https://api.github.com/repos/panjf2000/ants/actions/runs/2893573709,https://github.com/panjf2000/ants/actions/runs/2893573709,2022-08-20T05:04:53.000+00:00,2022-08-20T05:06:10.000+00:00,1,2022-08-20T05:04:53.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2893573709/jo
 [...]
+1,134018330,2938072864,CodeQL,WFR_kwLOB_z1Gs6vH28g,master,06e6934c35c336b1a2bd3005fb21dc3914a45747,.github/workflows/codeql.yml,157,schedule,completed,success,5904664,8009261503,CS_kwDOB_z1Gs8AAAAB3WOhvw,https://api.github.com/repos/panjf2000/ants/actions/runs/2938072864,https://github.com/panjf2000/ants/actions/runs/2938072864,2022-08-27T05:13:50.000+00:00,2022-08-27T05:15:06.000+00:00,1,2022-08-27T05:13:50.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2938072864/jo
 [...]
+1,134018330,2983238245,CodeQL,WFR_kwLOB_z1Gs6x0Jpl,master,06e6934c35c336b1a2bd3005fb21dc3914a45747,.github/workflows/codeql.yml,158,schedule,completed,success,5904664,8117851893,CS_kwDOB_z1Gs8AAAAB49yW9Q,https://api.github.com/repos/panjf2000/ants/actions/runs/2983238245,https://github.com/panjf2000/ants/actions/runs/2983238245,2022-09-03T05:15:09.000+00:00,2022-09-03T05:16:16.000+00:00,1,2022-09-03T05:15:09.000+00:00,https://api.github.com/repos/panjf2000/ants/actions/runs/2983238245/jo
 [...]
diff --git a/backend/plugins/github/e2e/snapshot_tables/cicd_tasks.csv 
b/backend/plugins/github/e2e/snapshot_tables/cicd_tasks.csv
index 3727283eb..240fa6863 100644
--- a/backend/plugins/github/e2e/snapshot_tables/cicd_tasks.csv
+++ b/backend/plugins/github/e2e/snapshot_tables/cicd_tasks.csv
@@ -1,18 +1,18 @@
 
id,name,pipeline_id,result,status,type,environment,duration_sec,started_date,finished_date,cicd_scope_id
-github:GithubJob:1:577324554:1924918171,deployubuntu,github:GithubRun:1:134018330:577324554,,DONE,DEPLOYMENT,,125,2021-02-18T06:59:13.000+00:00,2021-02-18T07:01:18.000+00:00,github:GithubRepo:1:134018330
-github:GithubJob:1:577324554:1924918191,deploymacos,github:GithubRun:1:134018330:577324554,,DONE,DEPLOYMENT,,117,2021-02-18T06:59:21.000+00:00,2021-02-18T07:01:18.000+00:00,github:GithubRepo:1:134018330
+github:GithubJob:1:577324554:1924918171,deployubuntu,github:GithubRun:1:134018330:577324554,,DONE,,,125,2021-02-18T06:59:13.000+00:00,2021-02-18T07:01:18.000+00:00,github:GithubRepo:1:134018330
+github:GithubJob:1:577324554:1924918191,deploymacos,github:GithubRun:1:134018330:577324554,,DONE,,,117,2021-02-18T06:59:21.000+00:00,2021-02-18T07:01:18.000+00:00,github:GithubRepo:1:134018330
 
github:GithubJob:1:577324554:1924918205,deploywindows,github:GithubRun:1:134018330:577324554,,DONE,DEPLOYMENT,PRODUCTION,114,2021-02-18T06:59:15.000+00:00,2021-02-18T07:01:09.000+00:00,github:GithubRepo:1:134018330
-github:GithubJob:1:577324554:1924918228,deployubuntu,github:GithubRun:1:134018330:577324554,,DONE,DEPLOYMENT,,125,2021-02-18T06:59:13.000+00:00,2021-02-18T07:01:18.000+00:00,github:GithubRepo:1:134018330
-github:GithubJob:1:577324554:1924918243,deploymacos,github:GithubRun:1:134018330:577324554,,DONE,DEPLOYMENT,,119,2021-02-18T06:59:19.000+00:00,2021-02-18T07:01:18.000+00:00,github:GithubRepo:1:134018330
+github:GithubJob:1:577324554:1924918228,deployubuntu,github:GithubRun:1:134018330:577324554,,DONE,,,125,2021-02-18T06:59:13.000+00:00,2021-02-18T07:01:18.000+00:00,github:GithubRepo:1:134018330
+github:GithubJob:1:577324554:1924918243,deploymacos,github:GithubRun:1:134018330:577324554,,DONE,,,119,2021-02-18T06:59:19.000+00:00,2021-02-18T07:01:18.000+00:00,github:GithubRepo:1:134018330
 
github:GithubJob:1:577324554:1924918261,deploywindows,github:GithubRun:1:134018330:577324554,,DONE,DEPLOYMENT,PRODUCTION,114,2021-02-18T06:59:15.000+00:00,2021-02-18T07:01:09.000+00:00,github:GithubRepo:1:134018330
 
github:GithubJob:1:577324558:1924918168,Golangci-Lint,github:GithubRun:1:134018330:577324558,SUCCESS,DONE,,,20,2021-02-18T06:59:13.000+00:00,2021-02-18T06:59:33.000+00:00,github:GithubRepo:1:134018330
 
github:GithubJob:1:577324571:1924918319,Analyze,github:GithubRun:1:134018330:577324571,SUCCESS,DONE,,,61,2021-02-18T06:59:16.000+00:00,2021-02-18T07:00:17.000+00:00,github:GithubRepo:1:134018330
 
github:GithubJob:1:577330055:1924932184,Analyze,github:GithubRun:1:134018330:577330055,SUCCESS,DONE,,,54,2021-02-18T07:02:02.000+00:00,2021-02-18T07:02:56.000+00:00,github:GithubRepo:1:134018330
-github:GithubJob:1:577330056:1924932219,deployubuntu,github:GithubRun:1:134018330:577330056,SUCCESS,DONE,DEPLOYMENT,,180,2021-02-18T07:02:03.000+00:00,2021-02-18T07:05:03.000+00:00,github:GithubRepo:1:134018330
-github:GithubJob:1:577330056:1924932237,deploymacos,github:GithubRun:1:134018330:577330056,,IN_PROGRESS,DEPLOYMENT,,0,2021-02-18T07:02:06.000+00:00,2021-02-18T07:04:44.000+00:00,github:GithubRepo:1:134018330
+github:GithubJob:1:577330056:1924932219,deployubuntu,github:GithubRun:1:134018330:577330056,SUCCESS,DONE,,,180,2021-02-18T07:02:03.000+00:00,2021-02-18T07:05:03.000+00:00,github:GithubRepo:1:134018330
+github:GithubJob:1:577330056:1924932237,deploymacos,github:GithubRun:1:134018330:577330056,,IN_PROGRESS,,,0,2021-02-18T07:02:06.000+00:00,2021-02-18T07:04:44.000+00:00,github:GithubRepo:1:134018330
 
github:GithubJob:1:577330056:1924932251,deploywindows,github:GithubRun:1:134018330:577330056,,IN_PROGRESS,DEPLOYMENT,PRODUCTION,0,2021-02-18T07:02:03.000+00:00,2021-02-18T07:05:57.000+00:00,github:GithubRepo:1:134018330
-github:GithubJob:1:577330056:1924932266,deployubuntu,github:GithubRun:1:134018330:577330056,SUCCESS,DONE,DEPLOYMENT,,161,2021-02-18T07:02:03.000+00:00,2021-02-18T07:04:44.000+00:00,github:GithubRepo:1:134018330
-github:GithubJob:1:577330056:1924932293,deploymacos,github:GithubRun:1:134018330:577330056,SUCCESS,DONE,DEPLOYMENT,,158,2021-02-18T07:02:06.000+00:00,2021-02-18T07:04:44.000+00:00,github:GithubRepo:1:134018330
+github:GithubJob:1:577330056:1924932266,deployubuntu,github:GithubRun:1:134018330:577330056,SUCCESS,DONE,,,161,2021-02-18T07:02:03.000+00:00,2021-02-18T07:04:44.000+00:00,github:GithubRepo:1:134018330
+github:GithubJob:1:577330056:1924932293,deploymacos,github:GithubRun:1:134018330:577330056,SUCCESS,DONE,,,158,2021-02-18T07:02:06.000+00:00,2021-02-18T07:04:44.000+00:00,github:GithubRepo:1:134018330
 
github:GithubJob:1:577330056:1924932319,deploywindows,github:GithubRun:1:134018330:577330056,SUCCESS,DONE,DEPLOYMENT,PRODUCTION,230,2021-02-18T07:02:03.000+00:00,2021-02-18T07:05:53.000+00:00,github:GithubRepo:1:134018330
 
github:GithubJob:1:577330057:1924932263,Golangci-Lint,github:GithubRun:1:134018330:577330057,FAILURE,DONE,,,14,2021-02-18T07:02:05.000+00:00,2021-02-18T07:02:19.000+00:00,github:GithubRepo:1:134018330
 
github:GithubJob:1:583528173:1940449839,Analyze,github:GithubRun:1:134018330:583528173,SUCCESS,DONE,,,55,2021-02-20T05:10:17.000+00:00,2021-02-20T05:11:12.000+00:00,github:GithubRepo:1:134018330
diff --git a/backend/plugins/github/github.go b/backend/plugins/github/github.go
index 947d303fb..ef6169da5 100644
--- a/backend/plugins/github/github.go
+++ b/backend/plugins/github/github.go
@@ -46,7 +46,8 @@ func main() {
        issueTypeBug := cmd.Flags().String("issueTypeBug", 
"^(bug|failure|error)$", "issue type bug")
        issueTypeIncident := cmd.Flags().String("issueTypeIncident", "", "issue 
type incident")
        issueTypeRequirement := cmd.Flags().String("issueTypeRequirement", 
"^(feat|feature|proposal|requirement)$", "issue type requirement")
-       deploymentPattern := cmd.Flags().String("deploymentPattern", 
"(?i)deploy", "deploy tag name")
+       deploymentPattern := cmd.Flags().StringP("deployment", "", "", 
"deployment pattern")
+       productionPattern := cmd.Flags().StringP("production", "", "", 
"production pattern")
 
        cmd.Run = func(cmd *cobra.Command, args []string) {
                runner.DirectRun(cmd, args, PluginEntry, map[string]interface{}{
@@ -65,6 +66,7 @@ func main() {
                                "issueTypeIncident":    *issueTypeIncident,
                                "issueTypeRequirement": *issueTypeRequirement,
                                "deploymentPattern":    *deploymentPattern,
+                               "productionPattern":    *productionPattern,
                        },
                })
        }
diff --git a/backend/plugins/github/impl/impl.go 
b/backend/plugins/github/impl/impl.go
index d438632f2..3fa51360c 100644
--- a/backend/plugins/github/impl/impl.go
+++ b/backend/plugins/github/impl/impl.go
@@ -19,6 +19,7 @@ package impl
 
 import (
        "fmt"
+       "github.com/apache/incubator-devlake/core/models/domainlayer/devops"
        "time"
 
        "github.com/apache/incubator-devlake/core/context"
@@ -165,9 +166,18 @@ func (p Github) PrepareTaskData(taskCtx 
plugin.TaskContext, options map[string]i
                return nil, err
        }
 
+       regexEnricher := helper.NewRegexEnricher()
+       if err = regexEnricher.TryAdd(devops.DEPLOYMENT, op.DeploymentPattern); 
err != nil {
+               return nil, errors.BadInput.Wrap(err, "invalid value for 
`deploymentPattern`")
+       }
+       if err = regexEnricher.TryAdd(devops.PRODUCTION, op.ProductionPattern); 
err != nil {
+               return nil, errors.BadInput.Wrap(err, "invalid value for 
`productionPattern`")
+       }
+
        taskData := &tasks.GithubTaskData{
-               Options:   op,
-               ApiClient: apiClient,
+               Options:       op,
+               ApiClient:     apiClient,
+               RegexEnricher: regexEnricher,
        }
 
        if op.TimeAfter != "" {
diff --git a/backend/plugins/github/models/job.go 
b/backend/plugins/github/models/job.go
index f59900b31..bc4f72960 100644
--- a/backend/plugins/github/models/job.go
+++ b/backend/plugins/github/models/job.go
@@ -47,6 +47,7 @@ type GithubJob struct {
        RunnerName    string         `json:"runner_name" 
gorm:"type:varchar(255)"`
        RunnerGroupID int            `json:"runner_group_id"`
        Type          string         `json:"type" gorm:"type:varchar(255)"`
+       Environment   string         `gorm:"type:varchar(255)"`
 }
 
 func (GithubJob) TableName() string {
diff --git 
a/backend/plugins/github/models/migrationscripts/20230418_add_env_to_run_and_job.go
 
b/backend/plugins/github/models/migrationscripts/20230418_add_env_to_run_and_job.go
new file mode 100644
index 000000000..19488e351
--- /dev/null
+++ 
b/backend/plugins/github/models/migrationscripts/20230418_add_env_to_run_and_job.go
@@ -0,0 +1,54 @@
+/*
+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 migrationscripts
+
+import (
+       "github.com/apache/incubator-devlake/core/context"
+       "github.com/apache/incubator-devlake/core/errors"
+       "github.com/apache/incubator-devlake/helpers/migrationhelper"
+)
+
+type addEnvToRunAndJob struct{}
+
+type run20230418 struct {
+       Environment string `gorm:"type:varchar(255)"`
+}
+
+func (run20230418) TableName() string {
+       return "_tool_github_runs"
+}
+
+type runJob20230418 struct {
+       Environment string `gorm:"type:varchar(255)"`
+}
+
+func (runJob20230418) TableName() string {
+       return "_tool_github_jobs"
+}
+
+func (u *addEnvToRunAndJob) Up(baseRes context.BasicRes) errors.Error {
+       return migrationhelper.AutoMigrateTables(baseRes, &run20230418{}, 
&runJob20230418{})
+}
+
+func (*addEnvToRunAndJob) Version() uint64 {
+       return 20230322150357
+}
+
+func (*addEnvToRunAndJob) Name() string {
+       return "add type/env to github runs and run_jobs"
+}
diff --git a/backend/plugins/github/models/migrationscripts/register.go 
b/backend/plugins/github/models/migrationscripts/register.go
index 85a1859e7..642a85536 100644
--- a/backend/plugins/github/models/migrationscripts/register.go
+++ b/backend/plugins/github/models/migrationscripts/register.go
@@ -35,5 +35,6 @@ func All() []plugin.MigrationScript {
                new(concatOwnerAndName),
                new(addStdTypeToIssue221230),
                new(addConnectionIdToTransformationRule),
+               new(addEnvToRunAndJob),
        }
 }
diff --git a/backend/plugins/github/models/run.go 
b/backend/plugins/github/models/run.go
index 2c2a6bc9a..38abaf9cd 100644
--- a/backend/plugins/github/models/run.go
+++ b/backend/plugins/github/models/run.go
@@ -53,6 +53,7 @@ type GithubRun struct {
        RerunURL         string     `json:"rerun_url" gorm:"type:varchar(255)"`
        WorkflowURL      string     `json:"workflow_url" 
gorm:"type:varchar(255)"`
        Type             string     `json:"type" gorm:"type:varchar(255)"`
+       Environment      string     `gorm:"type:varchar(255)"`
 }
 
 func (GithubRun) TableName() string {
diff --git a/backend/plugins/github/tasks/cicd_job_convertor.go 
b/backend/plugins/github/tasks/cicd_job_convertor.go
index 1e0262e38..b59ae50da 100644
--- a/backend/plugins/github/tasks/cicd_job_convertor.go
+++ b/backend/plugins/github/tasks/cicd_job_convertor.go
@@ -46,10 +46,6 @@ func ConvertJobs(taskCtx plugin.SubTaskContext) (err 
errors.Error) {
        db := taskCtx.GetDal()
        data := taskCtx.GetData().(*GithubTaskData)
        repoId := data.Options.GithubId
-       deploymentPattern := data.Options.DeploymentPattern
-       productionPattern := data.Options.ProductionPattern
-       regexEnricher := api.NewRegexEnricher()
-       err = regexEnricher.AddRegexp(deploymentPattern, productionPattern)
        if err != nil {
                return err
        }
@@ -87,9 +83,9 @@ func ConvertJobs(taskCtx plugin.SubTaskContext) (err 
errors.Error) {
                                FinishedDate: line.CompletedAt,
                                PipelineId:   
runIdGen.Generate(data.Options.ConnectionId, line.RepoId, line.RunID),
                                CicdScopeId:  
repoIdGen.Generate(data.Options.ConnectionId, line.RepoId),
+                               Type:         line.Type,
+                               Environment:  line.Environment,
                        }
-                       domainJob.Type = 
regexEnricher.GetEnrichResult(deploymentPattern, line.Name, devops.DEPLOYMENT)
-                       domainJob.Environment = 
regexEnricher.GetEnrichResult(productionPattern, line.Name, devops.PRODUCTION)
 
                        if strings.Contains(line.Conclusion, "SUCCESS") {
                                domainJob.Result = devops.SUCCESS
diff --git a/backend/plugins/github/tasks/cicd_job_extractor.go 
b/backend/plugins/github/tasks/cicd_job_extractor.go
index b574761b7..41ab90ca0 100644
--- a/backend/plugins/github/tasks/cicd_job_extractor.go
+++ b/backend/plugins/github/tasks/cicd_job_extractor.go
@@ -20,6 +20,7 @@ package tasks
 import (
        "encoding/json"
        "github.com/apache/incubator-devlake/core/errors"
+       "github.com/apache/incubator-devlake/core/models/domainlayer/devops"
        "github.com/apache/incubator-devlake/core/plugin"
        "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
        "github.com/apache/incubator-devlake/plugins/github/models"
@@ -76,8 +77,8 @@ func ExtractJobs(taskCtx plugin.SubTaskContext) errors.Error {
                                RunnerID:      githubJob.RunID,
                                RunnerName:    githubJob.RunnerName,
                                RunnerGroupID: githubJob.RunnerGroupID,
-                               // TODO
-                               //Type: "CI/CD",
+                               Type:          
data.RegexEnricher.ReturnNameIfMatched(devops.DEPLOYMENT, githubJob.Name),
+                               Environment:   
data.RegexEnricher.ReturnNameIfMatched(devops.PRODUCTION, githubJob.Name),
                        }
                        results = append(results, githubJobResult)
                        return results, nil
diff --git a/backend/plugins/github/tasks/cicd_run_convertor.go 
b/backend/plugins/github/tasks/cicd_run_convertor.go
index b67e75eff..a6d7e7efa 100644
--- a/backend/plugins/github/tasks/cicd_run_convertor.go
+++ b/backend/plugins/github/tasks/cicd_run_convertor.go
@@ -82,6 +82,8 @@ func ConvertRuns(taskCtx plugin.SubTaskContext) errors.Error {
                                CreatedDate:  *line.GithubCreatedAt,
                                FinishedDate: line.GithubUpdatedAt,
                                CicdScopeId:  
repoIdGen.Generate(data.Options.ConnectionId, line.RepoId),
+                               Type:         line.Type,
+                               Environment:  line.Environment,
                        }
                        if strings.Contains(line.Conclusion, "success") {
                                domainPipeline.Result = devops.SUCCESS
diff --git a/backend/plugins/github/tasks/cicd_run_extractor.go 
b/backend/plugins/github/tasks/cicd_run_extractor.go
index 8e823f313..2283e9b2f 100644
--- a/backend/plugins/github/tasks/cicd_run_extractor.go
+++ b/backend/plugins/github/tasks/cicd_run_extractor.go
@@ -20,6 +20,7 @@ package tasks
 import (
        "encoding/json"
        "github.com/apache/incubator-devlake/core/errors"
+       "github.com/apache/incubator-devlake/core/models/domainlayer/devops"
        "github.com/apache/incubator-devlake/core/plugin"
        "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
        "github.com/apache/incubator-devlake/plugins/github/models"
@@ -83,8 +84,8 @@ func ExtractRuns(taskCtx plugin.SubTaskContext) errors.Error {
                                CancelURL:        githubRun.CancelURL,
                                RerunURL:         githubRun.RerunURL,
                                WorkflowURL:      githubRun.WorkflowURL,
-                               // TODO
-                               //Type: "CI/CD",
+                               Type:             
data.RegexEnricher.ReturnNameIfMatched(devops.DEPLOYMENT, githubRun.Name),
+                               Environment:      
data.RegexEnricher.ReturnNameIfMatched(devops.PRODUCTION, githubRun.Name),
                        }
                        results = append(results, githubRunResult)
                        return results, nil
diff --git a/backend/plugins/github/tasks/task_data.go 
b/backend/plugins/github/tasks/task_data.go
index 419cf91c4..ec0b367e2 100644
--- a/backend/plugins/github/tasks/task_data.go
+++ b/backend/plugins/github/tasks/task_data.go
@@ -45,6 +45,7 @@ type GithubTaskData struct {
        ApiClient     *helper.ApiAsyncClient
        GraphqlClient *helper.GraphqlAsyncClient
        TimeAfter     *time.Time
+       RegexEnricher *helper.RegexEnricher
 }
 
 type GithubApiParams struct {

Reply via email to