legacydash

package
v0.0.0-...-a705825 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: BSD-3-Clause Imports: 34 Imported by: 0

README

Go Reference

golang.org/x/build/cmd/coordinator/internal/legacydash

Package legacydash holds the serving code for the build dashboard (build.golang.org) and its remaining HTTP API endpoints.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func GRPCHandler

func GRPCHandler(gs *grpc.Server, h http.Handler) http.Handler

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) Key

func (com *Commit) Key() *datastore.Key

func (*Commit) RemoveResult

func (com *Commit) RemoveResult(r *Result)

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.

func (*Commit) Result

func (c *Commit) Result(builder, goHash string) *Result

Result returns the build Result for this Commit for the given builder/goHash.

For the main Go repo, goHash is the empty string.

func (*Commit) Valid

func (c *Commit) Valid() bool

Valid reports whether the commit is valid.

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

type DisplayResult struct {
	Result
	Noise bool
}

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.

func (*Log) Text

func (l *Log) Text() ([]byte, error)

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.

func (*Package) Key

func (p *Package) Key() *datastore.Key

func (*Package) String

func (p *Package) String() string

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 Pagination struct {
	Next, Prev int
	HasPrev    bool
}

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.

func (*Result) Data

func (r *Result) Data() string

Data returns the Result in string format to be stored in Commit's ResultData field.

func (*Result) Key

func (r *Result) Key() *datastore.Key

func (*Result) Valid

func (r *Result) Valid() error

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

func (ts *TagState) Branch() string

Branch returns the git branch name, converting from the old terminology we used from Go's hg days into git terminology.

Jump to

Keyboard shortcuts

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