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 ¶
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 NextVersion ¶
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 ¶
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 ¶
ParseVersions parses every tag that matches ParseVersion, silently skipping the rest.