luci: Index | Files

package ui

import ""


Package Files

build.go build_legacy.go builder.go builder_legacy.go componenttype_string.go console.go frontpage.go logo.go search.go settings.go


const (
    // TreeMaintenance means the tree is under maintenance and is not open.
    // This has a color of purple.
    TreeMaintenance TreeStatusState = "maintenance"
    // TreeThrottled means the tree is backed up, and commits are throttled
    // to allow the tree to catch up.  This has a color of yellow.
    TreeThrottled = "throttled"
    // TreeClosed means the tree is broken, and commits other than reverts
    // or fixes are not accepted at the time.  This has a color of red.
    TreeClosed = "closed"
    // TreeOpen means the tree is not broken, and commits can happen freely.
    // This has a color of green.
    TreeOpen = "open"


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

type Bot Uses

type Bot struct {
    Status model.BotStatus

Bot wraps a model.Bot to provide a UI specific statuses.

func (*Bot) Label Uses

func (b *Bot) Label() *Link

type Build Uses

type Build struct {

    // Now is the current time, used to generate durations that may depend
    // on the current time.
    Now *timestamp.Timestamp `json:"now,omitempty"`

Build wraps a buildbucketpb.Build to provide useful templating functions. It is used in both BuildPage (in this file) and BuilderPage (builder.go).

func (*Build) Banners Uses

func (b *Build) Banners() (result []Logo)

Banners returns names of icons to display next to the build number. Currently displayed: * OS, as determined by swarming dimensions. TODO(hinoka): For device builders, display device type, and number of devices.

func (b *Build) BuildSetLinks() []template.HTML

func (*Build) BuildSets Uses

func (b *Build) BuildSets() []string
func (b *Build) BuilderLink() *Link

BuilderLink returns a link to the builder in b.

func (b *Build) ChangeLinks() []*Link

ChangeLinks returns a slice of links to build input gerrit changes.

func (*Build) CommitLinkHTML Uses

func (b *Build) CommitLinkHTML() template.HTML

CommitLinkHTML returns an HTML link pointing to the output commit, or input commit if the output commit is not available.

func (*Build) HumanStatus Uses

func (b *Build) HumanStatus() string

HumanStatus returns a human friendly string for the status.

func (b *Build) Link() *Link

Link is a self link to the build.

func (*Build) NewBuildPageOptInHTML Uses

func (b *Build) NewBuildPageOptInHTML() template.HTML

NewBuildPageOptInHTML returns a link to the new build page of the build.

func (b *Build) RecipeLink() *Link

func (*Build) ShouldShowCanaryWarning Uses

func (b *Build) ShouldShowCanaryWarning() bool

ShouldShowCanaryWarning returns true for failed canary builds.

func (*Build) Summary Uses

func (b *Build) Summary() (result []string)

Summary returns a summary of failures in the build. TODO(hinoka): Remove after recipe engine emits SummaryMarkdown natively.

type BuildComponent Uses

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 *Link

    // 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"`

    // Pending is time interval that this build was pending.
    PendingTime Interval

    // Execution is time interval that this build was executing.
    ExecutionTime Interval

    // 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

    // Arbitrary text to display below links.  One line per entry,
    // newlines are stripped.
    Text []string

    // Children of the step. Undefined for other types of build components.
    Children []*BuildComponent

    // Render a step as collapsed or expanded. Undefined for other types of build
    // components.
    Collapsed bool

BuildComponent represents a single Step, subsetup, attempt, or recipe.

func (*BuildComponent) TextBR Uses

func (bc *BuildComponent) TextBR() []string

TextBR returns Text, but also splits each line by <br>

type BuildPage Uses

type BuildPage struct {
    // Build is the underlying build proto for the build page.

    // Blame is a list of people and commits that likely caused the build result.
    // It is usually used as the list of commits between the previous run of the
    // build on the same builder, and this run.
    Blame []*Commit `json:"blame,omitempty"`

    // BuildBugLink is a URL to be used a feedback link for the build. If the
    // link could not be generated an empty string will be returned. There will be
    // no link, for example, if the project has not set up their build bug template.
    BuildBugLink string `json:"build_bug_link,omitempty"`

    // BuildbucketHost is the hostname for the buildbucket instance this build came from.
    BuildbucketHost string `json:"buildbucket_host,omitempty"`

    // Errors contains any non-critical errors encountered while rendering the page.
    Errors []error `json:"errors,omitempty"`

    // Mode to render the steps.
    StepDisplayPref StepDisplayPref `json:"step_display_pref,omitempty"`

    // Iff true, show all log links whose name starts with '$'.
    ShowDebugLogsPref bool `json:"show_debug_logs_pref,omitempty"`

    // BlamelistError holds errors related to the blamelist.
    // This determines the behavior of clicking the "blamelist" tab.
    BlamelistError error `json:"blamelist_error,omitempty"`

    // ForcedBlamelist indicates that the user forced a blamelist load.
    ForcedBlamelist bool `json:"forced_blamelist,omitempty"`

    // Whether the user is able to perform certain actions on this build
    CanCancel bool `json:"can_cancel,omitempty"`
    CanRetry  bool `json:"can_retry,omitempty"`
    // contains filtered or unexported fields

BuildPage represents a build page on Milo. The core of the build page is the underlying build proto, but can contain extra information depending on the context, for example a blamelist, and the user's display preferences.

func NewBuildPage Uses

func NewBuildPage(c context.Context, b *buildbucketpb.Build) *BuildPage
func (bp *BuildPage) BuildbucketLink() *Link

BuildbucketLink returns a link to the buildbucket version of the page.

func (*BuildPage) InputProperties Uses

func (bp *BuildPage) InputProperties() []property

func (*BuildPage) OutputProperties Uses

func (bp *BuildPage) OutputProperties() []property

func (*BuildPage) Steps Uses

func (bp *BuildPage) Steps() []*Step

Steps converts the flat Steps from the underlying Build into a tree. The tree is only calculated on the first call, all subsequent calls return cached information. TODO(hinoka): Print nicer error messages instead of panicking for invalid build protos.

func (*BuildPage) Timeline Uses

func (bp *BuildPage) Timeline() string

Timeline returns a JSON parsable string that can be fed into a viz timeline component.

type BuildPageData Uses

type BuildPageData struct {
    CommitLinkHTML          template.HTML   `json:"commit_link_html,omitempty"`
    Summary                 []string        `json:"summary,omitempty"`
    RecipeLink              *Link           `json:"recipe_link,omitempty"`
    BuildbucketLink         *Link           `json:"buildbucket_link,omitempty"`
    BuildSets               []string        `json:"build_sets,omitempty"`
    BuildSetLinks           []template.HTML `json:"build_set_links,omitempty"`
    Steps                   []*Step         `json:"steps,omitempty"`
    HumanStatus             string          `json:"human_status,omitempty"`
    ShouldShowCanaryWarning bool            `json:"should_show_canary_warning,omitempty"`
    InputProperties         []property      `json:"input_properties,omitempty"`
    OutputProperties        []property      `json:"output_properties,omitempty"`
    BuilderLink             *Link           `json:"builder_link,omitempty"`
    Link                    *Link           `json:"link,omitempty"`
    Banners                 []Logo          `json:"banners,omitempty"`
    Timeline                string          `json:"timeline,omitempty"`

BuildPageData represents a build page on Milo. Comparing to BuildPage, it caches a lot of the computed properties so they be serialised to JSON.

type BuildProgress Uses

type BuildProgress struct {
    // contains filtered or unexported fields

BuildProgress is a way to show progress. Percent should always be specified.

type BuildSummaryLegacy Uses

type BuildSummaryLegacy 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.
    Revision *Commit

    // 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

BuildSummaryLegacy is a summary of a build, with just enough information for display on a builder page.

type BuilderGroup Uses

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. In buildbucket CI system, it refers to a Bucket

func (*BuilderGroup) Sort Uses

func (g *BuilderGroup) Sort()

Sort sorts Builders by the lowercase of their name.

type BuilderLegacy Uses

type BuilderLegacy struct {
    // Name of the builder
    Name string

    // Indicates that this Builder should render a blamelist for each build.
    // This is only supported for Buildbot (
    HasBlamelist bool

    // Warning text, if any.
    Warning string

    CurrentBuilds []*BuildSummaryLegacy
    PendingBuilds []*BuildSummaryLegacy
    // PendingBuildNum is the number of pending builds, since the slice above
    // may be a snapshot instead of the full set.
    PendingBuildNum int
    FinishedBuilds  []*BuildSummaryLegacy

    // MachinePool was 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

    // Groups is a list of links to builder groups that contain this builder.
    Groups []*Link

    // PrevCursor is a cursor to the previous page.
    PrevCursor string `json:",omitempty"`
    // NextCursor is a cursor to the next page.
    NextCursor string `json:",omitempty"`

BuilderLegacy denotes an ordered list of MiloBuilds

type BuilderPage Uses

type BuilderPage struct {
    Builder *buildbucketpb.BuilderItem

    ScheduledBuilds         []*Build
    ScheduledBuildsComplete bool
    StartedBuilds           []*Build
    StartedBuildsComplete   bool
    EndedBuilds             []*Build

    MachinePool *MachinePool

    // Views is a list of links to milo views that reference this builder.
    Views []*Link

    // PrevPageToken is a token to the previous page.
    PrevPageToken string
    // NextPageToken is a token to the next page.
    NextPageToken string

func (*BuilderPage) HasChanges Uses

func (bp *BuilderPage) HasChanges() bool

HasChanges returns true if at least one ended build has at least one CL.

type BuilderRef Uses

type BuilderRef struct {
    // ID is the canonical reference to a specific builder.
    ID  string
    // ShortName is a string of length 1-3 used to label the builder.
    ShortName string
    // The most recent build summaries for this builder.
    Build []*model.BuildSummary
    // The most recent builder summary for this builder.
    Builder *model.BuilderSummary

BuilderRef is an unambiguous reference to a builder.

It represents a single column of builds in the console view.

Implements ConsoleElement.

func (*BuilderRef) BuilderName Uses

func (br *BuilderRef) BuilderName() string

BuilderName returns the last component of ID (which is the Builder Name).

func (BuilderRef) NumLeafNodes Uses

func (br BuilderRef) NumLeafNodes() int

NumLeafNodes always returns 1 for BuilderDef since it is a leaf node.

func (BuilderRef) RenderHTML Uses

func (br BuilderRef) RenderHTML(buffer *bytes.Buffer, depth int, maxDepth int)

RenderHTML renders a BuilderRef as HTML with its builds in a column. If maxDepth is negative, render the HTML as flat rather than nested.

type BuilderSummaryGroup Uses

type BuilderSummaryGroup struct {
    // Name is a Link that contains the name of the console as well as a relative URL
    // to the console's page.
    Name *Link

    // Builders contains a list of builders for a given console and some data about
    // the latest state for each builder.
    Builders []*model.BuilderSummary

BuilderSummaryGroup represents the summary of a console, including its name and the latest status of each of its builders.

type CIService Uses

type CIService struct {
    // Name is the display name of the service, which could be "Buildbot",
    // or "SwarmBucket"
    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".

func (*CIService) Sort Uses

func (c *CIService) Sort()

Sort sorts builder groups by their Name.

type Category Uses

type Category struct {
    Name string
    // contains filtered or unexported fields

Category represents an interior node in a category tree for builders.

Implements ConsoleElement.

func NewCategory Uses

func NewCategory(name string) *Category

NewCategory allocates a new Category struct with no children.

func (*Category) AddBuilder Uses

func (c *Category) AddBuilder(categories []string, builder *BuilderRef)

AddBuilder inserts the builder into this Category tree.

AddBuilder will create new subcategories as a chain of Category structs as needed until there are no categories remaining. The builder is then made a child of the deepest such Category.

func (*Category) Children Uses

func (c *Category) Children() []ConsoleElement

Children returns a list of child console elements.

func (*Category) NumLeafNodes Uses

func (c *Category) NumLeafNodes() int

NumLeafNodes calculates the number of leaf nodes in Category.

func (Category) RenderHTML Uses

func (c Category) RenderHTML(buffer *bytes.Buffer, depth int, maxDepth int)

RenderHTML renders the Category struct and its children as HTML into a buffer. If maxDepth is negative, skip the labels to render the HTML as flat rather than nested.

type Choices Uses

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 Uses

type Commit struct {
    // Who made the commit?
    AuthorName string `json:"author_name,omitempty"`
    // Email of the committer.
    AuthorEmail string `json:"author_email,omitempty"`
    // Time of the commit.
    CommitTime time.Time `json:"commit_time,omitempty"`
    // Full URL of the main source repository.
    Repo string `json:"repo,omitempty"`
    // Branch of the repo.
    Branch string `json:"branch,omitempty"`
    // Requested revision of the commit or base commit.
    RequestRevision *Link `json:"request_revision,omitempty"`
    // Revision of the commit or base commit.
    Revision *Link `json:"revision,omitempty"`
    // The commit message.
    Description string `json:"description,omitempty"`
    // Rietveld or Gerrit URL if the commit is a patch.
    Changelist *Link `json:"changelist,omitempty"`
    // Browsable URL of the commit.
    CommitURL string `json:"commit_url,omitempty"`
    // List of changed filenames.
    File []string `json:"file,omitempty"`

Commit represents a single commit to a repository, rendered as part of a blamelist.

func (*Commit) DescLines Uses

func (c *Commit) DescLines() []string

DescLines returns the description as a slice, one line per item.

func (*Commit) RevisionHTML Uses

func (c *Commit) RevisionHTML() template.HTML

RevisionHTML returns a single rendered link for the revision, prioritizing Revision over RequestRevision.

func (*Commit) Title Uses

func (c *Commit) Title() string

Title is the first line of the commit message (Description).

type ComponentType Uses

type ComponentType int

ComponentType is the type of build component.

const (
    // Recipe corresponds to a full recipe run.  Dependencies are recipes.
    Recipe ComponentType = iota

    // StepLegacy is a single step of a recipe.

    // Summary denotes that this does not pretain to any particular step.

func (ComponentType) MarshalJSON Uses

func (c ComponentType) MarshalJSON() ([]byte, error)

MarshalJSON renders enums into String rather than an int when marshalling.

func (ComponentType) String Uses

func (i ComponentType) String() string

type Console Uses

type Console struct {
    Name string

    // Project is the LUCI project for which this console is defined.
    Project string

    // Header is an optional header for the console which contains links, oncall info,
    // and summaries of other, presumably related consoles.
    // This field may be nil, which simply indicates to the renderer to not render a
    // header.
    Header *ConsoleHeader

    // Commit is a list of commits representing the list of commits to the left of the
    // console.
    Commit []Commit

    // Table is a tree of builder categories used to generate the console's main table.
    // Leaf nodes must always be of concrete type BuilderRef, interior nodes must
    // always be of type Category. The root node is a dummy node without a name
    // to simplify the implementation.
    Table Category

    // MaxDepth represents the maximum tree depth of Table.
    MaxDepth int

    // FaviconURL is the URL to the favicon for this console.
    FaviconURL string

Console represents a console view. Commit contains a list of commits to be displayed in this console. Table contains a tree of categories whose leaves are builders. The builders maintain information regarding the builds for the corresponding commits in Commit. MaxDepth is a useful piece of metadata for adding in empty rows in the console's header.

func (*Console) HasCategory Uses

func (c *Console) HasCategory() bool

HasCategory returns true if there is at least a single category defined in the console.

type ConsoleElement Uses

type ConsoleElement interface {
    // Writes HTML into the given byte buffer.
    // The two integer parameters represent useful pieces of metadata in
    // rendering: current depth, and maximum depth.
    RenderHTML(*bytes.Buffer, int, int)

    // Returns number of leaf nodes in this console element.
    NumLeafNodes() int

ConsoleElement represents a single renderable console element.

type ConsoleGroup Uses

type ConsoleGroup struct {
    // Title is the title for this group of consoles and may link to anywhere.
    Title *Link

    // Consoles is the list of console summaries contained without this group.
    Consoles []*BuilderSummaryGroup

ConsoleGroup represents a group of console summaries which may optionally be titled. Logically, it represents a group of consoles with some shared quality (e.g. tree closers).

type ConsoleHeader Uses

type ConsoleHeader struct {
    // Oncalls is a list of oncall roles and the current people who fill that role
    // that will be displayed in the header..
    Oncalls []*OncallSummary

    // Links is a list of link groups to be displayed in the header.
    Links []LinkGroup

    // ConsoleGroups is a list of groups of console summaries to be displayed in
    // the header, or nil if there was an error when retrieving consoles.
    // A console group without a title will have all of its console summaries
    // appear "ungrouped" when rendered.
    ConsoleGroups []ConsoleGroup

    // ConsoleGroupsErr is the error thrown when retrieving console groups.
    ConsoleGroupsErr error

    // TreeStatus indicates the status of the tree if it is not nil.
    TreeStatus *TreeStatus

ConsoleHeader represents the header of a console view, containing a set of links, oncall details, as well as a set of console summaries for other, relevant consoles.

type Frontpage Uses

type Frontpage struct {
    Projects []*common.Project

type Interval Uses

type Interval struct {
    // Started denotes the start time of this interval.
    Started time.Time
    // Finished denotest the end time of this interval.
    Finished time.Time
    // Duration is the length of the interval.
    Duration time.Duration

Interval is a time interval which has a start, an end and a duration.

func NewInterval Uses

func NewInterval(c context.Context, start, end time.Time) Interval

NewInterval returns a new interval struct. If end time is empty (eg. Not completed) set end time to empty but set duration to the difference between start and now. Getting called with an empty start time and non-empty end time is undefined.

type Link struct {

    // AriaLabel is a spoken label for the link.  Used as aria-label under the anchor tag.
    AriaLabel string `json:"aria_label,omitempty"`

    // Img is an icon for the link.  Not compatible with label.  Rendered as <img>
    Img string `json:"img,omitempty"`

    // Alt text for the image, or title text with text link.
    Alt string `json:"alt,omitempty"`

    // Alias, if true, means that this link is an [alias link].
    Alias bool `json:"alias,omitempty"`

Link denotes a single labeled link.

JSON tags here are for test expectations.

func NewEmptyLink(label string) *Link

NewEmptyLink creates a Link struct acting as a pure text label.

func NewLink(label, url, ariaLabel string) *Link

NewLink does just about what you'd expect.

func NewPatchLink(cl *buildbucketpb.GerritChange) *Link

NewPatchLink generates a URL to a Gerrit CL.

func (*Link) HTML Uses

func (l *Link) HTML() template.HTML

HTML renders this Link as HTML.

func (*Link) String Uses

func (l *Link) String() string

String renders this Link's Label as a string.

type LinkGroup Uses

type LinkGroup struct {
    // Name is the name of the category this group of links belongs to.
    Name *Link

    // Links is a list of links in this link group.
    Links []*Link

LinkGroup represents a set of links grouped together by some category.

type LinkSet Uses

type LinkSet []*Link

LinkSet is an ordered collection of Link objects that will be rendered on the same line.

func (LinkSet) HTML Uses

func (l LinkSet) HTML() template.HTML

HTML renders this LinkSet as HTML.

func (l LinkSet) IsDebugLink() bool

IsDebugLink returns true iff the first link in the linkset starts with "$".

type Logo struct {
    // Subtitle is text that goes under the logo.  This is most commonly used
    // to specify the version of the OS or type of device.
    Subtitle string `json:"subtitle,omitempty"`
    // Count specifies how many of the OS or device there are.
    Count int `json:"count,omitempty"`

type LogoBanner Uses

type LogoBanner struct {
    OS     []Logo
    Device []Logo

LogoBanner is a banner of logos that define the OS and devices that a component is associated with.

type LogoBase Uses

type LogoBase struct {
    Img string `json:"img,omitempty"`
    Alt string `json:"alt,omitempty"`

type MachinePool Uses

type MachinePool struct {
    Total        int
    Offline      int
    Idle         int
    Busy         int
    Bots         []Bot
    Dimensions   []string
    SwarmingHost string

MachinePool represents the capacity and availability of a builder.

func NewMachinePool Uses

func NewMachinePool(c context.Context, botPool *model.BotPool) *MachinePool

NewMachinePool calculates stats from a model.Bot and generates a MachinePool. This requires a context because setting the UI Status field requires the current time.

func (*MachinePool) SwarmingURL Uses

func (mp *MachinePool) SwarmingURL() string

SwarmingURL returns the swarming bot URL for the machine pool, if available.

type MiloBuildLegacy Uses

type MiloBuildLegacy struct {
    // Summary is a top level summary of the page.
    Summary BuildComponent

    // Trigger gives information about how and with what information
    // the build was triggered.
    Trigger *Trigger

    // Components is a detailed list of components and subcomponents of the page.
    // This is most often used for steps or deps.
    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 MiloBuildLegacy 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

    // Mode to render the steps.
    StepDisplayPref StepDisplayPref

    // Iff true, show all log links whose name starts with '$'.
    ShowDebugLogsPref bool

MiloBuildLegacy denotes a full renderable Milo build page. This is slated to be deprecated in April 2019 after the BuildBot turndown. This is to be replaced by a new BuildPage struct, which encapsulates a Buildbucket Build Proto.

func (*MiloBuildLegacy) BuildSummary Uses

func (b *MiloBuildLegacy) BuildSummary() *BuildSummaryLegacy

BuildSummary returns the BuildSummary representation of the MiloBuildLegacy. This is the subset of fields that is interesting to the builder view.

func (*MiloBuildLegacy) Fix Uses

func (b *MiloBuildLegacy) Fix(c context.Context)

Fix fixes various inconsistencies that users expect to see as part of the Build, but didn't make sense as part of the individual components, including: * If the build is complete, all open steps should be closed. * Parent steps containing failed steps should also be marked as failed. * Components' Collapsed field is set based on StepDisplayPref field. * Parent step name prefix is trimmed from the nested substeps. * Enforce correct values for StepDisplayPref (set to Default if incorrect). * Set parent step durations to be the combination of all children.

type Navigation struct {
    // Title of the site, is generally consistent throughout the whole site.
    SiteTitle *Link

    // Title of the page, usually talks about what's currently here
    PageTitle *Link

    // List of clickable thing to navigate down the hierarchy.
    Breadcrumbs []*Link

    // List of (smaller) clickable things to display on the right side.
    Right []*Link

Navigation is the top bar of the page, used for navigating out of the page.

type Oncall Uses

type Oncall struct {
    // Primary is the username of the primary oncall.  This is used in lieu of emails.
    // This is filled in from the remote JSON.
    Primary string

    // Secondaries are the usernames of the secondary oncalls.  This is used in lieu of emails.
    // This is filled in from the remote JSON.
    Secondaries []string

    // Emails is a list of email addresses for the individuals who are currently in
    // that role.  This is loaded from the sheriffing json.
    Emails []string

Oncall represents an oncall role with the current individuals in that role, represented by their email addresses. This struct represents the JSON format in which we receive rotation data.

type OncallSummary Uses

type OncallSummary struct {
    // Name is the name of the oncall role.  This is set in the Milo config.
    Name string

    // Oncallers is an HTML template containing the usernames (for Googlers) or email addresses
    // (for external contributors) of current oncallers. External emails are obfuscated to make
    // them harder to scrape. If specified in the config, displays "(primary)" and "(secondary)"
    // after the oncaller names. Displays "<none>" if no-one is oncall.
    Oncallers template.HTML

type Property Uses

type Property struct {
    Key   string
    Value string

Property specifies k/v pair representing some sort of property, such as buildbot property, quest property, etc.

type PropertyGroup Uses

type PropertyGroup struct {
    GroupName string
    Property  []*Property

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 Uses

func (p PropertyGroup) Len() int

func (PropertyGroup) Less Uses

func (p PropertyGroup) Less(i, j int) bool

func (PropertyGroup) Swap Uses

func (p PropertyGroup) Swap(i, j int)

type RelatedBuildsTable Uses

type RelatedBuildsTable struct {
    // Build is the underlying build proto for the build page.
    Build `json:"build,omitempty"`

    // RelatedBuilds are build summaries with the same buildset.
    RelatedBuilds []*Build `json:"related_builds,omitempty"`

RelatedBuildsTable represents a related builds table on Milo.

type Search struct {
    // CIServices is a backing service for a Continuous Integration system,
    // such as "buildbot", "swarmbucket", or "dm".
    CIServices []CIService

type Settings Uses

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 Step Uses

type Step struct {
    Children  []*Step         `json:"children,omitempty"`
    Collapsed bool            `json:"collapsed,omitempty"`
    Interval  common.Interval `json:"interval,omitempty"`

Step encapsulates a buildbucketpb.Step, and also allows it to carry nesting information.

func (*Step) ShortName Uses

func (s *Step) ShortName() string

ShortName returns the leaf name of a potentially nested step. Eg. With a name of GrandParent|Parent|Child, this returns "Child"

type StepDisplayPref Uses

type StepDisplayPref string

StepDisplayPref is the display preference for the steps.

const (
    // StepDisplayDefault means that all steps are visible, green steps are
    // collapsed.
    StepDisplayDefault StepDisplayPref = "default"
    // StepDisplayExpanded means that all steps are visible, nested steps are
    // expanded.
    StepDisplayExpanded StepDisplayPref = "expanded"
    // StepDisplayNonGreen means that only non-green steps are visible, nested
    // steps are expanded.
    StepDisplayNonGreen StepDisplayPref = "non-green"

type TreeStatus Uses

type TreeStatus struct {
    // Username is the name of the user who changed the status last.
    Username        string `json:"username"`
    CanCommitFreely bool   `json:"can_commit_freely"`
    // GeneralState is the general state of the tree, which also indicates
    // the color of the tree.
    GeneralState TreeStatusState `json:"general_state"`
    Key          int64           `json:"key"`
    // Date is when the tree was last updated.  The format is YYYY-mm-DD HH:MM:SS.ssssss
    // and implicitly UTC.  eg. "2017-11-10 14:29:21.804080"
    Date string `json:"date"`
    // Message is a human readable description of the tree.
    Message string `json:"message"`
    // URL is a link to the root status page.  This is generated on the Milo side,
    // not provided by the status app.
    URL *url.URL

TreeStatus represents the very top bar of the console, above the header.

type TreeStatusState Uses

type TreeStatusState string

TreeStatusState indicates the status of a tree.

type Trigger Uses

type Trigger struct {
    // Source is the trigger source.  In buildbot, this would be the "Reason".
    // This has no meaning in SwarmBucket and DM yet.
    Source string
    // Project is the name of the LUCI project responsible for
    // triggering the build.
    Project string

Trigger is the combination of pointing to a single commit, with information about where that commit came from (e.g. the repository), and the project that triggered it.

Package ui imports 21 packages (graph) and is imported by 10 packages. Updated 2020-10-27. Refresh now. Tools for package owners.