Documentation
¶
Overview ¶
Package release handles release notes generation, release creation, and cross-platform sync.
Index ¶
- func BumpVersion(prev, kind string) (string, error)
- func CreateAnnotatedTag(repoDir, tag, targetSHA, message string) error
- func FormatHighlights(commits []ProcessedCommit, maxEntries int) string
- func GenerateNotes(input NotesInput) (string, error)
- func MessageSkipsCI(msg string) bool
- func PreviousReleaseTag(repoDir, currentRef string, tagPatterns []string) (string, error)
- func PushTag(repoDir, remote, tag string, cfg *config.Config) error
- func ResolveGitRef(repoDir, ref string) (string, error)
- type BinaryRow
- type BuildTagPlanOptions
- type Commit
- type CommitCategory
- type ImageRow
- type NotesInput
- type ProcessedCommit
- type ResolvedTag
- type TagPlan
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BumpVersion ¶ added in v0.5.0
BumpVersion computes the next version from a previous version tag. Supports both v-prefixed (v1.2.3) and bare (1.2.3) versions. The output preserves the prefix style of the input.
func CreateAnnotatedTag ¶ added in v0.5.0
CreateAnnotatedTag creates an annotated git tag on a specific commit — idempotently. A version tag is an immutable identity, so if the tag already exists and names the same commit (whether it is currently lightweight or annotated), it is left AS-IS: republish must not rewrite a lightweight tag into an annotated one, which changes the tag-object hash and reseeds a mirror divergence against a forge that kept the lightweight form. A tag that exists at a DIFFERENT commit is a real conflict and is refused rather than silently moved. Annotated is the type used whenever a version tag is freshly cut.
func FormatHighlights ¶ added in v0.5.0
func FormatHighlights(commits []ProcessedCommit, maxEntries int) string
FormatHighlights renders processed commits as bulleted highlights. Respects release_visible and max_entries from the glossary/presentation.
func GenerateNotes ¶
func GenerateNotes(input NotesInput) (string, error)
GenerateNotes produces markdown release notes from git log between two refs.
func MessageSkipsCI ¶ added in v0.8.0
MessageSkipsCI reports whether a commit message contains a CI-skip marker.
func PreviousReleaseTag ¶ added in v0.5.0
previousReleaseTag finds the most recent release tag that is an ancestor of currentRef and matches the configured tag patterns. It replaces the naive git-describe approach which matched any tag (including rolling aliases like "latest" or bare-version aliases like "0.1.0").
func PushTag ¶ added in v0.5.0
PushTag pushes a tag to the given remote. cfg binds the push credential HOST-BOUND to the forge that owns the remote's host (nil ⇒ anonymous over HTTPS / system git locally).
func ResolveGitRef ¶ added in v0.5.0
ResolveGitRef resolves any git ref to a commit SHA.
Types ¶
type BinaryRow ¶ added in v0.4.0
type BinaryRow struct {
Name string // filename (e.g., "stagefreight-linux-amd64.tar.gz")
Platform string // "linux/amd64", "darwin/arm64"
Size int64 // bytes
SHA256 string // hex-encoded checksum
}
BinaryRow is a single binary or archive artifact for the Downloads table.
type BuildTagPlanOptions ¶ added in v0.5.0
type BuildTagPlanOptions struct {
ExplicitVersion string
BumpKind string // patch | minor | major
TargetRef string // default HEAD
FromRef string // optional previous boundary override
MessageOverride string
TagPatterns []string // from versioning.tag_sources
Glossary config.GlossaryConfig
Presentation config.TagPresentation
}
BuildTagPlanOptions configures tag plan resolution.
type Commit ¶
type Commit struct {
Hash string
Type string // feat, fix, chore, etc.
Scope string // optional scope in parens
Summary string
Body string
Author string
Breaking bool
}
Commit is a parsed conventional commit.
func ParseCommits ¶ added in v0.5.0
ParseCommits extracts conventional commits from a git log range.
type CommitCategory ¶
type CommitCategory struct {
Title string // display title (e.g., "Features", "Bug Fixes")
Prefix string // conventional commit prefix (e.g., "feat", "fix")
Commits []Commit
}
CommitCategory represents a group of commits by type.
func Categorize ¶ added in v0.8.0
func Categorize(commits []Commit) []CommitCategory
Categorize groups parsed conventional commits into ordered display categories (Features, Bug Fixes, …) — the same grouping release notes use. Exported so narrate can build its Changes section from ONE changelog source: generated once, rendered many ways (summary / release body / community note).
type ImageRow ¶
type ImageRow struct {
RegistryLabel string // human label (e.g., "Docker Hub")
RegistryURL string // provider-derived repo page URL
ImageRef string // full image ref (e.g., "docker.io/prplanit/stagefreight")
Label string // optional human group label (build.label); empty → group header is the image name
Tags []ResolvedTag // resolved tags with URLs
DigestRef string // host/path@sha256:... (for pull command)
SBOM string // pull ref for SBOM artifact
Provenance string // pull ref for provenance artifact
Signature string // pull ref for signature artifact
}
ImageRow is a single registry/image row for the Image Availability table.
type NotesInput ¶
type NotesInput struct {
RepoDir string // git repository directory
FromRef string // start ref (empty = auto-detect previous tag)
ToRef string // end ref (default: HEAD)
TagPatterns []string // regex patterns for release tags (from versioning.tag_sources)
Config *config.Config // config for auto-detect version (nil = skip auto-detect)
SecurityTile string // one-line status (e.g., "✅ **Passed** — no vulnerabilities")
// ChangesLimit and ChangelogLimit bound the sections built from commit lists, in
// characters; 0 is unbounded. Bounding here is what keeps a composed body inside
// every forge's release-body cap without any forge knowing about it.
ChangesLimit int
ChangelogLimit int
SecurityBody string // full section: status line + optional <details> CVE block
TagMessage string // annotated tag message (optional, auto-detected if empty)
ProjectName string // project name (auto-detected if empty)
Version string // version string (auto-detected if empty)
SHA string // short commit hash (auto-detected if empty)
IsPrerelease bool // true if version has prerelease suffix
ReleaseType string // resolved semantic type label (latest/prerelease/stable); overrides IsPrerelease for the "Release type:" line
Images []ImageRow // resolved registry image rows for availability table
Downloads []BinaryRow // binary/archive artifacts for downloads table
Verify *trustdisclosure.Disclosure // signing/verification disclosure (nil = nothing signed)
// NotesBody is the release-notes stencil body composing this document —
// resolved by the caller from the release target's notes: reference.
// Empty = SF's shipped default body.
NotesBody string
// ResolveStencil renders a declared stencil by id for body embeds beyond the
// release elements — text compositions, AI stencils, whatever the author
// chose. The release elements are passed through so an embedded stencil (an
// AI reword of {release.changes}, say) can ingest them. Supplied by the
// caller (the stencil library lives in config); nil leaves non-release
// tokens literal.
ResolveStencil func(id string, elements map[string]string) (string, bool)
}
NotesInput holds all data needed to render release notes.
type ProcessedCommit ¶ added in v0.5.0
type ProcessedCommit struct {
Raw Commit // original parsed commit
Type string // canonical type (after alias resolution)
Priority int // from glossary + breaking boost
Breaking bool // from any detection method
Summary string // sanitized + rewritten summary
Included bool // passes release_visible filter
}
ProcessedCommit is a commit that has been through the glossary pipeline. Raw evidence preserved; sanitized and presented forms derived.
func ProcessCommits ¶ added in v0.5.0
func ProcessCommits(commits []Commit, glossary config.GlossaryConfig) []ProcessedCommit
ProcessCommits runs the full glossary pipeline on parsed commits. Pipeline: normalize → detect breaking → sanitize → rewrite → score → rank.
type ResolvedTag ¶
type ResolvedTag struct {
Name string // e.g., "1.0.0"
URL string // provider-derived tag page URL
}
ResolvedTag is a single tag with its deterministic UI URL.
type TagPlan ¶ added in v0.5.0
type TagPlan struct {
PreviousTag string
TargetRef string
TargetSHA string
// SkippedTipSHA is the original tip commit when it was a [skip ci] commit and the
// tag was walked back to a releasable ancestor (TargetSHA). Empty when the tip was
// already releasable. Surfaced so the CLI can narrate the substitution.
SkippedTipSHA string
NextTag string
Message string
CommitCount int
FilesChanged int
Insertions int
Deletions int
}
TagPlan is the fully resolved release tag plan.
func BuildTagPlan ¶ added in v0.5.0
func BuildTagPlan(repoDir string, opts BuildTagPlanOptions) (*TagPlan, error)
BuildTagPlan resolves a complete tag plan from the repo and options.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package trustdisclosure interprets a publish ResultsManifest into a STRUCTURED trust disclosure — typed facts, never pre-baked prose.
|
Package trustdisclosure interprets a publish ResultsManifest into a STRUCTURED trust disclosure — typed facts, never pre-baked prose. |