-
Notifications
You must be signed in to change notification settings - Fork 0
/
release_log.go
39 lines (32 loc) · 1.28 KB
/
release_log.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package contracts
import "time"
// ReleaseLog represents a release log for a specific release
type ReleaseLog struct {
ID string `json:"id,omitempty"`
RepoSource string `json:"repoSource"`
RepoOwner string `json:"repoOwner"`
RepoName string `json:"repoName"`
ReleaseID string `json:"releaseID"`
Steps []*BuildLogStep `json:"steps"`
InsertedAt time.Time `json:"insertedAt"`
}
// GetAggregatedStatus returns the status aggregated across all stages
func (releaseLog *ReleaseLog) GetAggregatedStatus() LogStatus {
return GetAggregatedStatus(releaseLog.Steps)
}
// HasUnknownStatus returns true if aggregated status is unknown
func (releaseLog *ReleaseLog) HasUnknownStatus() bool {
return HasUnknownStatus(releaseLog.Steps)
}
// HasSucceededStatus returns true if aggregated status is succeeded
func (releaseLog *ReleaseLog) HasSucceededStatus() bool {
return HasSucceededStatus(releaseLog.Steps)
}
// HasFailedStatus returns true if aggregated status is failed
func (releaseLog *ReleaseLog) HasFailedStatus() bool {
return HasFailedStatus(releaseLog.Steps)
}
// HasCanceledStatus returns true if aggregated status is canceled
func (releaseLog *ReleaseLog) HasCanceledStatus() bool {
return HasSucceededStatus(releaseLog.Steps)
}