Skip to content

Commit 7dce648

Browse files
author
Kostas Petrakis
committed
chore(cicd): add extra statuses
- Extend to other SVN providers - Fix failing e2e
1 parent 4729e77 commit 7dce648

File tree

15 files changed

+40
-31
lines changed

15 files changed

+40
-31
lines changed

backend/plugins/azuredevops_go/e2e/snapshot_tables/cicd_pipelines.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ azuredevops_go:AzuredevopsBuild:1:14,label_regex_test,SUCCESS,DONE,completed,suc
55
azuredevops_go:AzuredevopsBuild:1:15,label_regex_test_pro,SUCCESS,DONE,completed,succeeded,,31,,,2023-02-25T06:22:21.224+00:00,2023-02-25T06:22:21.224+00:00,2023-02-25T06:22:32.810+00:00,2023-02-25T06:23:04.006+00:00,azuredevops_go:AzuredevopsRepo:1:0d50ba13-f9ad-49b0-9b21-d29eda50ca33
66
azuredevops_go:AzuredevopsBuild:1:16,label_regex_test_pro,"",IN_PROGRESS,inProgress,"",,0,,,2023-02-25T06:22:21.224+00:00,2023-02-25T06:22:21.224+00:00,2023-02-25T06:22:32.810+00:00,"",azuredevops_go:AzuredevopsRepo:1:0d50ba13-f9ad-49b0-9b21-d29eda50ca33
77
azuredevops_go:AzuredevopsBuild:1:17,label_regex_test_pro,"",IN_PROGRESS,notStarted,"",,0,,,2023-02-25T06:22:21.224+00:00,"","","",azuredevops_go:AzuredevopsRepo:1:0d50ba13-f9ad-49b0-9b21-d29eda50ca33
8-
azuredevops_go:AzuredevopsBuild:1:18,label_regex_test_pro,FAILURE,DONE,completed,canceled,,5,,,2023-02-25T06:22:21.224+00:00,2023-02-25T06:22:21.224+00:00,2023-02-25T06:22:25.224+00:00,2023-02-25T06:22:30.224+00:00,azuredevops_go:AzuredevopsRepo:1:0d50ba13-f9ad-49b0-9b21-d29eda50ca33
8+
azuredevops_go:AzuredevopsBuild:1:18,label_regex_test_pro,CANCELED,DONE,completed,canceled,,5,,,2023-02-25T06:22:21.224+00:00,2023-02-25T06:22:21.224+00:00,2023-02-25T06:22:25.224+00:00,2023-02-25T06:22:30.224+00:00,azuredevops_go:AzuredevopsRepo:1:0d50ba13-f9ad-49b0-9b21-d29eda50ca33

backend/plugins/azuredevops_go/tasks/shared.go

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ package tasks
2020
import (
2121
"encoding/json"
2222
"fmt"
23+
"net/http"
24+
"net/url"
25+
2326
"github.com/apache/incubator-devlake/core/errors"
2427
"github.com/apache/incubator-devlake/core/models/domainlayer/devops"
2528
"github.com/apache/incubator-devlake/core/plugin"
2629
"github.com/apache/incubator-devlake/helpers/pluginhelper/api"
27-
"net/http"
28-
"net/url"
2930
)
3031

3132
// Build and TimeLine Record State and Result types can be found here:
@@ -109,25 +110,28 @@ func ExtractContToken(_ *api.RequestData, prevPageResponse *http.Response) (inte
109110
}
110111

111112
var cicdBuildResultRule = devops.ResultRule{
112-
Success: []string{succeeded},
113-
Failure: []string{canceled, failed, none, partiallySucceeded},
114-
Default: devops.RESULT_DEFAULT,
113+
Success: []string{succeeded},
114+
Failure: []string{failed, none, partiallySucceeded},
115+
Canceled: []string{canceled},
116+
Default: devops.RESULT_DEFAULT,
115117
}
116118

117119
var cicdBuildStatusRule = devops.StatusRule{
118-
Done: []string{completed, cancelling},
120+
Done: []string{completed, cancelling, canceled},
119121
InProgress: []string{inProgress, notStarted, postponed},
120122
Default: devops.STATUS_OTHER,
121123
}
122124

123125
var cicdTaskResultRule = &devops.ResultRule{
124-
Success: []string{succeeded, succeededWithIssues},
125-
Failure: []string{abandoned, canceled, failed, skipped},
126-
Default: devops.RESULT_DEFAULT,
126+
Success: []string{succeeded, succeededWithIssues},
127+
Failure: []string{failed},
128+
Canceled: []string{abandoned, canceled},
129+
Skipped: []string{skipped},
130+
Default: devops.RESULT_DEFAULT,
127131
}
128132

129133
var cicdTaskStatusRule = &devops.StatusRule{
130-
Done: []string{completed},
134+
Done: []string{completed, abandoned, canceled, skipped},
131135
InProgress: []string{pending, inProgress},
132136
Default: devops.STATUS_OTHER,
133137
}

backend/plugins/bamboo/e2e/snapshot_tables/cicd_deployment_commits.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ id,commit_sha,cicd_scope_id,cicd_deployment_id,name,display_title,url,result,sta
22
bamboo:deployBuildWithVcsRevision:1:130001:622595,79b062bd53af15c701193c90b543386557cb7a3a,bamboo:BambooPlan:1:TEST-PLA2,bamboo:deployBuildWithVcsRevision:1:130001:622595,test_project2 - test_plan/release-1,test_project2 - test_plan/release-1,,SUCCESS,DONE,FINISHED,SUCCESS,dev,dev,0,,,,622595,fake://127.0.0.1:8080/repos/622595,,
33
bamboo:deployBuildWithVcsRevision:1:130002:622595,79b062bd53af15c701193c90b543386557cb7a3a,bamboo:BambooPlan:1:TEST-PLA2,bamboo:deployBuildWithVcsRevision:1:130002:622595,test_project2 - test_plan/release-1,test_project2 - test_plan/release-1,,FAILURE,IN_PROGRESS,IN_PROGRESS,FAILED,dev,dev,0,,,,622595,fake://127.0.0.1:8080/repos/622595,,
44
bamboo:deployBuildWithVcsRevision:1:130003:622595,79b062bd53af15c701193c90b543386557cb7a3a,bamboo:BambooPlan:1:TEST-PLA2,bamboo:deployBuildWithVcsRevision:1:130003:622595,test_project2 - test_plan/release-1,test_project2 - test_plan/release-1,,,IN_PROGRESS,PENDING,REPLACED,dev,dev,0,,,,622595,fake://127.0.0.1:8080/repos/622595,,
5-
bamboo:deployBuildWithVcsRevision:1:130004:622595,79b062bd53af15c701193c90b543386557cb7a3a,bamboo:BambooPlan:1:TEST-PLA2,bamboo:deployBuildWithVcsRevision:1:130004:622595,test_project2 - test_plan/release-1,test_project2 - test_plan/release-1,,,IN_PROGRESS,QUEUED,SKIPPED,dev,dev,0,,,,622595,fake://127.0.0.1:8080/repos/622595,,
5+
bamboo:deployBuildWithVcsRevision:1:130004:622595,79b062bd53af15c701193c90b543386557cb7a3a,bamboo:BambooPlan:1:TEST-PLA2,bamboo:deployBuildWithVcsRevision:1:130004:622595,test_project2 - test_plan/release-1,test_project2 - test_plan/release-1,,SKIPPED,IN_PROGRESS,QUEUED,SKIPPED,dev,dev,0,,,,622595,fake://127.0.0.1:8080/repos/622595,,
66
bamboo:deployBuildWithVcsRevision:1:130005:622595,79b062bd53af15c701193c90b543386557cb7a3a,bamboo:BambooPlan:1:TEST-PLA2,bamboo:deployBuildWithVcsRevision:1:130005:622595,test_project2 - test_plan/release-1,test_project2 - test_plan/release-1,,,OTHER,NOT_BUILT,NEVER,dev,dev,0,,,,622595,fake://127.0.0.1:8080/repos/622595,,
77
bamboo:deployBuildWithVcsRevision:1:130006:622595,79b062bd53af15c701193c90b543386557cb7a3a,bamboo:BambooPlan:1:TEST-PLA2,bamboo:deployBuildWithVcsRevision:1:130006:622595,test_project2 - test_plan/release-1,test_project2 - test_plan/release-1,,,OTHER,NOT_BUILT,QUEUED,dev,dev,0,,,,622595,fake://127.0.0.1:8080/repos/622595,,
88
bamboo:deployBuildWithVcsRevision:1:130007:622595,79b062bd53af15c701193c90b543386557cb7a3a,bamboo:BambooPlan:1:TEST-PLA2,bamboo:deployBuildWithVcsRevision:1:130007:622595,test_project2 - test_plan/release-1,test_project2 - test_plan/release-1,,,OTHER,NOT_BUILT,IN PROGRESS,dev,dev,0,,,,622595,fake://127.0.0.1:8080/repos/622595,,

backend/plugins/bamboo/e2e/snapshot_tables/cicd_deployments.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ id,commit_sha,cicd_scope_id,cicd_deployment_id,name,display_title,url,result,sta
22
bamboo:deployBuildWithVcsRevision:1:130001:622595,79b062bd53af15c701193c90b543386557cb7a3a,bamboo:BambooPlan:1:TEST-PLA2,bamboo:deployBuildWithVcsRevision:1:130001:622595,test_project2 - test_plan/release-1,test_project2 - test_plan/release-1,,SUCCESS,DONE,FINISHED,SUCCESS,dev,dev,0,,,,622595,fake://127.0.0.1:8080/repos/622595,,
33
bamboo:deployBuildWithVcsRevision:1:130002:622595,79b062bd53af15c701193c90b543386557cb7a3a,bamboo:BambooPlan:1:TEST-PLA2,bamboo:deployBuildWithVcsRevision:1:130002:622595,test_project2 - test_plan/release-1,test_project2 - test_plan/release-1,,FAILURE,IN_PROGRESS,IN_PROGRESS,FAILED,dev,dev,0,,,,622595,fake://127.0.0.1:8080/repos/622595,,
44
bamboo:deployBuildWithVcsRevision:1:130003:622595,79b062bd53af15c701193c90b543386557cb7a3a,bamboo:BambooPlan:1:TEST-PLA2,bamboo:deployBuildWithVcsRevision:1:130003:622595,test_project2 - test_plan/release-1,test_project2 - test_plan/release-1,,,IN_PROGRESS,PENDING,REPLACED,dev,dev,0,,,,622595,fake://127.0.0.1:8080/repos/622595,,
5-
bamboo:deployBuildWithVcsRevision:1:130004:622595,79b062bd53af15c701193c90b543386557cb7a3a,bamboo:BambooPlan:1:TEST-PLA2,bamboo:deployBuildWithVcsRevision:1:130004:622595,test_project2 - test_plan/release-1,test_project2 - test_plan/release-1,,,IN_PROGRESS,QUEUED,SKIPPED,dev,dev,0,,,,622595,fake://127.0.0.1:8080/repos/622595,,
5+
bamboo:deployBuildWithVcsRevision:1:130004:622595,79b062bd53af15c701193c90b543386557cb7a3a,bamboo:BambooPlan:1:TEST-PLA2,bamboo:deployBuildWithVcsRevision:1:130004:622595,test_project2 - test_plan/release-1,test_project2 - test_plan/release-1,,SKIPPED,IN_PROGRESS,QUEUED,SKIPPED,dev,dev,0,,,,622595,fake://127.0.0.1:8080/repos/622595,,
66
bamboo:deployBuildWithVcsRevision:1:130005:622595,79b062bd53af15c701193c90b543386557cb7a3a,bamboo:BambooPlan:1:TEST-PLA2,bamboo:deployBuildWithVcsRevision:1:130005:622595,test_project2 - test_plan/release-1,test_project2 - test_plan/release-1,,,OTHER,NOT_BUILT,NEVER,dev,dev,0,,,,622595,fake://127.0.0.1:8080/repos/622595,,
77
bamboo:deployBuildWithVcsRevision:1:130006:622595,79b062bd53af15c701193c90b543386557cb7a3a,bamboo:BambooPlan:1:TEST-PLA2,bamboo:deployBuildWithVcsRevision:1:130006:622595,test_project2 - test_plan/release-1,test_project2 - test_plan/release-1,,,OTHER,NOT_BUILT,QUEUED,dev,dev,0,,,,622595,fake://127.0.0.1:8080/repos/622595,,
88
bamboo:deployBuildWithVcsRevision:1:130007:622595,79b062bd53af15c701193c90b543386557cb7a3a,bamboo:BambooPlan:1:TEST-PLA2,bamboo:deployBuildWithVcsRevision:1:130007:622595,test_project2 - test_plan/release-1,test_project2 - test_plan/release-1,,,OTHER,NOT_BUILT,IN PROGRESS,dev,dev,0,,,,622595,fake://127.0.0.1:8080/repos/622595,,

backend/plugins/bamboo/tasks/deploy_build_to_deployment_commit_convertor.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,12 @@ func ConvertDeployBuildsToDeploymentCommits(taskCtx plugin.SubTaskContext) error
124124
Result: devops.GetResult(&devops.ResultRule{
125125
Success: []string{ResultSuccess, ResultSuccessful},
126126
Failure: []string{ResultFailed},
127+
Skipped: []string{ResultSkipped},
127128
Default: devops.RESULT_DEFAULT,
128129
}, input.DeploymentState),
129130
OriginalResult: input.DeploymentState,
130131
Status: devops.GetStatus(&devops.StatusRule{
131-
Done: []string{StatusFinished},
132+
Done: []string{StatusFinished, ResultSkipped},
132133
InProgress: []string{StatusInProgress, StatusPending, StatusQueued},
133134
Default: devops.STATUS_OTHER,
134135
}, input.LifeCycleState),

backend/plugins/bamboo/tasks/deploy_build_to_deployment_convertor.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ func ConvertDeployBuildsToDeployments(taskCtx plugin.SubTaskContext) errors.Erro
8686
Result: devops.GetResult(&devops.ResultRule{
8787
Success: []string{ResultSuccess, ResultSuccessful},
8888
Failure: []string{ResultFailed},
89+
Skipped: []string{ResultSkipped},
8990
Default: devops.RESULT_DEFAULT,
9091
}, input.DeploymentState),
9192
OriginalResult: input.DeploymentState,
9293
Status: devops.GetStatus(&devops.StatusRule{
93-
Done: []string{StatusFinished},
94+
Done: []string{StatusFinished, ResultSkipped},
9495
InProgress: []string{StatusInProgress, StatusPending, StatusQueued},
9596
Default: devops.STATUS_OTHER,
9697
}, input.LifeCycleState),

backend/plugins/bamboo/tasks/job_build_convertor.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,12 @@ func ConvertJobBuilds(taskCtx plugin.SubTaskContext) errors.Error {
8484
Result: devops.GetResult(&devops.ResultRule{
8585
Success: []string{ResultSuccess, ResultSuccessful},
8686
Failure: []string{ResultFailed},
87+
Skipped: []string{ResultSkipped},
8788
Default: devops.RESULT_DEFAULT,
8889
}, line.BuildState),
8990
OriginalResult: line.BuildState,
9091
Status: devops.GetStatus(&devops.StatusRule{
91-
Done: []string{StatusFinished},
92+
Done: []string{StatusFinished, ResultSkipped},
9293
InProgress: []string{StatusInProgress, StatusPending, StatusQueued},
9394
Default: devops.STATUS_OTHER,
9495
}, line.LifeCycleState),

backend/plugins/bamboo/tasks/plan_build_convertor.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,12 @@ func ConvertPlanBuilds(taskCtx plugin.SubTaskContext) errors.Error {
8080
Result: devops.GetResult(&devops.ResultRule{
8181
Success: []string{ResultSuccess, ResultSuccessful},
8282
Failure: []string{ResultFailed},
83+
Skipped: []string{ResultSkipped},
8384
Default: devops.RESULT_DEFAULT,
8485
}, line.BuildState),
8586
OriginalResult: line.BuildState,
8687
Status: devops.GetStatus(&devops.StatusRule{
87-
Done: []string{StatusFinished},
88+
Done: []string{StatusFinished, ResultSkipped},
8889
InProgress: []string{StatusInProgress, StatusPending, StatusQueued},
8990
Default: devops.STATUS_OTHER,
9091
}, line.LifeCycleState),

backend/plugins/bitbucket/e2e/snapshot_tables/cicd_deployment_commits_for_deployment.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4101},83ed48081
99
bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4102},83ed48081d1fad9dbd60948cfe9661f67aac2694,#7,SUCCESS,DONE,,SUCCESSFUL,PRODUCTION,#7,https://bitbucket.org/likyh/likyhphp/addon/pipelines/home#!/results/7
1010
bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4103},83ed48081d1fad9dbd60948cfe9661f67aac2694,#7,FAILURE,DONE,,FAILED,PRODUCTION,#7,https://bitbucket.org/likyh/likyhphp/addon/pipelines/home#!/results/7
1111
bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4104},83ed48081d1fad9dbd60948cfe9661f67aac2694,#7,FAILURE,DONE,,STOPPED,PRODUCTION,#7,https://bitbucket.org/likyh/likyhphp/addon/pipelines/home#!/results/7
12-
bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4105},83ed48081d1fad9dbd60948cfe9661f67aac2694,#7,FAILURE,DONE,,CANCELLED,PRODUCTION,#7,https://bitbucket.org/likyh/likyhphp/addon/pipelines/home#!/results/7
12+
bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4105},83ed48081d1fad9dbd60948cfe9661f67aac2694,#7,CANCELED,DONE,,CANCELLED,PRODUCTION,#7,https://bitbucket.org/likyh/likyhphp/addon/pipelines/home#!/results/7
1313
bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4106},83ed48081d1fad9dbd60948cfe9661f67aac2694,#7,,IN_PROGRESS,,IN_PROGRESS,PRODUCTION,#7,https://bitbucket.org/likyh/likyhphp/addon/pipelines/home#!/results/7
1414
bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4107},83ed48081d1fad9dbd60948cfe9661f67aac2694,#7,,OTHER,,UNDEPLOYED,PRODUCTION,#7,https://bitbucket.org/likyh/likyhphp/addon/pipelines/home#!/results/7
1515
bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4108},83ed48081d1fad9dbd60948cfe9661f67aac2694,#7,,OTHER,,PENDING,PRODUCTION,#7,https://bitbucket.org/likyh/likyhphp/addon/pipelines/home#!/results/7

backend/plugins/bitbucket/e2e/snapshot_tables/cicd_deployments_for_deployment.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4101},#7,SUCCES
99
bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4102},#7,SUCCESS,DONE,,SUCCESSFUL,PRODUCTION,PRODUCTION,#7,https://bitbucket.org/likyh/likyhphp/addon/pipelines/home#!/results/7
1010
bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4103},#7,FAILURE,DONE,,FAILED,PRODUCTION,PRODUCTION,#7,https://bitbucket.org/likyh/likyhphp/addon/pipelines/home#!/results/7
1111
bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4104},#7,FAILURE,DONE,,STOPPED,PRODUCTION,PRODUCTION,#7,https://bitbucket.org/likyh/likyhphp/addon/pipelines/home#!/results/7
12-
bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4105},#7,FAILURE,DONE,,CANCELLED,PRODUCTION,PRODUCTION,#7,https://bitbucket.org/likyh/likyhphp/addon/pipelines/home#!/results/7
12+
bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4105},#7,CANCELED,DONE,,CANCELLED,PRODUCTION,PRODUCTION,#7,https://bitbucket.org/likyh/likyhphp/addon/pipelines/home#!/results/7
1313
bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4106},#7,,IN_PROGRESS,,IN_PROGRESS,PRODUCTION,PRODUCTION,#7,https://bitbucket.org/likyh/likyhphp/addon/pipelines/home#!/results/7
1414
bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4107},#7,,OTHER,,UNDEPLOYED,PRODUCTION,PRODUCTION,#7,https://bitbucket.org/likyh/likyhphp/addon/pipelines/home#!/results/7
1515
bitbucket:BitbucketDeployment:1:{5c6b00c4-a848-5db6-b9e1-3912631d4108},#7,,OTHER,,PENDING,PRODUCTION,PRODUCTION,#7,https://bitbucket.org/likyh/likyhphp/addon/pipelines/home#!/results/7

0 commit comments

Comments
 (0)