resultstore

package
v0.0.0-...-4359601 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const ResultStoreAddress = "resultstore.googleapis.com:443"

TODO: have client connect itself? Move to flagutils?

Variables

This section is empty.

Functions

func ArtifactFiles

func ArtifactFiles(ctx context.Context, opener fileFinder, o ArtifactOpts) ([]*resultstore.File, error)

ArtifactFiles returns the files based on ArtifactOpts.

In the event of error, returns any files collected so far in the interest of best effort.

func Connect

func Connect(ctx context.Context) (*grpc.ClientConn, error)

Connect returns a ResultStore GRPC client connection.

func SeedAuthToken

func SeedAuthToken(seed string)

SeedAuthToken sets the seed for computing AuthenticationToken values for ResultStore uploads. This is just one of many layers of protection, but if ever needed, a Crier secret string could be used to rule out unintended writers from interfering with in-progress uploads.

Types

type ArtifactOpts

type ArtifactOpts struct {
	// Dir is the top-level directory, including the provider, e.g.
	// "gs://some-bucket/path"; include all files here.
	Dir string
	// ArtifactsDirOnly includes only the "Dir/artifacts/" directory,
	// instead of files in the tree rooted there. Experimental.
	ArtifactsDirOnly bool
	// DefaultFiles are files in directory Dir (not nested) that are
	// included in the output if they don't exist.
	DefaultFiles []DefaultFile
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(conn *grpc.ClientConn) *Client

NewClient returns a new ResultStore client.

func (*Client) UploadClient

func (c *Client) UploadClient() resultstore.ResultStoreUploadClient

type DefaultFile

type DefaultFile struct {
	Name string
	Size int64
}

DefaultFile describes a file that should exist in ArtifactOpts.Dir. If the file is not present, these values will be used instead.

type Payload

type Payload struct {
	Job       *v1.ProwJob
	Started   *metadata.Started
	Finished  *metadata.Finished
	Files     []*resultstore.File
	ProjectID string
}

func (*Payload) ConfiguredTarget

func (p *Payload) ConfiguredTarget() *resultstore.ConfiguredTarget

func (*Payload) DefaultConfiguration

func (p *Payload) DefaultConfiguration() *resultstore.Configuration

func (*Payload) Invocation

func (p *Payload) Invocation() (*resultstore.Invocation, error)

Invocation returns an Invocation suitable to upload to ResultStore.

func (*Payload) InvocationID

func (p *Payload) InvocationID() (string, error)

InvocationID returns the ResultStore InvocationId.

func (*Payload) OverallAction

func (p *Payload) OverallAction() *resultstore.Action

func (*Payload) OverallTarget

func (p *Payload) OverallTarget() *resultstore.Target

type Uploader

type Uploader struct {
	// contains filtered or unexported fields
}

func NewUploader

func NewUploader(client *Client) *Uploader

func (*Uploader) Upload

func (u *Uploader) Upload(ctx context.Context, log *logrus.Entry, p *Payload) error

Upload uploads a completed Prow job's results to ResultStore's API: https://github.com/googleapis/googleapis/blob/master/google/devtools/resultstore/v2/resultstore_upload.proto This function distinguishes between transient and permanent errors; only transient errors from ResultStore are returned, in which case the call should be retried later.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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