promotion

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 5 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 promotion answers "is the fix in prod yet".

One row per app, one column per environment, sorted so the apps whose environments disagree float to the top. The matrix compares and never promotes: no control here mutates anything, because deploying belongs to the pipeline that owns it.

Two distinctions carry most of the value. Ahead is worse than behind: behind is a schedule, ahead is an out-of-band change. And absent is not forbidden: "it is not deployed there" and "I cannot see it" are different facts, and a matrix that renders them the same way is a matrix that lies during an incident.

Index

Constants

View Source
const (
	StateSame          = "same"
	StateBehind        = "behind"
	StateAhead         = "ahead"
	StateDiffers       = "differs"
	StateDigestDiffers = "digest-differs"
	StateAbsent        = "absent"
	StateDenied        = "denied"
)

Cell states.

Variables

This section is empty.

Functions

func TagOf

func TagOf(image string) string

TagOf reads the tag from an image reference.

A registry port is not a tag: reading "registry:5000/app" as tag 5000 would put a port number in every cell of a self-hosted registry's matrix.

Types

type Cell

type Cell struct {
	Env       string `json:"env"`
	Namespace string `json:"namespace,omitempty"`
	State     string `json:"state"`
	Tag       string `json:"tag,omitempty"`
	Image     string `json:"image,omitempty"`
	Digest    string `json:"digest,omitempty"`
	// DigestPending marks a cell whose digest has not arrived. Tag comparison
	// never waits for it, and a missing digest never reads as a match.
	DigestPending bool   `json:"digestPending,omitempty"`
	Health        string `json:"health,omitempty"`
	Ready         string `json:"ready,omitempty"`
	RevisionAt    string `json:"revisionAt,omitempty"`
	Note          string `json:"note,omitempty"`
	// Severe marks the states that deserve the error hue rather than a warning:
	// ahead of upstream, and a tag that resolves to a different digest.
	Severe bool `json:"severe,omitempty"`
}

Cell is one instance, compared against its upstream.

type Env

type Env struct {
	Name    string `json:"name"`
	Risk    string `json:"risk"`
	Context string `json:"context,omitempty"`
}

Env is one column.

type Instance

type Instance struct {
	Env       string
	App       string
	Namespace string

	Present bool
	// Denied marks an environment that could not be read. It is deliberately
	// not the same as absent.
	Denied       bool
	DeniedReason string

	Image  string
	Tag    string
	Digest string

	Health     string
	Ready      string
	RevisionAt string
}

Instance is one app as it exists in one environment.

type Row

type Row struct {
	App       string `json:"app"`
	Namespace string `json:"namespace"`
	Cells     []Cell `json:"cells"`
	Drift     int    `json:"drift"`
	Ahead     bool   `json:"ahead,omitempty"`
}

Row is one app across every environment.

func Build

func Build(envs []Env, instances []Instance) []Row

Build lays out the matrix.

type Summary

type Summary struct {
	Apps    int `json:"apps"`
	Drifted int `json:"drifted"`
	Ahead   int `json:"ahead"`
}

Summary is what the page header reports.

func Summarize

func Summarize(rows []Row) Summary

Summarize counts the rows worth looking at.

Jump to

Keyboard shortcuts

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