Documentation
¶
Index ¶
- Variables
- func Register(cfg *Config)
- func Unregister()
- type Config
- type ReleaseGate
- type ReleaseGatePlugin
- func (p *ReleaseGatePlugin) Description() string
- func (p *ReleaseGatePlugin) GetConfig() *Config
- func (p *ReleaseGatePlugin) IsEnabled() bool
- func (p *ReleaseGatePlugin) Name() string
- func (p *ReleaseGatePlugin) ValidateRelease(newVersion, previousVersion semver.SemVersion, bumpType string) error
- func (p *ReleaseGatePlugin) Version() string
Constants ¶
This section is empty.
Variables ¶
var GetReleaseGateFn = func() ReleaseGate {
return defaultReleaseGate
}
GetReleaseGateFn allows overriding the getter function for testing.
var RegisterReleaseGateFn = func(rg ReleaseGate) {
defaultReleaseGate = rg
}
RegisterReleaseGateFn allows overriding the registration function for testing.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Enabled controls whether the plugin is active.
Enabled bool
// RequireCleanWorktree blocks bumps if git has uncommitted changes.
RequireCleanWorktree bool
// RequireCIPass checks CI status before allowing bumps (disabled by default).
RequireCIPass bool
// BlockedOnWIPCommits blocks if recent commits contain WIP/fixup/squash.
BlockedOnWIPCommits bool
// AllowedBranches lists branches where bumps are allowed (empty = all allowed).
AllowedBranches []string
// BlockedBranches lists branches where bumps are never allowed.
BlockedBranches []string
}
Config holds configuration for the release gate plugin.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default release gate configuration.
type ReleaseGate ¶
type ReleaseGate interface {
Name() string
Description() string
Version() string
ValidateRelease(newVersion, previousVersion semver.SemVersion, bumpType string) error
}
ReleaseGate defines the interface for release gate validation.
type ReleaseGatePlugin ¶
type ReleaseGatePlugin struct {
// contains filtered or unexported fields
}
ReleaseGatePlugin implements the ReleaseGate interface.
func NewReleaseGate ¶
func NewReleaseGate(cfg *Config) *ReleaseGatePlugin
NewReleaseGate creates a new ReleaseGatePlugin instance.
func (*ReleaseGatePlugin) Description ¶
func (p *ReleaseGatePlugin) Description() string
Description returns a brief description of the plugin.
func (*ReleaseGatePlugin) GetConfig ¶
func (p *ReleaseGatePlugin) GetConfig() *Config
GetConfig returns the plugin configuration.
func (*ReleaseGatePlugin) IsEnabled ¶
func (p *ReleaseGatePlugin) IsEnabled() bool
IsEnabled returns true if the plugin is enabled.
func (*ReleaseGatePlugin) Name ¶
func (p *ReleaseGatePlugin) Name() string
Name returns the plugin name.
func (*ReleaseGatePlugin) ValidateRelease ¶
func (p *ReleaseGatePlugin) ValidateRelease(newVersion, previousVersion semver.SemVersion, bumpType string) error
ValidateRelease checks if a version bump is allowed based on configured gates.
func (*ReleaseGatePlugin) Version ¶
func (p *ReleaseGatePlugin) Version() string
Version returns the plugin version.