Documentation
¶
Index ¶
- func IncrementVersion(currentVersionStr, versionType string) (string, error)
- func NormalizeVersion(v string) (string, error)
- type Action
- type ActionType
- type Config
- type FS
- type Git
- type Manager
- func (rm *Manager) AssessCurrentState(ctx context.Context) (*State, error)
- func (rm *Manager) CheckVersionExists(version string, modules []Module) (VersionConflictInfo, error)
- func (rm *Manager) FindModules(ctx context.Context) ([]Module, error)
- func (rm *Manager) GetCurrentGlobalVersion() string
- func (rm *Manager) GetKnownReleases(ctx context.Context) error
- func (rm *Manager) GetNextPrereleaseVersion(baseVersionStr string) (string, error)
- func (rm *Manager) RunMajor(ctx context.Context) error
- func (rm *Manager) RunMinor(ctx context.Context) error
- func (rm *Manager) RunPatch(ctx context.Context) error
- func (rm *Manager) RunPrerelease(ctx context.Context) error
- func (rm *Manager) RunRelease(ctx context.Context) error
- func (rm *Manager) ShowCurrentState(ctx context.Context) error
- func (rm *Manager) ShowPlannedActions(actions []Action)
- type Module
- type ParsedTag
- type State
- type TagCache
- type UserInteraction
- type VersionConflictInfo
- type Warning
- type WarningType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IncrementVersion ¶
IncrementVersion increments a version based on type
func NormalizeVersion ¶
NormalizeVersion ensures version has 'v' prefix and is valid semver
Types ¶
type Action ¶
type Action struct {
Type ActionType
Target string // tag name, module path
Description string
GitSHA string // for existing tags
}
Action represents a planned release action
type Config ¶
type Config struct {
RepoRoot string
ExcludedDirs []string
RequiredBranch string
Verbose bool
Command string // The subcommand being executed
SkipConfirmations bool
ManualVersion string // Manual version override
}
Config holds the release configuration
type Git ¶
type Git interface {
GetCurrentBranch(ctx context.Context) (string, error)
GetTags(ctx context.Context) ([]string, error)
CreateTag(ctx context.Context, tag string) error
PushTag(ctx context.Context, tag string) error
GetRepoRoot(ctx context.Context) (string, error)
}
Git defines git operations for testing
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles the release process
func NewReleaseManager ¶
func NewReleaseManager(config Config, git Git, fs FS, interaction UserInteraction) *Manager
func (*Manager) AssessCurrentState ¶
AssessCurrentState gathers repository state (assumes cache is already populated)
func (*Manager) CheckVersionExists ¶
func (rm *Manager) CheckVersionExists(version string, modules []Module) (VersionConflictInfo, error)
func (*Manager) FindModules ¶
FindModules discovers all Go modules in the repository
func (*Manager) GetCurrentGlobalVersion ¶
func (*Manager) GetKnownReleases ¶
GetKnownReleases fetches and parses all tags once
func (*Manager) GetNextPrereleaseVersion ¶
func (*Manager) ShowCurrentState ¶
ShowCurrentState displays current release state
func (*Manager) ShowPlannedActions ¶
ShowPlannedActions displays what actions will be performed
type ParsedTag ¶
type ParsedTag struct {
Raw string // Original tag name (e.g., "service1/v1.2.3-prerelease01")
ModulePath string // Module path (e.g., "service1", "" for root)
Version *semver.Version // Parsed semantic version
GitSHA string // Git commit SHA
IsPrerelease bool
PrereleaseNum int // Extracted prerelease number (01, 02, etc.)
}
ParsedTag represents a single parsed git tag
type State ¶
type State struct {
CurrentBranch string
Modules []Module
CurrentVersion string
TagCache *TagCache
}
State holds the current state of the repository
type TagCache ¶
type TagCache struct {
AllTags []ParsedTag
VersionTags []ParsedTag // Only valid semver tags
ModuleTags map[string][]ParsedTag // Tags grouped by module path
PrereleaseCache map[string][]int // Base version -> prerelease numbers
HighestVersion *semver.Version // Cached highest version
}
TagCache holds all parsed tag information
type UserInteraction ¶
type UserInteraction interface {
Confirm(ctx context.Context, message string) (bool, error)
ConfirmWithDefault(ctx context.Context, message string, defaultValue bool) (bool, error)
}
UserInteraction defines the interface for user interactions
type VersionConflictInfo ¶
type VersionConflictInfo struct {
ExistingTags []string // Tags that already exist
MissingTags []string // Tags that need to be created
}
VersionConflictInfo holds information about version conflicts
type Warning ¶
type Warning struct {
Type WarningType
Message string
}
Warning represents a validation warning that can be overridden
type WarningType ¶
type WarningType int
WarningType represents different types of warnings
const ( WrongBranch WarningType = iota ExistingTags )