mirror of
https://github.com/harness/drone.git
synced 2025-05-05 23:42:57 +00:00
fix: [CODE-1944]: add failure ignored flag for check (#3647)
* fix: [CODE-1944]: add failure ignored flag for check * fix: [CODE-1944]: add failure ignored flag for check * fix: [CODE-1944]: add failure ignored flag for check
This commit is contained in:
parent
6662ddb5b3
commit
a4616af1fb
@ -280,7 +280,7 @@ func (v *DefPullReq) MergeVerify(
|
|||||||
var succeeded bool
|
var succeeded bool
|
||||||
for i := range in.CheckResults {
|
for i := range in.CheckResults {
|
||||||
if in.CheckResults[i].Identifier == requiredIdentifier {
|
if in.CheckResults[i].Identifier == requiredIdentifier {
|
||||||
succeeded = in.CheckResults[i].Status == enum.CheckStatusSuccess
|
succeeded = in.CheckResults[i].Status.IsSuccess()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ const (
|
|||||||
CheckStatusSuccess CheckStatus = "success"
|
CheckStatusSuccess CheckStatus = "success"
|
||||||
CheckStatusFailure CheckStatus = "failure"
|
CheckStatusFailure CheckStatus = "failure"
|
||||||
CheckStatusError CheckStatus = "error"
|
CheckStatusError CheckStatus = "error"
|
||||||
|
CheckStatusFailureIgnored CheckStatus = "failure_ignored"
|
||||||
)
|
)
|
||||||
|
|
||||||
var checkStatuses = sortEnum([]CheckStatus{
|
var checkStatuses = sortEnum([]CheckStatus{
|
||||||
@ -38,9 +39,13 @@ var checkStatuses = sortEnum([]CheckStatus{
|
|||||||
CheckStatusSuccess,
|
CheckStatusSuccess,
|
||||||
CheckStatusFailure,
|
CheckStatusFailure,
|
||||||
CheckStatusError,
|
CheckStatusError,
|
||||||
|
CheckStatusFailureIgnored,
|
||||||
})
|
})
|
||||||
|
|
||||||
var terminalCheckStatuses = []CheckStatus{CheckStatusFailure, CheckStatusSuccess, CheckStatusError}
|
var terminalCheckStatuses = []CheckStatus{CheckStatusFailure, CheckStatusSuccess, CheckStatusError,
|
||||||
|
CheckStatusFailureIgnored}
|
||||||
|
|
||||||
|
var successCheckStatuses = []CheckStatus{CheckStatusSuccess, CheckStatusFailureIgnored}
|
||||||
|
|
||||||
// CheckPayloadKind defines status payload type.
|
// CheckPayloadKind defines status payload type.
|
||||||
type CheckPayloadKind string
|
type CheckPayloadKind string
|
||||||
@ -71,3 +76,7 @@ var checkPayloadTypes = sortEnum([]CheckPayloadKind{
|
|||||||
func (s CheckStatus) IsCompleted() bool {
|
func (s CheckStatus) IsCompleted() bool {
|
||||||
return slices.Contains(terminalCheckStatuses, s)
|
return slices.Contains(terminalCheckStatuses, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s CheckStatus) IsSuccess() bool {
|
||||||
|
return slices.Contains(successCheckStatuses, s)
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user