luci: Index | Files

package buildbucket

import ""


Package Files

buckets.go build.go build_legacy.go builder.go common.go html_data.go pools.go pubsub.go


var ErrNotFound = errors.Reason("Build not found").Tag(common.CodeNotFound).Err()
var TestCases = []string{"linux-rel"}

TestCases are the list of known mock data. We put this here instead of _test.go to allow for debug data in dev instances. TODO(hinoka): Implement debug view for localhost development.

func BuildAddress Uses

func BuildAddress(build *buildbucketpb.Build) string

BuildAddress constructs the build address of a buildbucketpb.Build. This is used as the key for the BuildSummary entity.

func CIService Uses

func CIService(c context.Context) (*ui.CIService, error)

CIService returns a *ui.CIService containing all known buckets and builders.

func GetBuild Uses

func GetBuild(c context.Context, host string, bid buildbucketpb.GetBuildRequest) (*buildbucketpb.Build, error)

GetBuild returns the buildbucketpb.Build from a build request.

func GetBuildLegacy Uses

func GetBuildLegacy(c context.Context, address string, fetchFull bool) (*ui.MiloBuildLegacy, error)

GetBuild is a shortcut for GetRawBuild and ToMiloBuild.

func GetBuildPage Uses

func GetBuildPage(c context.Context, br buildbucketpb.GetBuildRequest) (*ui.BuildPage, error)

GetBuildPage fetches the full set of information for a Milo build page from Buildbucket. Including the blamelist and other auxiliary information.

func GetBuildSummary Uses

func GetBuildSummary(c context.Context, id int64) (*model.BuildSummary, error)

GetBuildSummary fetches a build summary where the Context URI matches the given address.

func GetBuilder Uses

func GetBuilder(c context.Context, bid BuilderID, limit int, cursor string) (*ui.Builder, error)

GetBuilder is used by buildsource.BuilderID.Get to obtain the resp.Builder.

func GetBuilders Uses

func GetBuilders(c context.Context) (*swarmbucket.SwarmingSwarmbucketApiGetBuildersResponseMessage, error)

GetBuilders returns all Swarmbucket builders, cached for current identity.

func GetRawBuild Uses

func GetRawBuild(c context.Context, address string) (*bbv1.ApiCommonBuildMessage, error)

GetRawBuild fetches a buildbucket build given its address.

func GetSwarmingTaskID Uses

func GetSwarmingTaskID(c context.Context, buildAddress string) (host, taskId string, err error)

GetSwarmingTaskID returns the swarming task ID of a buildbucket build. TODO(hinoka): BuildInfo and Skia requires this. Remove this when buildbucket v2 is out and Skia is on Kitchen. TODO(nodir): delete this. It is used only in deprecated BuildInfo API.

func GetTestBuild Uses

func GetTestBuild(c context.Context, relDir, name string) (*buildbucketpb.Build, error)

GetTestBuild returns a debug build from testdata.

func MakeBuildKey Uses

func MakeBuildKey(c context.Context, host, buildAddress string) *datastore.Key

MakeBuildKey returns a new datastore Key for a buildbucket.Build.

There's currently no model associated with this key, but it's used as a parent for a model.BuildSummary.

func PubSubHandler Uses

func PubSubHandler(ctx *router.Context)

PubSubHandler is a webhook that stores the builds coming in from pubsub.

func ToMiloBuild Uses

func ToMiloBuild(c context.Context, b *bbv1.ApiCommonBuildMessage, fetchFull bool) (*ui.MiloBuildLegacy, error)

ToMiloBuild converts a raw buildbucket build to a milo build.

Returns an error only on failure to reach buildbucket. Other errors are surfaced in the returned build.

TODO(hinoka): Some of this can be done concurrently. Investigate if this call takes >500ms on average. TODO( stop loading steps from logdog.

func UpdatePools Uses

func UpdatePools(c context.Context) error

UpdatePools is a cron job endpoint that: 1. Fetches all the builders from our associated Swarmbucket instance. 2. Consolidates all known descriptors (host+dimensions), saves BuilderPool. 3. Fetches and saves BotPool data from swarming for all known descriptors.

type BuilderID Uses

type BuilderID struct {
    // BuilderID is the buildbucket v2 representation of the builder ID.  Note
    // that the v2 representation uses short bucket names.

BuilderID represents a buildbucket builder. We wrap the underlying representation since we represent builder IDs slightly differently in Milo vs. Buildbucket. I.E. Builders can source from either BuildBot or Buildbucket.

func NewBuilderID Uses

func NewBuilderID(v1Bucket, builder string) (bid BuilderID)

NewBuilderID does what it says.

func (BuilderID) String Uses

func (b BuilderID) String() string

String returns the canonical format of BuilderID.

func (BuilderID) V1Bucket Uses

func (b BuilderID) V1Bucket() string

V1Bucket returns the buildbucket v1 representation of the bucket name, which is what we use in Milo.

Package buildbucket imports 48 packages (graph) and is imported by 8 packages. Updated 2018-12-19. Refresh now. Tools for package owners.