Documentation
¶
Overview ¶
Package proposal renders the Release merge request: its title and its body.
The body is machine-owned output, regenerated wholesale on every run exactly like the branch it describes. Colophon never reads it back.
That is a deliberate divergence from releaser-pleaser, which takes overrides from fenced blocks in its own merge-request body. Under a fast-forward merge a merge-request body never reaches git history unless the person merging chooses to squash, and squashing is optional here rather than required — so anything colophon must still know after the merge has to live in the repository. The version override is a `Release-As:` commit trailer and the settings are in `.colophon.yaml`, both of which survive any merge method.
Rendering is pure: it takes data and returns strings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrMissingField = errors.New("release proposal: missing required field")
ErrMissingField reports a required input absent from an Input.
Functions ¶
func IsRelease ¶ added in v0.20.1
IsRelease reports whether c is the release commit TitleTags writes for target, whatever tags it names.
func Subject ¶ added in v0.5.0
Subject is the part of the title after the scope, which is what `guardAlreadyReleased` compares against the target's tip.
func Title ¶
Title is the merge request's title, and also the release commit's message so the two cannot describe different releases.
It is separate from Render because the caller needs it BEFORE the body: the release branch is committed with this message, and only once that commit exists is the base known that the body reports.
It takes the tag, not the version, because only the scheme knows how one becomes the other: rtb-error-v0.6.4 is not "v" + 0.6.4 (spec 0027 D1).
Types ¶
type Input ¶
type Input struct {
// Version is the version being proposed, with or without a leading "v".
Version string
// Tags names every tag the request proposes, root first. When set, the
// title is built from them; Version alone means one root tag.
Tags []string
// Target is the branch being released from, and names the title's scope.
Target string
// Changelog is the already-rendered changelog section.
Changelog string
// Base is the target commit the release branch was cut from, reported so a
// reader can see which state of the target the proposal describes.
Base string
// Considered is how many commits were examined to reach this decision.
Considered int
}
Input is everything the body needs. All of it is data: nothing here reads a repository or a forge.