Documentation
¶
Overview ¶
Package relplan reads what a repository has merged and not yet released, and how its releases have been spaced, from the machine alone (ADR-064).
The Work board's release column asks two questions: what is waiting to ship, and how often does this repository ship. Both are answered from git as it stands on this machine: the CHANGELOG's Unreleased section on the remote's default branch (`git show origin/HEAD:CHANGELOG.md`) and the newest tags. Nothing here fetches: the answer is only as fresh as the user's last `git fetch`, and the board says so. No release time is predicted; the median gap is a measured spacing, shown as one.
Index ¶
- Constants
- Variables
- func Ahead(ctx context.Context, dir, tag, rev string) (int, error)
- func Changelog(ctx context.Context, dir, rev string) ([]byte, bool)
- func DefaultRef(ctx context.Context, dir string) (ref, sha string, err error)
- func MedianGap(tags []Tag) (int64, int)
- func OriginURL(ctx context.Context, dir string) (string, error)
- type Tag
- type Unreleased
Constants ¶
const ( // MaxItems is how many [Unreleased] entries are returned; the count // says how many there are. MaxItems = 30 // TagsRead is how many of the newest tags are read: ten gaps. TagsRead = 11 // MinGaps is how many gaps between releases a median needs (rule 6): // with fewer, the spacing is anecdote, not a measure. MinGaps = 3 )
Variables ¶
var ErrNoRef = errors.New("no remote default branch known locally")
ErrNoRef is returned when the clone has no remote default branch known locally (no refs/remotes/origin/HEAD).
Functions ¶
func DefaultRef ¶
DefaultRef is the remote default branch as this clone knows it, "origin/main", and its commit. It reads refs only; it never fetches.
Types ¶
type Tag ¶
Tag is one tag and when it was made (unix ms): an annotated tag's own date, else its commit's.
type Unreleased ¶
type Unreleased struct {
// Items are the first lines of its top-level bullets, in order, at most
// MaxItems; nested bullets and sub-headings are not items.
Items []string
// Count is how many top-level bullets the section has.
Count int
}
Unreleased is the CHANGELOG's Unreleased section, summed up.
func ParseUnreleased ¶
func ParseUnreleased(changelog []byte) (Unreleased, bool)
ParseUnreleased reads the Unreleased section of a Keep a Changelog file. ok is false when there is no such section; an empty section is ok with no items. The heading may carry more after the bracket ("## Unreleased - …"), and CRLF line ends read as LF.