Documentation ¶
Overview ¶
Package ci defines the internal representation of a continuous integration reports.
Index ¶
Constants ¶
View Source
const ( // Ref defines the git-notes ref that we expect to contain CI reports. Ref = "refs/notes/devtools/ci" // StatusSuccess is the status string representing that a build and/or test passed. StatusSuccess = "success" // StatusFailure is the status string representing that a build and/or test failed. StatusFailure = "failure" // FormatVersion defines the latest version of the request format supported by the tool. FormatVersion = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Report ¶
type Report struct { Timestamp string `json:"timestamp,omitempty"` URL string `json:"url,omitempty"` Status string `json:"status,omitempty"` Agent string `json:"agent,omitempty"` // Version represents the version of the metadata format. Version int `json:"v,omitempty"` }
Report represents a build/test status report generated by a continuous integration tool.
Every field is optional.
func GetLatestCIReport ¶
GetLatestCIReport takes the collection of reports and returns the one with the most recent timestamp.
func Parse ¶
func Parse(note repository.Note) (Report, error)
Parse parses a CI report from a git note.
func ParseAllValid ¶
func ParseAllValid(notes []repository.Note) []Report
ParseAllValid takes collection of git notes and tries to parse a CI report from each one. Any notes that are not valid CI reports get ignored, as we expect the git notes to be a heterogenous list, with only some of them being valid CI status reports.
Click to show internal directories.
Click to hide internal directories.