Documentation ¶
Overview ¶
Package protocol defines types used in Buildbot build protocol, e.g. build, step, log, etc. The types can used together with encoding/json package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var PropertyNotFound = fmt.Errorf("property not found")
PropertyNotFound is returned by (*Build).PropertyValue if a property is no found.
Functions ¶
This section is empty.
Types ¶
type Build ¶
type Build struct { Master string Blame []string `json:"blame"` // email addresses Buildername string `json:"builderName"` // This needs to be reflected. This can be either a String or a Step. Currentstep interface{} `json:"currentStep"` // We don't care about this one. Eta interface{} `json:"eta"` Logs []Log `json:"logs"` Number int `json:"number"` // This is a slice of tri-tuples of [property name, value, source]. // property name is always a string // value can be a string or float // source is optional, but is always a string if present Properties []*Property `json:"properties"` Reason string `json:"reason"` Results Result `json:"results"` Slave string `json:"slave"` Sourcestamp *SourceStamp `json:"sourceStamp"` Steps []Step `json:"steps"` Text []string `json:"text"` Times TimeRange `json:"times"` // This one is injected by Milo. Does not exist in a normal json query. TimeStamp Time `json:"timeStamp"` // This one is marked by Milo, denotes whether or not the build is internal. Internal bool `json:"internal"` // This one is computed by Milo for indexing purposes. It does so by // checking to see if times[1] is null or not. Finished bool `json:"finished"` // OS is a string representation of the OS the build ran on. This is // derived best-effort from the slave information in the master JSON. // This information is injected into the buildbot builds via puppet, and // comes as Family + Version. Family is (windows, Darwin, Debian), while // Version is the version of the OS, such as (XP, 7, 10) for windows. OSFamily string `json:"osFamily"` OSVersion string `json:"osVersion"` // Emulated indicates that this Buildbot build was emulated from non-Buildbot // e.g. from LUCI. Emulated bool `json:"emulated"` // ViewPath is an absolute path, relative to this milo host, which can be used // to display this Build. This Path includes a leading "/". Callers can turn // this into a URL by: // "https://" + MiloHost + Build.ViewPath ViewPath string `json:"view_path"` }
Build is a single build json on buildbot.
func (*Build) Experimental ¶
Experimental returns true if b is experimental.
func (*Build) PropertyValue ¶
PropertyValue returns the named property value. If such property does not exist, returns PropertyNotFound.
type BuildID ¶
BuildID identifies a buildbot build.
type Builder ¶
type Builder struct { Buildername string `json:"builderName,omitempty"` Basedir string `json:"basedir"` CachedBuilds []int `json:"cachedBuilds"` PendingBuilds int `json:"pendingBuilds"` // This one is specific to the pubsub interface. This is limited to 75, // so it could differ from PendingBuilds PendingBuildStates []*Pending `json:"pendingBuildStates"` Category string `json:"category"` CurrentBuilds []int `json:"currentBuilds"` Slaves []string `json:"slaves"` State string `json:"state"` }
Builder is a builder struct from the master json, _not_ the builder json.
type Change ¶
type Change struct { At string `json:"at"` Branch *string `json:"branch"` Category string `json:"category"` Comments string `json:"comments"` // This could be a list of strings or list of struct { Name string } . Files []interface{} `json:"files"` Number int `json:"number"` Project string `json:"project"` Properties [][]interface{} `json:"properties"` Repository string `json:"repository"` Rev string `json:"rev"` Revision string `json:"revision"` Revlink string `json:"revlink"` When int `json:"when"` Who string `json:"who"` // email address }
Change describes a commit in a repository as part of a changesource of blamelist.
type ChangeSource ¶
type ChangeSource struct {
Description string `json:"description"`
}
ChangeSource is a changesource (ie polling source) usually tied to a master's scheduler.
type Log ¶
type Log struct {
Name, URL string
}
func (*Log) MarshalJSON ¶
func (*Log) UnmarshalJSON ¶
type Master ¶
type Master struct { AcceptingBuilds struct { AcceptingBuilds bool `json:"accepting_builds"` } `json:"accepting_builds"` Builders map[string]*Builder `json:"builders"` Buildstate struct { AcceptingBuilds bool `json:"accepting_builds"` Builders []Builder `json:"builders"` Project Project `json:"project"` Timestamp Time `json:"timestamp"` } `json:"buildstate"` ChangeSources map[string]ChangeSource `json:"change_sources"` Changes map[string]Change `json:"changes"` Clock struct { Current struct { Local string `json:"local"` Utc string `json:"utc"` UtcTs Time `json:"utc_ts"` } `json:"current"` ServerStarted struct { Local string `json:"local"` Utc string `json:"utc"` UtcTs Time `json:"utc_ts"` } `json:"server_started"` ServerUptime Time `json:"server_uptime"` } `json:"clock"` Project Project `json:"project"` Slaves map[string]*Slave `json:"slaves"` Varz struct { AcceptingBuilds bool `json:"accepting_builds"` Builders map[string]struct { ConnectedSlaves int `json:"connected_slaves"` CurrentBuilds int `json:"current_builds"` PendingBuilds int `json:"pending_builds"` State string `json:"state"` TotalSlaves int `json:"total_slaves"` } `json:"builders"` ServerUptime Time `json:"server_uptime"` } `json:"varz"` // This is injected by the pubsub publisher on the buildbot side. Name string `json:"name"` }
Master This is json definition for https://build.chromium.org/p/<master>/json endpoints.
type Pending ¶
type Pending struct { Source SourceStamp `json:"source"` Reason string `json:"reason"` SubmittedAt int `json:"submittedAt"` BuilderName string `json:"builderName"` }
type Slave ¶
type Slave struct { // RecentBuilds is a map of builder name to a list of recent finished build // numbers on that builder. RecentBuilds map[string][]int `json:"builders"` Connected bool `json:"connected"` Host string `json:"host"` Name string `json:"name"` Runningbuilds []*Build `json:"runningBuilds"` Version string `json:"version"` // This is like runningbuilds, but instead of storing the full build, // just reference the build by builder: build num. RunningbuildsMap map[string][]int `json:"runningBuildsMap"` }
Slave describes a slave on a master from a master json, and also includes the full builds of any currently running builds.
type SourceStamp ¶
type SourceStamp struct { Branch *string `json:"branch"` Changes []Change `json:"changes"` Haspatch bool `json:"hasPatch"` Project string `json:"project"` Repository string `json:"repository"` Revision string `json:"revision"` }
SourceStamp is a list of changes (commits) tagged with where the changes came from, ie. the project/repository. Also includes a "main" revision."
type Step ¶
type Step struct { // We actually don't care about ETA. This is represented as a string if // it's fetched from a build json, but a float if it's dug out of the // slave portion of a master json. We'll just set it to interface and // ignore it. Eta interface{} `json:"eta"` Expectations [][]interface{} `json:"expectations"` Hidden bool `json:"hidden"` IsFinished bool `json:"isFinished"` IsStarted bool `json:"isStarted"` Logs []Log `json:"logs"` Name string `json:"name"` Results StepResults `json:"results"` Statistics struct { } `json:"statistics"` StepNumber int `json:"step_number"` Text []string `json:"text"` Times TimeRange `json:"times"` Urls map[string]string `json:"urls"` // Log link aliases. The key is a log name that is being aliases. It should, // generally, exist within the Logs. The value is the set of aliases attached // to that key. Aliases map[string][]*LinkAlias `json:"aliases"` }
Step represents a single step in a buildbot build.
type StepResults ¶
type StepResults struct { Result // contains filtered or unexported fields }
func (*StepResults) MarshalJSON ¶
func (r *StepResults) MarshalJSON() ([]byte, error)
func (*StepResults) UnmarshalJSON ¶
func (r *StepResults) UnmarshalJSON(data []byte) error
type Time ¶
func (*Time) MarshalJSON ¶
MarshalJSON marshals t to JSON at microsecond resolution.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON unmarshals t from JSON at microsecond resolution.
type TimeRange ¶
type TimeRange struct {
Start, Finish Time
}