bb

package
v0.0.0-...-e560ebb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Overview

Package bb provides a buildbucket Client with helper methods for interacting with builds.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build struct {
	ID      int64
	DUTName string
	Builder *buildbucket_pb.BuilderID
	Status  buildbucket_pb.Status

	// Tags strings of the form "key:value"
	Tags []string

	// Response may be nil if the output properties of the build do not contain
	// a response.
	Response *steps.ExecuteResponse

	// Responses may be nil if the output properties of the build do not contain
	// a responses field.
	Responses *steps.ExecuteResponses

	// Request may be nil if the output properties of the build do not contain a
	// request field.
	Request *test_platform.Request

	// Requests may be nil if the output properties of the build do not contain
	// a requests field.
	Requests map[string]*test_platform.Request

	// BackfillRequests may be nil if the output properties of the build do not
	// contain a backfill_requests field.
	BackfillRequests map[string]*test_platform.Request
}

Build contains selected state information from a fetched buildbucket Build.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides helper methods to interact with buildbucket builds.

func NewClient

func NewClient(ctx context.Context, builderInfo site.BuildbucketBuilderInfo, authFlags authcli.Flags) (*Client, error)

NewClient returns a new client to interact with buildbucket builds from the given builder.

func (*Client) BuildURL

func (c *Client) BuildURL(buildID int64) string

BuildURL constructs the URL to a build with the given ID.

func (*Client) GetBuild

func (c *Client) GetBuild(ctx context.Context, ID int64) (*Build, error)

GetBuild gets a buildbucket build by ID.

func (*Client) ScheduleCTPBuild

func (c *Client) ScheduleCTPBuild(ctx context.Context, requests map[string]*test_platform.Request, tags []string) (int64, error)

ScheduleCTPBuild schedules a new cros_test_platform build.

ScheduleCTPBuild returns the buildbucket build ID for the scheduled build on success. ScheduleCTPBuild does not wait for the scheduled build to start.

func (*Client) ScheduleDUTLeaserBuild

func (c *Client) ScheduleDUTLeaserBuild(ctx context.Context, dims map[string]string, tags []string, length int32) (int64, error)

ScheduleDUTLeaserBuild schedules a new dut_leaser build and returns the buildbucket build ID for the scheduled build on success, without waiting for the scheduled build to start.

func (*Client) SearchBuildsByTags

func (c *Client) SearchBuildsByTags(ctx context.Context, limit int, tags ...string) ([]*Build, error)

SearchBuildsByTags searches for all buildbucket builds with the given tags.

SearchBuildsByTags returns at most limit results.

func (*Client) WaitForBuild

func (c *Client) WaitForBuild(ctx context.Context, ID int64) (*Build, error)

WaitForBuild waits for a buildbucket build and returns the response on build completion.

WaitForBuild regularly logs output to stdout to pacify the logdog silence checker.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL