consignment

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package consignment provides functionality for managing consignments in Shipyard projects. A consignment represents a set of changes made to one or more packages and is used to track changes for release management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeType

type ChangeType string

ChangeType represents the type of change in a consignment

type Consignment

type Consignment struct {
	ID       string            `json:"id"`
	Packages map[string]string `json:"packages"` // package name -> change type
	Summary  string            `json:"summary"`
	Created  time.Time         `json:"created"`
}

Consignment represents a set of changes made to packages

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles consignment operations

func NewManager

func NewManager(projectConfig *config.ProjectConfig) *Manager

NewManager creates a new consignment manager

func NewManagerWithDir

func NewManagerWithDir(projectConfig *config.ProjectConfig, dir string) *Manager

NewManagerWithDir creates a new consignment manager with a custom directory

func (*Manager) ApplyConsignments

func (m *Manager) ApplyConsignments() (map[string]*semver.Version, error)

ApplyConsignments calculates and applies version updates to all packages, then clears consignments

func (*Manager) ApplyConsignmentsWithTemplate

func (m *Manager) ApplyConsignmentsWithTemplate(templateName string) (map[string]*semver.Version, error)

ApplyConsignmentsWithTemplate calculates and applies version updates, records shipment history, then clears consignments

func (*Manager) ApplyConsignmentsWithTemplateAndTags

func (m *Manager) ApplyConsignmentsWithTemplateAndTags(templateName string, gitTags map[string]string) (map[string]*semver.Version, error)

ApplyConsignmentsWithTemplateAndTags calculates and applies version updates, records shipment history with git tags, then clears consignments

func (*Manager) ApplyVersionUpdatesAndClearConsignments

func (m *Manager) ApplyVersionUpdatesAndClearConsignments(versions map[string]*semver.Version) error

ApplyVersionUpdatesAndClearConsignments applies version updates and clears consignments

func (*Manager) CalculateAllVersions

func (m *Manager) CalculateAllVersions() (map[string]*semver.Version, error)

CalculateAllVersions calculates the next version for all packages in the project

func (*Manager) CalculateNextVersion

func (m *Manager) CalculateNextVersion(pkgName string) (*semver.Version, error)

CalculateNextVersion calculates the next version for a package based on its consignments

func (*Manager) ClearConsignments

func (m *Manager) ClearConsignments() error

ClearConsignments removes all consignment files from the consignment directory

func (*Manager) CreateConsignment

func (m *Manager) CreateConsignment(packages []string, changeType string, summary string) (*Consignment, error)

CreateConsignment creates a new consignment with the specified packages, change type, and summary

func (*Manager) EnsureConsignmentDir

func (m *Manager) EnsureConsignmentDir() error

EnsureConsignmentDir creates the consignment directory if it doesn't exist

func (*Manager) GetAvailableChangeTypes

func (m *Manager) GetAvailableChangeTypes() []config.ChangeTypeConfig

GetAvailableChangeTypes returns the available change types from the project configuration

func (*Manager) GetAvailablePackages

func (m *Manager) GetAvailablePackages() []config.Package

GetAvailablePackages returns the list of available packages based on the project configuration

func (*Manager) GetChangeTypeConfig

func (m *Manager) GetChangeTypeConfig(changeTypeName string) *config.ChangeTypeConfig

GetChangeTypeConfig returns the configuration for a specific change type

func (*Manager) GetConsignmens

func (m *Manager) GetConsignmens() ([]*Consignment, error)

func (*Manager) GetConsignmentDir

func (m *Manager) GetConsignmentDir() string

GetConsignmentDir returns the consignment directory path

func (*Manager) GetConsignmentsForPackage

func (m *Manager) GetConsignmentsForPackage(pkgName string) ([]*Consignment, error)

func (*Manager) RecordShipmentHistoryOnly

func (m *Manager) RecordShipmentHistoryOnly(templateName string) (map[string]*semver.Version, error)

RecordShipmentHistoryOnly records the shipment history without applying version updates or clearing consignments

func (*Manager) RecordShipmentHistoryWithTags

func (m *Manager) RecordShipmentHistoryWithTags(templateName string, gitTags map[string]string) (map[string]*semver.Version, error)

RecordShipmentHistoryWithTags records the shipment history with git tags without applying version updates or clearing consignments

func (*Manager) UpdatePackageVersion

func (m *Manager) UpdatePackageVersion(pkgName string, version *semver.Version) error

UpdatePackageVersion updates the version of a package using its ecosystem handler

func (*Manager) ValidateChangeType

func (m *Manager) ValidateChangeType(changeTypeName string) error

ValidateChangeType validates if a change type is supported

Jump to

Keyboard shortcuts

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