Swarming endpoints. Includes builds and logs.

  • build.go - Ingests annotee

  • build_test.go - Tests for build.go

  • buildLog.go - Displays build logs

  • memoryClient.go - In memory butler client for annotee

  • html.go - Plain ol' html endpoints

Expand ▾ Collapse ▴




View Source
const (
	// TaskRunning means task is running.
	TaskRunning = "RUNNING"
	// TaskPending means task didn't start yet.
	TaskPending = "PENDING"
	// TaskExpired means task expired and did not start.
	TaskExpired = "EXPIRED"
	// TaskTimedOut means task started, but took too long.
	TaskTimedOut = "TIMED_OUT"
	// TaskBotDied means task started but bot died.
	TaskBotDied = "BOT_DIED"
	// TaskCanceled means the task was canceled. See CompletedTs to determine whether it was started.
	TaskCanceled = "CANCELED"
	// TaskCompleted means task is complete.
	TaskCompleted = "COMPLETED"

Swarming task states..

View Source
const SwarmingTimeLayout = "2006-01-02T15:04:05.999999999"

SwarmingTimeLayout is time layout used by swarming.

View Source
const URLBase = "/swarming/task"

URLBase is the routing prefix for swarming endpoints. It's here so that it can be a constant between the swarmingURLBuilder and the frontend.


This section is empty.


func BuildTestData

func BuildTestData(swarmingRelDir string) []common.TestBundle

BuildTestData returns sample test data for swarming build pages.

func LogTestData

func LogTestData() []common.TestBundle

LogTestData returns sample test data for log pages.

func NewProdService

func NewProdService(c context.Context, host string) (*prodSwarmingService, error)


type BuildID

type BuildID struct {
	// (Required) The Swarming TaskID.
	TaskID string

	// (Optional) The Swarming host. If empty, will use the
	// milo-instance-configured swarming host.
	Host string

BuildID is swarming's notion of a Build. See buildsource.ID.

func (*BuildID) Get

func (b *BuildID) Get(c context.Context) (*resp.MiloBuild, error)

Get implements buildsource.ID

func (*BuildID) GetLog

func (b *BuildID) GetLog(c context.Context, logname string) (text string, closed bool, err error)

GetLog implements buildsource.ID

type BuildInfoProvider

type BuildInfoProvider struct {

	// contains filtered or unexported fields


BuildInfoProvider provides build information.

In a production system, this will be completely defaults. For testing, the various services and data sources may be substituted for testing stubs.

func (*BuildInfoProvider) GetBuildInfo

GetBuildInfo resolves a Milo protobuf Step for a given Swarming task.

type BuildLoader

type BuildLoader struct {

	// contains filtered or unexported fields


BuildLoader represents the ability to load a Milo build from a Swarming task.

It exists so that the internal build loading functionality can be stubbed out for testing.

func (*BuildLoader) SwarmingBuildImpl

func (bl *BuildLoader) SwarmingBuildImpl(c context.Context, svc swarmingService, taskID string) (*resp.MiloBuild, error)