| 52 | } |
| 53 | |
| 54 | func (status CIStatus) ConvertToCheckStatus() CheckStatus { |
| 55 | if status == CIStatusPending || status == CIStatusWaitingOnDeps { |
| 56 | return CheckStatusPending |
| 57 | } |
| 58 | if status == CIStatusSuccess || status == CIStatusSkipped { |
| 59 | return CheckStatusSuccess |
| 60 | } |
| 61 | if status == CIStatusFailure { |
| 62 | return CheckStatusFailure |
| 63 | } |
| 64 | if status == CIStatusRunning { |
| 65 | return CheckStatusRunning |
| 66 | } |
| 67 | return CheckStatusError |
| 68 | } |
| 69 | |
| 70 | // ParseCIStatus converts the status from a string to typed enum. |
| 71 | // If the match is not exact, will just return default error status |