build

package
v0.0.0-...-56a2066 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ChromeProject refers to the "chrome" project.
	ChromeProject = "chrome"
	// ChromiumGitilesURL is the default Gitiles URL for chromium/src.
	ChromiumGitilesURL = "https://chromium.googlesource.com/chromium/src"
	// ChromiumGitilesHost is the default Gitiles host for chromium/src.
	ChromiumGitilesHost = "chromium.googlesource.com"
	// ChromiumGitilesProject is the default project name for chromium/src.
	ChromiumGitilesProject = "chromium/src"
	// ChromiumGitilesRefAtHead is the default ref used for Chromium builds.
	ChromiumGitilesRefAtHead = "refs/heads/main"

	// DefaultBucket is the Pinpoint bucket, equivalent to the "try" builds in Buildbucket.
	DefaultBucket = "try"
	// DefaultBuildsetKey is key tagged on builds for how commit information is tracked in Waterfall (CI) and Pinpoint.
	DefaultBuildsetKey = "buildset"
	// DefaultTagValue is the value format for the key above.
	DefaultBuildsetValue = "commit/gitiles/chromium.googlesource.com/chromium/src/+/%s"
	// DefaultCASInstance is the default CAS instance used by Pinpoint builds.
	//
	// TODO(b/315215756): Support other swarming instances. There are three known
	// swarming instances Pinpoint supports. The majority of Pinpoint builds are
	// this defaultInstance. Buildbucket API does not report the swarming instance
	// so our options are to:
	// - include the expected instance in the build tags
	// - try all 3 known swarming instances and brute force it
	DefaultCASInstance = "projects/chrome-swarming/instances/default_instance"
	// DepsOverrideKey is the key used to find any deps overrides in the input properties from a Buildbucket response.
	DepsOverrideKey = "deps_revision_overrides"
)

Variables

View Source
var BuildClientContextKey = &BuildClientKey{}

Functions

This section is empty.

Types

type BuildClient

type BuildClient interface {
	// CreateFindBuildRequest returns a request for FindBuild.
	CreateFindBuildRequest(params workflows.BuildParams) (*FindBuildRequest, error)

	// FindBuild looks for an existing build that matches the build parameters.
	FindBuild(ctx context.Context, req *FindBuildRequest) (*FindBuildResponse, error)

	// CreateStartBuildRequest returns a request for StartBuild
	CreateStartBuildRequest(params workflows.BuildParams) (*StartBuildRequest, error)

	// FindBuild starts a new build request.
	StartBuild(ctx context.Context, req *StartBuildRequest) (*StartBuildResponse, error)

	// GetStatus returns the Build status.
	//
	// Note: The status should be generalized, but the Buildbucket statuses do a
	// good job of defining states, so we'll leave it for now.
	GetStatus(ctx context.Context, id int64) (buildbucketpb.Status, error)

	// GetBuildArtifact fetches the information pointing to build artifacts.
	GetBuildArtifact(ctx context.Context, req *GetBuildArtifactRequest) (*GetBuildArtifactResponse, error)

	// CancelBuild cancels an existing ongoing build.
	CancelBuild(ctx context.Context, req *CancelBuildRequest) error
}

BuildClient is the interface for all build clients to implement.

func NewBuildClient

func NewBuildClient(ctx context.Context, project string) (BuildClient, error)

type BuildClientKey

type BuildClientKey struct{}

type CancelBuildRequest

type CancelBuildRequest struct {
	BuildID int64
	Reason  string
}

type ChromeFindBuildRequest

type ChromeFindBuildRequest struct {
	Device  string
	Commit  string
	Deps    map[string]string
	Patches []*buildbucketpb.GerritChange
}

type FindBuildRequest

type FindBuildRequest struct {
	Request any
}

type FindBuildResponse

type FindBuildResponse struct {
	Response any
	BuildID  int64
}

type GetBuildArtifactRequest

type GetBuildArtifactRequest struct {
	BuildID int64
	Target  string
}

type GetBuildArtifactResponse

type GetBuildArtifactResponse struct {
	Response any
}

type StartBuildRequest

type StartBuildRequest struct {
	Request any
}

type StartBuildResponse

type StartBuildResponse struct {
	Response any
}

Jump to

Keyboard shortcuts

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