luci-go: github.com/luci/luci-go/milo/buildsource/buildbucket Index | Files

package buildbucket

import "github.com/luci/luci-go/milo/buildsource/buildbucket"

Index

Package Files

buckets.go build.go build_legacy.go builder.go client.go common.go feedback_links.go pools.go pubsub.go

Variables

var (
    ErrNotFound    = errors.Reason("Build not found").Tag(grpcutil.NotFoundTag).Err()
    ErrNotLoggedIn = errors.Reason("not logged in").Tag(grpcutil.UnauthenticatedTag).Err()
)

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

func CancelBuild(c context.Context, id int64, reason string) (*buildbucketpb.Build, error)

CancelBuild cancels the build with the given ID.

func GetBuildPage Uses

func GetBuildPage(ctx *router.Context, br buildbucketpb.GetBuildRequest, forceBlamelist bool) (*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 GetBuilderID Uses

func GetBuilderID(c context.Context, id int64) (builder *buildbucketpb.BuilderID, number int32, err error)

GetBuilderID returns the builder, and maybe the build number, for a build id.

func GetBuilderPage Uses

func GetBuilderPage(c context.Context, bid *buildbucketpb.BuilderID, pageSize int, pageToken string) (*ui.BuilderPage, error)

GetBuilderPage computes a builder page data.

func GetBuilders Uses

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

GetBuilders returns all Swarmbucket builders, cached for current identity.

func GetRelatedBuildsTable Uses

func GetRelatedBuildsTable(c context.Context, buildbucketID int64) (*ui.RelatedBuildsTable, error)

GetRelatedBuildsTable fetches all the related builds of the given build from Buildbucket.

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

func LegacyBuilderIDString(bid *buildbucketpb.BuilderID) string

LegacyBuilderIDString returns a legacy string identifying the builder. It is used in the Milo datastore.

func MakeBuildBugLink(bt *config.BugTemplate, data interface{}) (string, error)

MakeBuildBugLink attempts to create the feedback link for the build page. If the project is not configured for a custom build bug link or an interpolation placeholder cannot be satisfied an empty string is returned.

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

func ProdClientFactory(c context.Context, host string, as auth.RPCAuthorityKind, opts ...auth.RPCOption) (buildbucketpb.BuildsClient, error)

func PubSubHandler Uses

func PubSubHandler(ctx *router.Context)

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

func RetryBuild Uses

func RetryBuild(c context.Context, buildbucketID int64, requestID string) (*buildbucketpb.Build, error)

RetryBuild retries the build with the given ID and returns the new build.

func ToMiloBuild Uses

func ToMiloBuild(c context.Context, msg *bbv1.LegacyApiCommonBuildMessage) (*ui.MiloBuildLegacy, error)

ToMiloBuild converts a v1 buildbucket build to a milo build. Does not make RPCs. In case of an error, returns a build with a description of the error and logs the error.

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.

func WithClientFactory Uses

func WithClientFactory(c context.Context, factory clientFactory) context.Context

WithClientFactory installs a buildbucket rpc client in the context.

Package buildbucket imports 49 packages (graph). Updated 2019-12-12. Refresh now. Tools for package owners.