Documentation
¶
Overview ¶
Package release holds what the release commands share: the list of modules this repository publishes, the tag each one is released under, and the check that a module builds against the versions its own go.mod names.
The check is the whole safety argument for a release. A nested module requires the core at a published tag rather than through a replace directive, and go.work overrides that during development, so a green workspace test says nothing about what a downstream go get resolves. Running the same build with the workspace off, against exactly the version in the require line, is what says the published module works.
Index ¶
- Variables
- func Check(dir string) error
- func CheckPushed() error
- func CheckWorktree() error
- func Command(dir string, args ...string) *exec.Cmd
- func CreateTag(name, message string) error
- func DeleteTag(name string) error
- func PushTags(remote string, names []string) error
- func Tags() ([]string, error)
- type Module
- type Version
Constants ¶
This section is empty.
Variables ¶
var Modules = []Module{ {Dir: ".", Prefix: "", Major: 0, TracksCore: true, Title: "%s — %s"}, {Dir: "backend/gg", Prefix: "backend/gg/", Major: 0, TracksCore: true, Title: "backend/gg %s — the raster path at core %s"}, {Dir: "arrow/v18", Prefix: "arrow/", Major: 18, Title: "arrow/%s — the adapter at core %s"}, {Dir: "backend/gg/gpu", Prefix: "backend/gg/gpu/", Major: 0, Title: "backend/gg/gpu %s — the tier at core %s"}, {Dir: "backend/window", Prefix: "backend/window/", Major: 0, TracksCore: true, Title: "backend/window %s — the native path at core %s"}, }
Modules is every module this repository publishes, in dependency order. Tagging no longer has to follow that order — see Check — but reporting still reads better along it.
Functions ¶
func Check ¶
Check builds, tests and vets a module against the versions its own go.mod names, with the workspace disabled. It never edits manifests or tags.
Green means the module works with the core it requires, which is all a release has to promise: that require is a floor, and minimal version selection raises it for anyone importing both. So a green check licences the tag without the require line naming the version being tagged. Red is the signal — and the only signal — that a require line has to move.
func CheckPushed ¶
func CheckPushed() error
CheckPushed refuses to tag a commit that is not on the upstream branch. Pushing a tag does not push the commit under it, so a tag on a local-only commit publishes a version the proxy cannot fetch — and the proxy caches that failure.
func CheckWorktree ¶
func CheckWorktree() error
CheckWorktree refuses to release from a tree that does not match what is committed. A tag names a commit, so anything only in the working tree is not in the release however green the check was.
Types ¶
type Module ¶
type Module struct {
// Dir is the module directory relative to the repository root, "." for
// the core.
Dir string
// Prefix is what its tags begin with: the directory without the
// major-version suffix, empty for the core. A module's tag prefix is its
// subdirectory without that suffix even when the module lives in a
// major-version subdirectory, which is why arrow/v18 tags as arrow/
// (ADR 0030).
Prefix string
// Major is the major version its tags must carry. A module path without
// a /vN suffix can only publish v0 or v1, and one with a suffix has to
// match it.
Major int
// TracksCore is set for the modules released in lockstep with the core:
// the supported raster and native paths, whose own APIs are small enough
// that a version of their own would say less than the core's does.
TracksCore bool
// Title formats the first line of the tag message, taking the module's
// version and then the core's.
Title string
}
A Module is one of the modules this repository publishes.
func ForTag ¶
ForTag returns the module a release tag belongs to. The longest prefix wins, so backend/gg/gpu/v0.3.0 is the GPU tier rather than a strangely named release of the raster backend.
func (Module) CheckVersion ¶
CheckVersion rejects a version this module cannot publish under. Go resolves a module path without a /vN suffix only at v0 or v1, and a path with one only at that major, so a wrong major here is a tag nothing can require.
func (Module) Latest ¶
Latest is the highest version already tagged for a module, and whether there is one. Tags are attributed with ForTag, so the raster backend's history does not pick up the GPU tier's tags.
type Version ¶
type Version struct{ Major, Minor, Patch int }
A Version is a release version. Release tags carry no prerelease or build metadata: a version that is not ready to be required by name is not ready to be tagged.
func ParseVersion ¶
ParseVersion reads a vMAJOR.MINOR.PATCH version.