stages

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BumpOnFileChangeStrategy

type BumpOnFileChangeStrategy struct {
	CheckFunc func(p processor.Processor) bool
}

BumpOnFileChangeStrategy bumps epoch only when actual file changes are made

func (*BumpOnFileChangeStrategy) CalculateNewEpoch

func (b *BumpOnFileChangeStrategy) CalculateNewEpoch(p processor.Processor) int64

func (*BumpOnFileChangeStrategy) GetReason

func (b *BumpOnFileChangeStrategy) GetReason() string

func (*BumpOnFileChangeStrategy) ShouldUpdateEpoch

func (b *BumpOnFileChangeStrategy) ShouldUpdateEpoch(p processor.Processor) bool

type BumpOnSecurityFixStrategy

type BumpOnSecurityFixStrategy struct {
	CheckFunc func(p processor.Processor) bool
	// CommentFunc, when set, composes the inline intent comment written on
	// the epoch line (e.g. "updated bumps; fixes: ..."). Empty result or nil
	// func leaves the epoch line comment-free.
	CommentFunc func(p processor.Processor) string
}

BumpOnSecurityFixStrategy bumps epoch by 1 for security fixes

func (*BumpOnSecurityFixStrategy) CalculateNewEpoch

func (b *BumpOnSecurityFixStrategy) CalculateNewEpoch(p processor.Processor) int64

func (*BumpOnSecurityFixStrategy) EpochComment added in v0.3.0

EpochComment implements epochCommenter.

func (*BumpOnSecurityFixStrategy) GetReason

func (b *BumpOnSecurityFixStrategy) GetReason() string

func (*BumpOnSecurityFixStrategy) ShouldUpdateEpoch

func (b *BumpOnSecurityFixStrategy) ShouldUpdateEpoch(p processor.Processor) bool

type CompositeEpochStrategy

type CompositeEpochStrategy struct {
	Strategies []EpochStrategy
}

CompositeEpochStrategy combines multiple strategies with priority order

func (*CompositeEpochStrategy) CalculateNewEpoch

func (c *CompositeEpochStrategy) CalculateNewEpoch(p processor.Processor) int64

func (*CompositeEpochStrategy) GetReason

func (c *CompositeEpochStrategy) GetReason() string

func (*CompositeEpochStrategy) ShouldUpdateEpoch

func (c *CompositeEpochStrategy) ShouldUpdateEpoch(p processor.Processor) bool

type EpochStage

type EpochStage struct {
	processor.BaseStage
	Strategy EpochStrategy
}

EpochStage handles epoch updates using a configurable strategy

func NewEpochStage

func NewEpochStage(strategy EpochStrategy) *EpochStage

NewEpochStage creates a new epoch stage with the given strategy

func (*EpochStage) Apply

func (*EpochStage) ShouldRun

func (e *EpochStage) ShouldRun(ctx context.Context, p processor.Processor) (bool, error)

type EpochStrategy

type EpochStrategy interface {
	ShouldUpdateEpoch(p processor.Processor) bool
	CalculateNewEpoch(p processor.Processor) int64
	GetReason() string
}

EpochStrategy defines how epoch should be handled

type FileWriterStage

type FileWriterStage struct {
	processor.BaseStage
	CreateBackup bool
	BackupSuffix string
}

FileWriterStage handles writing changes to disk

func NewFileWriterStage

func NewFileWriterStage(createBackup bool, backupSuffix string) *FileWriterStage

NewFileWriterStage creates a new file writer stage

func (*FileWriterStage) Apply

func (*FileWriterStage) ShouldRun

func (f *FileWriterStage) ShouldRun(ctx context.Context, p processor.Processor) (bool, error)

func (*FileWriterStage) Validate

type ResetOnVersionChangeStrategy

type ResetOnVersionChangeStrategy struct{}

ResetOnVersionChangeStrategy resets epoch to 0 when version changes

func (*ResetOnVersionChangeStrategy) CalculateNewEpoch

func (r *ResetOnVersionChangeStrategy) CalculateNewEpoch(p processor.Processor) int64

func (*ResetOnVersionChangeStrategy) GetReason

func (r *ResetOnVersionChangeStrategy) GetReason() string

func (*ResetOnVersionChangeStrategy) ShouldUpdateEpoch

func (r *ResetOnVersionChangeStrategy) ShouldUpdateEpoch(p processor.Processor) bool

type ValidationStage

type ValidationStage struct {
	processor.BaseStage
	ValidateOriginal bool // Also validate original YAML
	ValidateCurrent  bool // Validate current YAML
}

ValidationStage validates YAML syntax and structure

func NewValidationStage

func NewValidationStage(validateOriginal, validateCurrent bool) *ValidationStage

NewValidationStage creates a new validation stage

func (*ValidationStage) Apply

func (*ValidationStage) ShouldRun

func (v *ValidationStage) ShouldRun(ctx context.Context, p processor.Processor) (bool, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL