Documentation
¶
Overview ¶
Package legacydash holds the serving code for the build dashboard (build.golang.org) and its remaining HTTP API endpoints.
It's a code transplant of the previous app/appengine application, converted into a package that coordinator can import and use. A newer version of the build dashboard is in development in the golang.org/x/build/cmd/coordinator/internal/dashboard package.
Index ¶
- func GRPCHandler(gs *grpc.Server, h http.Handler) http.Handler
- func Handler(dc *datastore.Client, mc apipb.MaintnerServiceClient, lc luciClient, ...) http.Handler
- type Commit
- type CommitInfo
- type Dashboard
- type DisplayResult
- type Log
- type Package
- type PackageState
- type Pagination
- type Result
- type TagState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GRPCHandler ¶
GRPCHandler creates handler which intercepts requests intended for a GRPC server and directs the calls to the server. All other requests are directed toward the passed in handler.
func Handler ¶
func Handler(dc *datastore.Client, mc apipb.MaintnerServiceClient, lc luciClient, key string, grpcServer *grpc.Server) http.Handler
Handler sets a datastore client, maintner client, builder master key and GRPC server at the package scope, and returns an HTTP mux for the legacy dashboard.
Types ¶
type Commit ¶
type Commit struct { PackagePath string // (empty for main repo commits) Hash string // ResultData is the Data string of each build Result for this Commit. // For non-Go commits, only the Results for the current Go tip, weekly, // and release Tags are stored here. This is purely de-normalized data. // The complete data set is stored in Result entities. // // Each string is formatted as builder|OK|LogHash|GoHash. ResultData []string `datastore:",noindex"` }
A Commit describes an individual commit in a package.
Each Commit entity is a descendant of its associated Package entity. In other words, all Commits with the same PackagePath belong to the same datastore entity group.
func (*Commit) AddResult ¶
func (com *Commit) AddResult(tx *datastore.Transaction, r *Result) error
AddResult adds the denormalized Result data to the Commit's ResultData field.
func (*Commit) RemoveResult ¶
RemoveResult removes the denormalized Result data from the ResultData field for the given builder and go hash. It must be called from within the datastore transaction that gets and puts the Commit. Note this is slightly different to AddResult, above.
type CommitInfo ¶
type CommitInfo struct { Hash string // ResultData is a copy of the [Commit.ResultData] field from datastore, // with an additional rule that the second '|'-separated value may be "infra_failure" // to indicate a problem with the infrastructure rather than the code being tested. ResultData []string // BuildingURLs contains the status URL values for builds that // are currently in progress for this commit. BuildingURLs map[builderAndGoHash]string PackagePath string // (empty for main repo commits) User string // "Foo Bar <foo@bar.com>" Desc string // git commit title Time time.Time // commit time Branch string // "master", "release-branch.go1.14" }
A CommitInfo is a struct for use by html/template package. It is not stored in the datastore.
func (*CommitInfo) Result ¶
func (c *CommitInfo) Result(builder, goHash string) *DisplayResult
Result returns the build Result for this commit for the given builder/goHash.
For the main Go repo, goHash is the empty string.
func (*CommitInfo) ResultGoHashes ¶
func (c *CommitInfo) ResultGoHashes() []string
ResultGoHashes, for non-go repos, returns the list of Go hashes that this repo has been (or should be) built at.
For the main Go repo it always returns a slice with 1 element: the empty string.
func (*CommitInfo) Results ¶
func (c *CommitInfo) Results() (results []*DisplayResult)
Results returns the build results for this Commit.
type Dashboard ¶
type Dashboard struct { Name string // This dashboard's name (always "Go" nowadays) Packages []*Package // The project's packages to build }
Dashboard describes a unique build dashboard.
(There used to be more than one dashboard, so this is now somewhat less important than it once was.)
type DisplayResult ¶
func (*DisplayResult) LogURL ¶
func (r *DisplayResult) LogURL() string
type Log ¶
type Log struct {
CompressedLog []byte `datastore:",noindex"`
}
A Log is a gzip-compressed log file stored under the SHA1 hash of the uncompressed log text.
type Package ¶
type Package struct { Name string // "Go", "arch", "net", ... Path string // empty for the main Go tree, else "golang.org/x/foo" }
A Package describes a package that is listed on the dashboard.
type PackageState ¶
type PackageState struct { Package *Package Commit *CommitInfo }
PackageState represents the state of a Package (x/foo repo) for given Go branch.
type Pagination ¶
type Result ¶
type Result struct { Builder string // "os-arch[-note]" PackagePath string // (empty for Go commits, else "golang.org/x/foo") Hash string // The Go Commit this was built against (when PackagePath != ""; empty for Go commits). GoHash string BuildingURL string `datastore:"-"` // non-empty if currently building OK bool Log string `datastore:"-"` // for JSON unmarshaling only LogHash string `datastore:",noindex"` // Key to the Log record. RunTime int64 // time to build+test in nanoseconds }
A Result describes a build result for a Commit on an OS/architecture.
Each Result entity is a descendant of its associated Package entity.
type TagState ¶
type TagState struct { Name string // Go branch name: "master", "release-branch.go1.4", etc. Tag *CommitInfo // current Go commit on the Name branch Packages []*PackageState Builders []string }
TagState represents the state of all Packages at a branch.
func (*TagState) Branch ¶
Branch returns the git branch name, converting from the old terminology we used from Go's hg days into git terminology.
func (*TagState) LUCIBranch ¶
LUCIBranch returns the short Go branch name as used in LUCI: "tip", "1.24", etc.