release

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package release computes the test framework's own release versioning: the next patch to cut when none is given explicitly, and which floating tags (latest, the bare major, major.minor) a release should also receive.

It is pure — no git, network, or registry calls — so it is fully covered by ordinary unit tests that run in any pull request's CI, with no registry credentials required. cmd/release wraps it with the git I/O a real release run needs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FloatingTags

func FloatingTags(tags []string, released Version) []string

FloatingTags decides which floating tags — "latest", the bare major, and "major.minor" — a release should receive, given every other known release tag. A floating tag moves only when released is the highest version within its scope: "major.minor" requires it to be the highest patch in its own minor line, so an out-of-order patch (one below a patch already released in its line) receives none of these; the bare major additionally requires the highest minor line within that major; "latest" requires the highest release overall. tags may or may not already contain released — either way gives the same result.

Types

type Version

type Version struct {
	Major, Minor, Patch int
}

Version is a parsed MAJOR.MINOR.PATCH release version.

func Highest

func Highest(versions []Version) (Version, bool)

Highest returns the highest of versions, and false if versions is empty.

func NextVersion

func NextVersion(tags []string) (Version, error)

NextVersion returns the version a release should cut when none is given explicitly: the highest existing release's major.minor with patch+1, or 0.0.1 when tags holds no release yet. It returns an error when the highest release's patch is already the largest representable.

func ParseVersion

func ParseVersion(s string) (Version, bool)

ParseVersion parses a MAJOR.MINOR.PATCH string, with or without a leading "v". It reports false for anything else — a floating tag ("latest", "0", "0.4"), a malformed string, or an empty one — so a caller can filter a raw tag list without pre-validating it.

func ParseVersions

func ParseVersions(tags []string) []Version

ParseVersions parses every tag that matches ParseVersion, silently skipping the rest.

func (Version) Less

func (v Version) Less(other Version) bool

Less reports whether v sorts before other under semver precedence: major, then minor, then patch.

func (Version) String

func (v Version) String() string

String renders v as "MAJOR.MINOR.PATCH" — the form used both for the testbench's Docker image tags and for the suffix of this module's "tests/framework/vX.Y.Z" git tags.

Jump to

Keyboard shortcuts

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