buildstatus

package
v0.0.0-...-2cc3bea Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package buildstatus provides the build status computation related functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StatusWithDetails

type StatusWithDetails struct {
	Status  pb.Status
	Details *pb.StatusDetails
}

type Updater

type Updater struct {
	Build *model.Build

	BuildStatus  *StatusWithDetails
	OutputStatus *StatusWithDetails
	TaskStatus   *StatusWithDetails

	SucceedBuildIfTaskSucceeded bool

	UpdateTime time.Time

	PostProcess func(c context.Context, bld *model.Build) error
}

func (*Updater) Do

func (u *Updater) Do(ctx context.Context) (*model.BuildStatus, error)

Do updates the top level build status, and performs actions when build status changes: * it updates the corresponding BuildStatus entity for the build; * it triggers PubSub notify task; * if the build is ended, it triggers BQ export task.

Note that pubsub notification on build start will not retry on failure.

Must be run inside a transaction.

The post-processes that should happen after the status update is committed is not included, and the callsite needs to handle them separately. These include: * update build event metrics * cancel descendent builds when this build is ended.

Jump to

Keyboard shortcuts

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