validators

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTransient added in v1.3.0

func IsTransient(err error) bool

IsTransient reports whether err is (or wraps) a TransientError.

Types

type Status

type Status interface {
	Detail() string
	IsSuccess() bool
	// Fingerprint identifies the world state this status was computed from:
	// the resolved head SHA plus the gated job set (self/ignored excluded).
	// Two polls with equal fingerprints observed the same, quiescent world —
	// the polling loop requires the fingerprint to hold steady across
	// consecutive green polls before it reports success.
	Fingerprint() string
	// TrackedJobs reports how many gated jobs (excluding self/ignored) were
	// observed. Zero means the gate found nothing to wait on — suspicious
	// right after a push, when CI may simply not have materialized yet.
	TrackedJobs() int
}

type TransientError added in v1.3.0

type TransientError struct {
	Err error
}

TransientError marks a validation error caused by infrastructure — a GitHub API call that failed — rather than by CI results. The polling loop keeps retrying on transient errors until its deadline instead of failing the gatekeeper on the first hiccup; real validation outcomes (failed or cancelled jobs, invalid configuration) are returned untyped and abort the run immediately.

func (*TransientError) Error added in v1.3.0

func (e *TransientError) Error() string

func (*TransientError) Unwrap added in v1.3.0

func (e *TransientError) Unwrap() error

type Validator

type Validator interface {
	Name() string
	Validate(ctx context.Context) (Status, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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