Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatFrom ¶
FormatFrom reads the root's --output flag, which the framework binds into the config store. An unrecognised or absent value means text, because a plan a person cannot read is worse than one a machine cannot parse.
func Render ¶
Render writes a plan. Exported and taking its writer and format explicitly so it can be tested without a command, a terminal, or a config store.
Text is rendered here rather than through the renderer's text callback, because that callback is func(io.Writer) with no error return: a write failure was recorded and then discarded, so a broken pipe produced a partial plan and a success. Structured formats still go through the renderer, which does report its errors.
Types ¶
type Plan ¶
type Plan struct {
Repository string `json:"repository" yaml:"repository"`
// Current is the version the project is at. FromTag is empty when it has
// never released, which Current alone cannot express.
Current string `json:"current" yaml:"current"`
FromTag string `json:"from_tag,omitempty" yaml:"from_tag,omitempty"`
// Next is the version this release would carry. Empty when nothing is due.
Next string `json:"next,omitempty" yaml:"next,omitempty"`
Bump string `json:"bump" yaml:"bump"`
// Releasable is authoritative. Do not infer it from Bump: an honoured
// Release-As trailer can move a version without moving any numeric
// component.
Releasable bool `json:"releasable" yaml:"releasable"`
// Held reports a hold in the manifest. A held release is still computed and
// still shown — a hold should make the pending release easier to look at,
// not hide it.
Held bool `json:"held" yaml:"held"`
HoldReason string `json:"hold_reason,omitempty" yaml:"hold_reason,omitempty"`
Reasons []Reason `json:"reasons,omitempty" yaml:"reasons,omitempty"`
// Notes are the annotations commits contributed through a Release-Note:
// trailer or block (spec 0003). Shown so a maintainer can see what the
// release will SAY, not only what version it will carry — the notes are
// the part a reader acts on.
ReleaseNotes []string `json:"release_notes,omitempty" yaml:"release_notes,omitempty"`
Notes []string `json:"notes,omitempty" yaml:"notes,omitempty"`
// Considered is every unreleased commit, including those that moved
// nothing. A maintainer asking "why is there no release?" is answered by
// this rather than by an empty Reasons list.
Considered int `json:"considered" yaml:"considered"`
}
Plan is what `plan` computed. It is the machine-readable form, and it is the reason this command exists as much as the human one: comparing colophon with another release tool means running both and diffing the answers, which needs a shape a diff can read.
func Compute ¶
Compute is the whole of `plan` with no I/O of its own beyond reading the repository, so it is callable and testable without a command.
func (Plan) HasReleased ¶
HasReleased reports whether the project has ever cut a release.
type PlanOptions ¶
type PlanOptions struct {
Repo string
}
type Reason ¶
type Reason struct {
SHA string `json:"sha" yaml:"sha"`
Type string `json:"type" yaml:"type"`
Scope string `json:"scope,omitempty" yaml:"scope,omitempty"`
Subject string `json:"subject" yaml:"subject"`
Bump string `json:"bump" yaml:"bump"`
Why string `json:"why" yaml:"why"`
}
Reason is one commit's contribution.