bundlechecks

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package bundlechecks decides whether the external checks reported against a release bundle satisfy the checks a promotion stage requires.

Index

Constants

View Source
const (
	// MaxNameLen bounds a check name (bundle_checks.name is varchar(64)).
	MaxNameLen = 64
	// MaxPerStage bounds the checks one pipeline stage may require.
	MaxPerStage = 20
	// MaxSummaryLen bounds the summary of a report.
	MaxSummaryLen = 2000
	// MaxURLLen bounds the details URL of a report.
	MaxURLLen = 2048
)

Variables

This section is empty.

Functions

func ValidStatus

func ValidStatus(s models.BundleCheckStatus) bool

ValidStatus reports whether s is a status a check can report.

func ValidateName

func ValidateName(name string) string

ValidateName returns a client-facing message when name cannot name a check: it must be non-empty, trimmed, at most MaxNameLen bytes and free of control characters. The empty string means valid.

func ValidateRequired

func ValidateRequired(names []string) string

ValidateRequired returns a client-facing message when the required check names of one stage are invalid: too many, a bad name or a duplicate. The empty string means valid.

Types

type Verdict

type Verdict struct {
	// Missing were never reported.
	Missing []string
	// Failed last reported failure or error.
	Failed []string
	// Pending last reported pending.
	Pending []string
	// Expired last reported success, but that success has run out.
	Expired []string
}

Verdict is the outcome of Evaluate: the required checks that do not let the promotion through, by reason. Every list is in the order of the required names.

func Evaluate

func Evaluate(required []string, reported []*models.BundleCheck, now time.Time) Verdict

Evaluate judges the reported checks against the required names at now. A success counts only while its expiry (when it has one) lies in the future; duplicate required names are judged once.

func (Verdict) Satisfied

func (v Verdict) Satisfied() bool

Satisfied reports whether every required check is a live success.

func (Verdict) String

func (v Verdict) String() string

String is the client message of an unsatisfied verdict, for example "missing: conforma; failed: scan".

Jump to

Keyboard shortcuts

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