This is an automated email from the ASF dual-hosted git repository.
abeizn pushed a commit to branch enrich-status-e2e
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/enrich-status-e2e by this push:
new 273fc0090 fix: github add deployment e2e test
273fc0090 is described below
commit 273fc00909c3cd12b431a5822ad7746b80d3be80
Author: abeizn <[email protected]>
AuthorDate: Wed Nov 8 16:00:59 2023 +0800
fix: github add deployment e2e test
---
.../models/domainlayer/devops/cicd_pipeline.go | 12 ++--
backend/plugins/github/e2e/deployment_test.go | 64 ++++++++++++++++++++++
.../e2e/raw_tables/_tool_github_deployments.csv | 12 ++++
.../snapshot_tables/cicd_deployment_commits.csv | 12 ++++
.../e2e/snapshot_tables/cicd_deployments.csv | 12 ++++
.../plugins/github/tasks/deployment_convertor.go | 5 +-
backend/plugins/github/tasks/shared.go | 7 ++-
7 files changed, 112 insertions(+), 12 deletions(-)
diff --git a/backend/core/models/domainlayer/devops/cicd_pipeline.go
b/backend/core/models/domainlayer/devops/cicd_pipeline.go
index 6379c6a50..e89ca228e 100644
--- a/backend/core/models/domainlayer/devops/cicd_pipeline.go
+++ b/backend/core/models/domainlayer/devops/cicd_pipeline.go
@@ -18,10 +18,11 @@ limitations under the License.
package devops
import (
- "github.com/spf13/cast"
"strings"
"time"
+ "github.com/spf13/cast"
+
"github.com/apache/incubator-devlake/core/models/domainlayer"
)
@@ -90,17 +91,14 @@ func GetResult(rule *ResultRule, input interface{}) string {
}
// GetStatus compare the input with rule for return the enum value of status
-func GetStatus(rule *StatusRule, input string) string {
- if rule.Default == "" {
- rule.Default = STATUS_OTHER
- }
+func GetStatus(rule *StatusRule, input interface{}) string {
for _, inProgress := range rule.InProgress {
- if strings.EqualFold(inProgress, input) {
+ if strings.EqualFold(inProgress, cast.ToString(input)) {
return STATUS_IN_PROGRESS
}
}
for _, done := range rule.Done {
- if strings.EqualFold(done, input) {
+ if strings.EqualFold(done, cast.ToString(input)) {
return STATUS_DONE
}
}
diff --git a/backend/plugins/github/e2e/deployment_test.go
b/backend/plugins/github/e2e/deployment_test.go
new file mode 100644
index 000000000..c180358bc
--- /dev/null
+++ b/backend/plugins/github/e2e/deployment_test.go
@@ -0,0 +1,64 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package e2e
+
+import (
+ "testing"
+
+ "github.com/apache/incubator-devlake/core/models/common"
+ helper "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
+
+ "github.com/apache/incubator-devlake/core/models/domainlayer/devops"
+ "github.com/apache/incubator-devlake/helpers/e2ehelper"
+ "github.com/apache/incubator-devlake/plugins/github/impl"
+ "github.com/apache/incubator-devlake/plugins/github/models"
+ "github.com/apache/incubator-devlake/plugins/github/tasks"
+)
+
+func TestGithubDeploymentDataFlow(t *testing.T) {
+ var github impl.Github
+ dataflowTester := e2ehelper.NewDataFlowTester(t, "github", github)
+ regexEnricher := helper.NewRegexEnricher()
+ _ = regexEnricher.TryAdd(devops.DEPLOYMENT, "github-pages")
+ taskData := &tasks.GithubTaskData{
+ Options: &tasks.GithubOptions{
+ ConnectionId: 1,
+ Name: "panjf2000/ants",
+ GithubId: 134018330,
+ },
+ RegexEnricher: regexEnricher,
+ }
+
+ // import raw/tool data table
+
dataflowTester.ImportCsvIntoTabler("./raw_tables/_tool_github_deployments.csv",
&models.GithubDeployment{})
+
dataflowTester.ImportCsvIntoTabler("./raw_tables/_tool_github_repos.csv",
&models.GithubRepo{})
+
+ // verify convertor
+ dataflowTester.FlushTabler(&devops.CicdDeploymentCommit{})
+ dataflowTester.FlushTabler(&devops.CICDDeployment{})
+ dataflowTester.Subtask(tasks.ConvertDeploymentsMeta, taskData)
+ dataflowTester.VerifyTableWithOptions(&devops.CicdDeploymentCommit{},
e2ehelper.TableOptions{
+ CSVRelPath: "./snapshot_tables/cicd_deployment_commits.csv",
+ IgnoreTypes: []interface{}{common.NoPKModel{}},
+ })
+
+ dataflowTester.VerifyTableWithOptions(&devops.CICDDeployment{},
e2ehelper.TableOptions{
+ CSVRelPath: "./snapshot_tables/cicd_deployments.csv",
+ IgnoreTypes: []interface{}{common.NoPKModel{}},
+ })
+}
diff --git a/backend/plugins/github/e2e/raw_tables/_tool_github_deployments.csv
b/backend/plugins/github/e2e/raw_tables/_tool_github_deployments.csv
new file mode 100644
index 000000000..0b25ab0bf
--- /dev/null
+++ b/backend/plugins/github/e2e/raw_tables/_tool_github_deployments.csv
@@ -0,0 +1,12 @@
+"created_at","updated_at","_raw_data_params","_raw_data_table","_raw_data_id","_raw_data_remark","connection_id","github_id","id","database_id","commit_oid","description","environment","state","latest_status_state","latest_updated_date","repository_id","repository_name","repository_url","ref_name","payload","created_date","updated_date"
+"2023-11-08 06:31:50.995","2023-11-08
06:31:50.995","{""ConnectionId"":1,""Name"":""panjf2000/ants""}","_raw_github_graphql_deployment",2,"",1,"134018330","MDEwOkRlcGxveW1lbnQ0MDE4NjU5N1==",40186596,"c22c398cec3f6a0e75a806c369dc6cc92addf598","","github-pages","SUCCESS","SUCCESS","2017-06-09
23:06:33.000","MDEwOlJlcG9zaXRvcnkxMDI3MDI1MA==","react","https://github.com/panjf2000/ants","","","2017-06-09
23:06:33.000","2017-06-09 23:06:33.000"
+"2023-11-08 06:31:50.995","2023-11-08
06:31:50.995","{""ConnectionId"":1,""Name"":""panjf2000/ants""}","_raw_github_graphql_deployment",2,"",1,"134018330","MDEwOkRlcGxveW1lbnQ0MDU0Mzg3N2==",40543876,"e4a9af594f75c1077f8c0e7ff99b1841f5fcae65","","github-pages","FAILURE","FAILURE","2017-06-13
14:42:26.000","MDEwOlJlcG9zaXRvcnkxMDI3MDI1MA==","react","https://github.com/panjf2000/ants","","","2017-06-13
14:42:26.000","2017-06-13 14:42:26.000"
+"2023-11-08 06:31:50.995","2023-11-08
06:31:50.995","{""ConnectionId"":1,""Name"":""panjf2000/ants""}","_raw_github_graphql_deployment",2,"",1,"134018330","MDEwOkRlcGxveW1lbnQ0MDU2Mjg4M3==",40562881,"dc204718f0e4596b6c13fe3de7cfdeaf3905a50d","","github-pages","ERROR","ERROR","2017-06-13
17:19:10.000","MDEwOlJlcG9zaXRvcnkxMDI3MDI1MA==","react","https://github.com/panjf2000/ants","","","2017-06-13
17:19:09.000","2017-06-13 17:19:09.000"
+"2023-11-08 06:31:50.995","2023-11-08
06:31:50.995","{""ConnectionId"":1,""Name"":""panjf2000/ants""}","_raw_github_graphql_deployment",2,"",1,"134018330","MDEwOkRlcGxveW1lbnQ0MDU5NTY0N4==",40595645,"e7020c61065fb95b591bd06a3f79bf95d505e0d1","","github-pages","IN_PROGRESS","IN_PROGRESS","2017-06-13
23:05:36.000","MDEwOlJlcG9zaXRvcnkxMDI3MDI1MA==","react","https://github.com/panjf2000/ants","","","2017-06-13
23:05:35.000","2017-06-13 23:05:35.000"
+"2023-11-08 06:31:50.995","2023-11-08
06:31:50.995","{""ConnectionId"":1,""Name"":""panjf2000/ants""}","_raw_github_graphql_deployment",2,"",1,"134018330","MDEwOkRlcGxveW1lbnQ0MDcyNjE5N5==",40726197,"f3f308ffaf23b98d2cf0ea34d7065a690a6560da","","github-pages","QUEUED","QUEUED","2017-06-14
23:19:10.000","MDEwOlJlcG9zaXRvcnkxMDI3MDI1MA==","react","https://github.com/panjf2000/ants","","","2017-06-14
23:19:10.000","2017-06-14 23:19:10.000"
+"2023-11-08 06:31:50.995","2023-11-08
06:31:50.995","{""ConnectionId"":1,""Name"":""panjf2000/ants""}","_raw_github_graphql_deployment",2,"",1,"134018330","MDEwOkRlcGxveW1lbnQ0MDgwMzcwN6==",40803707,"b1e6227e675aae6e62b40803f06be690031cb145","","github-pages","PENDING","SUCCESS","2017-06-15
14:56:14.000","MDEwOlJlcG9zaXRvcnkxMDI3MDI1MA==","react","https://github.com/panjf2000/ants","","","2017-06-15
14:56:14.000","2017-06-15 14:56:14.000"
+"2023-11-08 06:31:50.995","2023-11-08
06:31:50.995","{""ConnectionId"":1,""Name"":""panjf2000/ants""}","_raw_github_graphql_deployment",2,"",1,"134018330","MDEwOkRlcGxveW1lbnQ0MjAwMzE5M7==",42003191,"7bc32d9148e612b54c1909ecf56a62a08cb7b0e7","","github-pages","WAITING","SUCCESS","2017-06-26
18:03:49.000","MDEwOlJlcG9zaXRvcnkxMDI3MDI1MA==","react","https://github.com/panjf2000/ants","","","2017-06-26
18:03:49.000","2017-06-26 18:03:49.000"
+"2023-11-08 06:31:50.995","2023-11-08
06:31:50.995","{""ConnectionId"":1,""Name"":""panjf2000/ants""}","_raw_github_graphql_deployment",2,"",1,"134018330","MDEwOkRlcGxveW1lbnQ0MjM3NTU0M8==",42375540,"6941c84de27d8a306510af3a03812b26ec421725","","github-pages","ABANDONED","SUCCESS","2017-06-29
15:13:53.000","MDEwOlJlcG9zaXRvcnkxMDI3MDI1MA==","react","https://github.com/panjf2000/ants","","","2017-06-29
15:13:53.000","2017-06-29 15:13:53.000"
+"2023-11-08 06:31:50.995","2023-11-08
06:31:50.995","{""ConnectionId"":1,""Name"":""panjf2000/ants""}","_raw_github_graphql_deployment",2,"",1,"134018330","MDEwOkRlcGxveW1lbnQ0MzY0MzQ1N9==",43643456,"5f0258bc04265e1f46e5eb7f685d91a0a7075031","","github-pages","ACTIVE","SUCCESS","2017-07-11
13:09:32.000","MDEwOlJlcG9zaXRvcnkxMDI3MDI1MA==","react","https://github.com/panjf2000/ants","","","2017-07-11
13:09:32.000","2017-07-11 13:09:32.000"
+"2023-11-08 06:31:50.995","2023-11-08
06:31:50.995","{""ConnectionId"":1,""Name"":""panjf2000/ants""}","_raw_github_graphql_deployment",2,"",1,"134018330","MDEwOkRlcGxveW1lbnQ0NTQ3OTQ4O0==",45479489,"0be0c9ca727d106f85f126cf8beb10a6843af352","","github-pages","INACTIVE","SUCCESS","2017-07-26
19:43:48.000","MDEwOlJlcG9zaXRvcnkxMDI3MDI1MA==","react","https://github.com/panjf2000/ants","","","2017-07-26
19:43:48.000","2017-07-26 19:43:48.000"
+"2023-11-08 06:31:50.995","2023-11-08
06:31:50.995","{""ConnectionId"":1,""Name"":""panjf2000/ants""}","_raw_github_graphql_deployment",2,"",1,"134018330","MDEwOkRlcGxveW1lbnQ0NTQ4MDI010==",45480247,"8faba4cb2f03fa56ab6671d58f46d44622f36561","","github-pages","DESTROYED","SUCCESS","2017-07-26
19:50:31.000","MDEwOlJlcG9zaXRvcnkxMDI3MDI1MA==","react","https://github.com/panjf2000/ants","","","2017-07-26
19:50:31.000","2017-07-26 19:50:31.000"
\ No newline at end of file
diff --git
a/backend/plugins/github/e2e/snapshot_tables/cicd_deployment_commits.csv
b/backend/plugins/github/e2e/snapshot_tables/cicd_deployment_commits.csv
new file mode 100644
index 000000000..4a971313b
--- /dev/null
+++ b/backend/plugins/github/e2e/snapshot_tables/cicd_deployment_commits.csv
@@ -0,0 +1,12 @@
+id,commit_sha,cicd_scope_id,cicd_deployment_id,name,result,status,environment,created_date,started_date,finished_date,duration_sec,ref_name,repo_id,repo_url,prev_success_deployment_commit_id
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDE4NjU5N1==,c22c398cec3f6a0e75a806c369dc6cc92addf598,github:GithubRepo:1:134018330,github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDE4NjU5N1==,c22c398cec3f6a0e75a806c369dc6cc92addf598,SUCCESS,DONE,github-pages,2017-06-09T15:06:33.000+00:00,2017-06-09T15:06:33.000+00:00,2017-06-09T15:06:33.000+00:00,0,,github:GithubRepo:1:134018330,https://github.com/panjf2000/ants,
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDU0Mzg3N2==,e4a9af594f75c1077f8c0e7ff99b1841f5fcae65,github:GithubRepo:1:134018330,github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDU0Mzg3N2==,e4a9af594f75c1077f8c0e7ff99b1841f5fcae65,FAILURE,DONE,github-pages,2017-06-13T06:42:26.000+00:00,2017-06-13T06:42:26.000+00:00,2017-06-13T06:42:26.000+00:00,0,,github:GithubRepo:1:134018330,https://github.com/panjf2000/ants,
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDU2Mjg4M3==,dc204718f0e4596b6c13fe3de7cfdeaf3905a50d,github:GithubRepo:1:134018330,github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDU2Mjg4M3==,dc204718f0e4596b6c13fe3de7cfdeaf3905a50d,FAILURE,DONE,github-pages,2017-06-13T09:19:09.000+00:00,2017-06-13T09:19:09.000+00:00,2017-06-13T09:19:09.000+00:00,0,,github:GithubRepo:1:134018330,https://github.com/panjf2000/ants,
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDU5NTY0N4==,e7020c61065fb95b591bd06a3f79bf95d505e0d1,github:GithubRepo:1:134018330,github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDU5NTY0N4==,e7020c61065fb95b591bd06a3f79bf95d505e0d1,,IN_PROGRESS,github-pages,2017-06-13T15:05:35.000+00:00,2017-06-13T15:05:35.000+00:00,2017-06-13T15:05:35.000+00:00,0,,github:GithubRepo:1:134018330,https://github.com/panjf2000/ants,
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDcyNjE5N5==,f3f308ffaf23b98d2cf0ea34d7065a690a6560da,github:GithubRepo:1:134018330,github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDcyNjE5N5==,f3f308ffaf23b98d2cf0ea34d7065a690a6560da,,IN_PROGRESS,github-pages,2017-06-14T15:19:10.000+00:00,2017-06-14T15:19:10.000+00:00,2017-06-14T15:19:10.000+00:00,0,,github:GithubRepo:1:134018330,https://github.com/panjf2000/ants,
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDgwMzcwN6==,b1e6227e675aae6e62b40803f06be690031cb145,github:GithubRepo:1:134018330,github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDgwMzcwN6==,b1e6227e675aae6e62b40803f06be690031cb145,,IN_PROGRESS,github-pages,2017-06-15T06:56:14.000+00:00,2017-06-15T06:56:14.000+00:00,2017-06-15T06:56:14.000+00:00,0,,github:GithubRepo:1:134018330,https://github.com/panjf2000/ants,
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MjAwMzE5M7==,7bc32d9148e612b54c1909ecf56a62a08cb7b0e7,github:GithubRepo:1:134018330,github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MjAwMzE5M7==,7bc32d9148e612b54c1909ecf56a62a08cb7b0e7,,IN_PROGRESS,github-pages,2017-06-26T10:03:49.000+00:00,2017-06-26T10:03:49.000+00:00,2017-06-26T10:03:49.000+00:00,0,,github:GithubRepo:1:134018330,https://github.com/panjf2000/ants,
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MjM3NTU0M8==,6941c84de27d8a306510af3a03812b26ec421725,github:GithubRepo:1:134018330,github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MjM3NTU0M8==,6941c84de27d8a306510af3a03812b26ec421725,,OTHER,github-pages,2017-06-29T07:13:53.000+00:00,2017-06-29T07:13:53.000+00:00,2017-06-29T07:13:53.000+00:00,0,,github:GithubRepo:1:134018330,https://github.com/panjf2000/ants,
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MzY0MzQ1N9==,5f0258bc04265e1f46e5eb7f685d91a0a7075031,github:GithubRepo:1:134018330,github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MzY0MzQ1N9==,5f0258bc04265e1f46e5eb7f685d91a0a7075031,,OTHER,github-pages,2017-07-11T05:09:32.000+00:00,2017-07-11T05:09:32.000+00:00,2017-07-11T05:09:32.000+00:00,0,,github:GithubRepo:1:134018330,https://github.com/panjf2000/ants,
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0NTQ3OTQ4O0==,0be0c9ca727d106f85f126cf8beb10a6843af352,github:GithubRepo:1:134018330,github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0NTQ3OTQ4O0==,0be0c9ca727d106f85f126cf8beb10a6843af352,,OTHER,github-pages,2017-07-26T11:43:48.000+00:00,2017-07-26T11:43:48.000+00:00,2017-07-26T11:43:48.000+00:00,0,,github:GithubRepo:1:134018330,https://github.com/panjf2000/ants,
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0NTQ4MDI010==,8faba4cb2f03fa56ab6671d58f46d44622f36561,github:GithubRepo:1:134018330,github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0NTQ4MDI010==,8faba4cb2f03fa56ab6671d58f46d44622f36561,,OTHER,github-pages,2017-07-26T11:50:31.000+00:00,2017-07-26T11:50:31.000+00:00,2017-07-26T11:50:31.000+00:00,0,,github:GithubRepo:1:134018330,https://github.com/panjf2000/ants,
diff --git a/backend/plugins/github/e2e/snapshot_tables/cicd_deployments.csv
b/backend/plugins/github/e2e/snapshot_tables/cicd_deployments.csv
new file mode 100644
index 000000000..300559706
--- /dev/null
+++ b/backend/plugins/github/e2e/snapshot_tables/cicd_deployments.csv
@@ -0,0 +1,12 @@
+id,cicd_scope_id,name,result,status,environment,created_date,started_date,finished_date,duration_sec
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDE4NjU5N1==,github:GithubRepo:1:134018330,c22c398cec3f6a0e75a806c369dc6cc92addf598,SUCCESS,DONE,github-pages,2017-06-09T15:06:33.000+00:00,2017-06-09T15:06:33.000+00:00,2017-06-09T15:06:33.000+00:00,0
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDU0Mzg3N2==,github:GithubRepo:1:134018330,e4a9af594f75c1077f8c0e7ff99b1841f5fcae65,FAILURE,DONE,github-pages,2017-06-13T06:42:26.000+00:00,2017-06-13T06:42:26.000+00:00,2017-06-13T06:42:26.000+00:00,0
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDU2Mjg4M3==,github:GithubRepo:1:134018330,dc204718f0e4596b6c13fe3de7cfdeaf3905a50d,FAILURE,DONE,github-pages,2017-06-13T09:19:09.000+00:00,2017-06-13T09:19:09.000+00:00,2017-06-13T09:19:09.000+00:00,0
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDU5NTY0N4==,github:GithubRepo:1:134018330,e7020c61065fb95b591bd06a3f79bf95d505e0d1,,IN_PROGRESS,github-pages,2017-06-13T15:05:35.000+00:00,2017-06-13T15:05:35.000+00:00,2017-06-13T15:05:35.000+00:00,0
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDcyNjE5N5==,github:GithubRepo:1:134018330,f3f308ffaf23b98d2cf0ea34d7065a690a6560da,,IN_PROGRESS,github-pages,2017-06-14T15:19:10.000+00:00,2017-06-14T15:19:10.000+00:00,2017-06-14T15:19:10.000+00:00,0
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MDgwMzcwN6==,github:GithubRepo:1:134018330,b1e6227e675aae6e62b40803f06be690031cb145,,IN_PROGRESS,github-pages,2017-06-15T06:56:14.000+00:00,2017-06-15T06:56:14.000+00:00,2017-06-15T06:56:14.000+00:00,0
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MjAwMzE5M7==,github:GithubRepo:1:134018330,7bc32d9148e612b54c1909ecf56a62a08cb7b0e7,,IN_PROGRESS,github-pages,2017-06-26T10:03:49.000+00:00,2017-06-26T10:03:49.000+00:00,2017-06-26T10:03:49.000+00:00,0
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MjM3NTU0M8==,github:GithubRepo:1:134018330,6941c84de27d8a306510af3a03812b26ec421725,,OTHER,github-pages,2017-06-29T07:13:53.000+00:00,2017-06-29T07:13:53.000+00:00,2017-06-29T07:13:53.000+00:00,0
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0MzY0MzQ1N9==,github:GithubRepo:1:134018330,5f0258bc04265e1f46e5eb7f685d91a0a7075031,,OTHER,github-pages,2017-07-11T05:09:32.000+00:00,2017-07-11T05:09:32.000+00:00,2017-07-11T05:09:32.000+00:00,0
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0NTQ3OTQ4O0==,github:GithubRepo:1:134018330,0be0c9ca727d106f85f126cf8beb10a6843af352,,OTHER,github-pages,2017-07-26T11:43:48.000+00:00,2017-07-26T11:43:48.000+00:00,2017-07-26T11:43:48.000+00:00,0
+github:GithubDeployment:1:MDEwOkRlcGxveW1lbnQ0NTQ4MDI010==,github:GithubRepo:1:134018330,8faba4cb2f03fa56ab6671d58f46d44622f36561,,OTHER,github-pages,2017-07-26T11:50:31.000+00:00,2017-07-26T11:50:31.000+00:00,2017-07-26T11:50:31.000+00:00,0
diff --git a/backend/plugins/github/tasks/deployment_convertor.go
b/backend/plugins/github/tasks/deployment_convertor.go
index ca425e15a..fa49b913a 100644
--- a/backend/plugins/github/tasks/deployment_convertor.go
+++ b/backend/plugins/github/tasks/deployment_convertor.go
@@ -18,6 +18,8 @@ limitations under the License.
package tasks
import (
+ "reflect"
+
"github.com/apache/incubator-devlake/core/dal"
"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/models/domainlayer"
@@ -26,7 +28,6 @@ import (
"github.com/apache/incubator-devlake/core/plugin"
"github.com/apache/incubator-devlake/helpers/pluginhelper/api"
"github.com/apache/incubator-devlake/plugins/github/models"
- "reflect"
)
func init() {
@@ -41,7 +42,7 @@ var ConvertDeploymentsMeta = plugin.SubTaskMeta{
Name: "ConvertDeployments",
EntryPoint: ConvertDeployment,
EnabledByDefault: true,
- Description: "Convert tool layer table github_deployments into
domain layer table deployment",
+ Description: "Convert tool layer table github_deployments into
domain layer table deployment",
DomainTypes: []string{plugin.DOMAIN_TYPE_CICD},
DependencyTables: []string{models.GithubDeployment{}.TableName()},
ProductTables: []string{devops.CicdDeploymentCommit{}.TableName(),
devops.CICDDeployment{}.TableName()},
diff --git a/backend/plugins/github/tasks/shared.go
b/backend/plugins/github/tasks/shared.go
index 4406155f3..02976c384 100644
--- a/backend/plugins/github/tasks/shared.go
+++ b/backend/plugins/github/tasks/shared.go
@@ -18,12 +18,13 @@ limitations under the License.
package tasks
import (
+ "net/http"
+
"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/plugin"
"github.com/apache/incubator-devlake/helpers/pluginhelper/api"
"github.com/apache/incubator-devlake/plugins/github/models"
"github.com/apache/incubator-devlake/plugins/github/utils"
- "net/http"
)
const (
@@ -37,9 +38,9 @@ const (
StatusCancelled = "CANCELLED"
StatusTimedOut = "TIMED_OUT"
StatusStartUpFailure = "STARTUP_FAILURE"
- StatusInProgress = "IN_PROGRESS "
+ StatusInProgress = "IN_PROGRESS"
StatusQueued = "QUEUED"
- StatusWaiting = "WAITING "
+ StatusWaiting = "WAITING"
StatusPending = "PENDING"
StatusNeutral = "NEUTRAL"
StatusSkipped = "SKIPPED"