Documentation
¶
Overview ¶
Package releasedigest is the release digest: per release, its tag, the tag it was cut from, and each changelog line as `abcd launch ship` composed it, with the records the line cites and their impact (spc-2610170635097509).
The digest travels inside the binary. `launch ship` appends the release it cuts to the file a repository declares under `release.digest`, and abcd's own declaration is this package's digest.json, which go:embed carries into the binary built from the release's tag. So a binary holds every release up to and including its own, and says what changed in an update without reading the repository it runs in or the network. The `.abcd/` namespace never reaches a released binary, which is why the file lives here.
The embedded file is read as strictly as any other embedded default: one JSON document, no unknown field, no repeated key, nothing after it, capped in size, every version exactly a release tag, and every line sanitised again on read.
Index ¶
Constants ¶
const ( // MaxBytes caps the document, for the reader here and for the cut's read // of the file it appends to. The seed is a few hundred KiB and a release // adds tens; the cap leaves years of headroom and bounds a file that has // grown wrong. MaxBytes = 8 << 20 )
const SchemaVersion = 1
SchemaVersion is the digest document's schema version. A document from a newer schema is refused, never half-read.
Variables ¶
var ErrNotReleaseTag = errors.New("not a release tag of the form vMAJOR.MINOR.PATCH")
ErrNotReleaseTag is Range's refusal of a version that is not exactly a release tag; a dev build takes no part.
Functions ¶
Types ¶
type Digest ¶
type Digest struct {
Releases []Release
// contains filtered or unexported fields
}
Digest is the whole document, releases newest first.
func (*Digest) Range ¶
Range returns the releases after from up to and including to, walking the chain of base tags down from to. A release the chain reaches that the digest does not carry stops the walk and is named in the gap, with where its notes are published, and the summary is partial. from "" means the running release alone; a from at or above to is an empty range. Either version must be exactly a release tag.
type Entry ¶
Entry is one changelog line, stored once with every record it cites. Line is the line's wording without the citation suffix the cut appends.
func (Entry) NeedsAction ¶
NeedsAction reports whether the entry asks the person to act: any record it cites is breaking (the changelog states a break as an Added line, so the impact, not the section, is the signal).
type Gap ¶
type Gap struct {
After string `json:"after,omitempty"`
Through string `json:"through"`
NotesURL string `json:"notes_url"`
ReleasesURL string `json:"releases_url"`
}
Gap names what a range cannot describe: the release Through, and any release after After below it, which the chain cannot list. NotesURL is where Through's release notes are published, ReleasesURL where every release's are. Nothing in a gap is guessed.
type Impact ¶
type Impact string
Impact is a cited record's declared impact. Only the three that earn a changelog line appear: an internal record is never cited.
type Release ¶
type Release struct {
Tag string `json:"tag"`
BaseTag string `json:"base_tag"`
Entries []Entry `json:"entries"`
}
Release is one cut release: its tag, the tag it was cut from ("" for the first release a repository cut), and its lines in the CHANGELOG's order.
func (Release) NeedsAction ¶
NeedsAction counts the release's entries that need the person to act.
type Summary ¶
type Summary struct {
From string `json:"from,omitempty"`
To string `json:"to"`
Releases []Release `json:"releases"`
Gap *Gap `json:"gap,omitempty"`
Partial bool `json:"partial"`
}
Summary is a range of releases: those the digest describes, newest first with each release's entries needing action first, and the gap, if any. Partial is true exactly when there is a gap.