Documentation
¶
Index ¶
- Variables
- type Bot
- type BotStatus
- type BuildComponent
- type BuildProgress
- type BuildSummary
- type Builder
- type BuilderGroup
- type BuilderRef
- type CIService
- type Choices
- type Commit
- type CommitBuild
- type ComponentType
- type Console
- type FrontPage
- type Interval
- type Link
- type LinkSet
- type Logo
- type LogoBanner
- type LogoBase
- type MachinePool
- type MiloBuild
- type Navigation
- type Property
- type PropertyGroup
- type Settings
- type SourceStamp
- type Verbosity
Constants ¶
This section is empty.
Variables ¶
var ( Windows = LogoBase{ Img: "windows.svg", Alt: "Microsoft Windows", } OSX = LogoBase{ Img: "apple.svg", Alt: "Apple OSX", } Ubuntu = LogoBase{ Img: "ubuntu.svg", Alt: "Canonical Ubuntu", } // These are devices. IOS = LogoBase{ Img: "ios_device.png", Alt: "Apple iOS", } Android = LogoBase{ Img: "android_device.png", Alt: "Google Android", } ChromeOS = LogoBase{ Img: "cros_device.png", Alt: "Google ChromeOS", } )
Define our known base logos
Functions ¶
This section is empty.
Types ¶
type BuildComponent ¶
type BuildComponent struct {
// The parent of this component. For buildbot and swarmbucket builds, this
// refers to the builder. For DM, this refers to whatever triggered the Quest.
ParentLabel *Link `json:",omitempty"`
// The main label for the component.
Label string
// Status of the build.
Status model.Status
// Banner is a banner of logos that define the OS and devices this
// component is associated with.
Banner *LogoBanner `json:",omitempty"`
// Bot is the machine or execution instance that this component ran on.
Bot *Link `json:",omitempty"`
// Recipe is a link to the recipe this component is based on.
Recipe *Link `json:",omitempty"`
// Source is a link to the external (buildbot, swarming, dm, etc) data
// source that this component relates to.
Source *Link `json:",omitempty"`
// Links to show adjacent to the main label.
MainLink LinkSet `json:",omitempty"`
// Links to show right below the main label. Top-level slice are rows of
// links, second level shows up as
SubLink []LinkSet `json:",omitempty"`
// Designates the progress of the current component. Set null for no progress.
Progress *BuildProgress `json:",omitempty"`
// When did this step start.
Started time.Time
// When did this step finish.
Finished time.Time
// The time it took for this step to finish. If unfinished, this is the
// current elapsed duration.
Duration time.Duration
// The type of component. This manifests itself as a little label on the
// top left corner of the component.
// This is either "RECIPE" or "STEP". An attempt is considered a recipe.
Type ComponentType
// Specifies if this is a top level or a dependency. Manifests itself as an
// indentation level. Valid options are 0 and 1. Anything more than 1 is
// automatically truncated to 1.
LevelsDeep uint32
// Verbosity indicates how important this step is.
Verbosity Verbosity
// Arbitrary text to display below links. One line per entry,
// newlines are stripped.
Text []string
}
BuildComponent represents a single Step, subsetup, attempt, or recipe.
type BuildProgress ¶
type BuildProgress struct {
// contains filtered or unexported fields
}
BuildProgress is a way to show progress. Percent should always be specified.
type BuildSummary ¶
type BuildSummary struct {
// Link to the build.
Link *Link
// Status of the build.
Status model.Status
// Pending is time interval that this build was pending.
PendingTime Interval
// Execution is time interval that this build was executing.
ExecutionTime Interval
// Revision is the main revision of the build.
// TODO(hinoka): Maybe use a commit object instead?
Revision string
// Arbitrary text to display below links. One line per entry,
// newlines are stripped.
Text []string
// Blame is for tracking whose change the build belongs to, if any.
Blame []*Commit
// Build is a reference to the full underlying MiloBuild, if it's available.
// The only reason this would be calculated is if populating the BuildSummary
// requires fetching the entire build anyways. This is assumed to not
// be available.
Build *MiloBuild
}
BuildSummary is a summary of a build, with just enough information for display on a builders page, with an optional field to return the whole build information if available.
type Builder ¶
type Builder struct {
// Name of the builder
Name string
// Warning text, if any.
Warning string
CurrentBuilds []*BuildSummary
PendingBuilds []*BuildSummary
// PendingBuildNum is the number of pending builds, since the slice above
// may be a snapshot instead of the full set.
PendingBuildNum int
FinishedBuilds []*BuildSummary
// MachinePool is primarily used by buildbot builders to list the set of
// machines that can run in a builder. It has no meaning in buildbucket or dm
// and is expected to be nil.
MachinePool *MachinePool
// PrevCursor is a cursor to the previous page.
PrevCursor string `json:",omitempty"`
// NextCursor is a cursor to the next page.
NextCursor string `json:",omitempty"`
}
Builder denotes an ordered list of MiloBuilds
type BuilderGroup ¶
type BuilderGroup struct {
// Name is the name of the group.
Name string
// Builders is a list of links to the builder page for that builder.
Builders []Link
}
BuilderGroup is a container to describe a named cluster of builders. This takes on other names in each CI services: Buildbot: Master Buildbucket: Bucket Dungeon Master: Bucket
type BuilderRef ¶
type BuilderRef struct {
// Name is the canonical reference to a specific builder.
Name string
// Category is a pipe "|" deliminated list of short strings used to catagorize
// and organize builders. Adjacent builders with common categories will be
// merged on the header.
Category []string
// ShortName is a string of length 1-3 used to label the builder.
ShortName string
}
BuilderRef is an unambiguous reference to a builder, along with metadata on how to lay it out for rendering.
type CIService ¶
type CIService struct {
// Name is the display name of the service, which could be "Buildbot",
// "SwarmBucket", or "Dungeon Master"
Name string
// Host points to the specific instance of this CI Service.
Host *Link
// BuilderGroups lists all of the known named groups of builders within this service.
BuilderGroups []BuilderGroup
}
CIService is a backing service for a Continuous Integration system, such as "buildbot", "swarmbucket", or "dm".
type Choices ¶
type Choices struct {
// A list of all possible choices.
Choices []string
// The selected choice.
Selected string
}
Choices - A dropdown menu showing all possible choices.
type Commit ¶
type Commit struct {
// Who made the commit?
AuthorName string
// Email of the committer.
AuthorEmail string
// Time of the commit.
CommitTime time.Time
// Full URL of the main source repository.
Repo string
// Branch of the repo.
Branch string
// Requested revision of the commit or base commit.
RequestRevision *Link
// Revision of the commit or base commit.
Revision *Link
// The commit message.
Description string
// Rietveld or Gerrit URL if the commit is a patch.
Changelist *Link
// Browsable URL of the commit.
CommitURL string
// List of changed filenames.
File []string
}
Commit represents a single commit to a repository, rendered as part of a blamelist.
type CommitBuild ¶
type CommitBuild struct {
Commit
Build []*model.BuildSummary
}
CommitBuild is a row in the console. References a commit with a list of build summaries.
type ComponentType ¶
type ComponentType int
ComponentType is the type of build component.
const ( // Recipe corresponds to a full recipe run. Dependencies are recipes. Recipe ComponentType = iota // Step is a single step of a recipe. Step // Summary denotes that this does not pretain to any particular step. Summary )
func (ComponentType) MarshalJSON ¶
func (c ComponentType) MarshalJSON() ([]byte, error)
MarshalJSON renders enums into String rather than an int when marshalling.
func (ComponentType) String ¶
func (i ComponentType) String() string
type Console ¶
type Console struct {
Name string
Commit []CommitBuild
BuilderRef []BuilderRef
}
Console represents a console view. Commit contains the full matrix of Commits x Builder, and BuilderRef contains information on how to render the header. The two structs are expected to be consistent. IE len(Console.[]BuilderRef) Should equal len(commit.Build) for all commit in Console.Commit.
type FrontPage ¶
type FrontPage struct {
// CIServices is a backing service for a Continuous Integration system,
// such as "buildbot", "swarmbucket", or "dm".
CIServices []CIService
}
type Interval ¶
type Interval struct {
Started time.Time // when did this interval start
Finished time.Time // when did this interval finish
Duration time.Duration // length of the interval; may be non-zero if Finished is zero
}
Interval is a time interval which has a start, an end and a duration.
type Link ¶
type Link struct {
model.Link
// An icon for the link. Not compatible with label. Rendered as <img>
Img string `json:",omitempty"`
// Alt text for the image, only supported with img.
Alt string `json:",omitempty"`
// Alias, if true, means that this link is an [alias link].
Alias bool `json:",omitempty"`
}
Link denotes a single labeled link.
JSON tags here are for test expectations.
type LinkSet ¶
type LinkSet []*Link
LinkSet is an ordered collection of Link objects that will be rendered on the same line.
type Logo ¶
type LogoBanner ¶
LogoBanner is a banner of logos that define the OS and devices that a component is associated with.
type MachinePool ¶
MachinePool represents the capacity and availability of a builder.
type MiloBuild ¶
type MiloBuild struct {
// Summary is a top level summary of the page.
Summary BuildComponent
// SourceStamp gives information about how the build came about.
SourceStamp *SourceStamp
// Components is a detailed list of components and subcomponents of the page.
// This is most often used for steps (buildbot/luci) or deps (luci).
Components []*BuildComponent
// PropertyGroup is a list of input and output property of this page.
// This is used for build and emitted properties (buildbot) and quest
// information (luci). This is also grouped by the "type" of property
// so different categories of properties can be separated and sorted.
//
// This is not a map so code that constructs MiloBuild can control the
// order of property groups, for example show important properties
// first.
PropertyGroup []*PropertyGroup
// Blame is a list of people and commits that is likely to be in relation to
// the thing displayed on this page.
Blame []*Commit
}
MiloBuild denotes a full renderable Milo build page.
type Navigation ¶
Navigation is the top bar of the page, used for navigating out of the page.
type Property ¶
Property specifies k/v pair representing some sort of property, such as buildbot property, quest property, etc.
type PropertyGroup ¶
PropertyGroup is a cluster of similar properties. In buildbot land this would be the "source". This is a way to segregate different types of properties such as Quest properties, swarming properties, emitted properties, revision properties, etc.
func (PropertyGroup) Len ¶
func (p PropertyGroup) Len() int
func (PropertyGroup) Less ¶
func (p PropertyGroup) Less(i, j int) bool
func (PropertyGroup) Swap ¶
func (p PropertyGroup) Swap(i, j int)
type Settings ¶
type Settings struct {
// Where the form should go.
ActionURL string
// Themes is a list of usable themes for Milo
Theme *Choices
}
Settings denotes a full renderable Milo settings page.
type SourceStamp ¶
type SourceStamp struct {
Commit
// Source is the trigger source. In buildbot, this would be the "Reason".
// This has no meaning in SwarmBucket and DM yet.
Source string
}
SourceStamp is the combination of pointing to a single commit, with information about where that commit came from (eg. the repository).
Source Files
¶
- botstatus_string.go
- build.go
- builder.go
- componenttype_string.go
- console.go
- logo.go
- overview.go
- settings.go
- verbosity_string.go