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 PreviousReleaseTag(repoDir, currentRef string, tagPatterns []string) (string, error)
- func PushTag(repoDir, remote, tag string) 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.
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 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 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 policies.git_tags
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.
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")
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 policies.git_tags)
SecurityTile string // one-line status (e.g., "🛡️ ✅ **Passed** — no vulnerabilities")
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
Images []ImageRow // resolved registry image rows for availability table
Downloads []BinaryRow // binary/archive artifacts for downloads table
}
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
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.