Documentation
¶
Overview ¶
Package tiers computes a release order over a set of local package checkouts by parsing their manifests and layering the induced dependency graph. Tier 0 has no in-set dependencies; tier N depends only on tiers below N.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Version = "dev"
Version is set at build time via ldflags. When unset (go install, go build without -ldflags), init falls back to the module version embedded by the Go toolchain.
Functions ¶
This section is empty.
Types ¶
type BumpResult ¶
type BumpResult struct {
Package Package
Dep string
Version string
Manager string
// Commands holds every command the manager ran for this bump, in
// order: the primary command followed by any then: chain steps.
Commands [][]string
ExitCode int
Stderr string
Err error
}
BumpResult records one attempted dependency bump.
type Bumper ¶
type Bumper struct {
// contains filtered or unexported fields
}
Bumper applies version bumps to packages in a Graph via the managers library.
func NewBumper ¶
NewBumper builds a Bumper backed by the given Runner. Pass managers.NewExecRunner() to actually execute commands, or managers.NewMockRunner() to capture them.
func (*Bumper) Bump ¶
func (b *Bumper) Bump(ctx context.Context, g *Graph, targets map[string]string) ([]BumpResult, error)
Bump updates each package's in-set dependencies to the versions given in targets. targets is keyed by dependency Name (e.g. "github.com/git-pkgs/purl" or "base"). A dependency without a target is left alone. Packages are visited in tier order so lower tiers are bumped before their dependents, though each Add operates only on that package's own directory.
type CycleError ¶
type CycleError struct {
Members []Package
}
CycleError is returned by Tiers when the graph contains a dependency cycle. Members holds only the packages that participate in a cycle, not packages that merely depend on one.
func (*CycleError) Error ¶
func (e *CycleError) Error() string
type DuplicateError ¶
DuplicateError is returned by Discover when two input directories declare the same package identity.
func (*DuplicateError) Error ¶
func (e *DuplicateError) Error() string
type ErrUnsupportedEcosystem ¶
type ErrUnsupportedEcosystem struct {
Ecosystem string
}
ErrUnsupportedEcosystem is returned by Bump when the graph contains a package whose ecosystem has no manager mapping.
func (*ErrUnsupportedEcosystem) Error ¶
func (e *ErrUnsupportedEcosystem) Error() string
type Graph ¶
type Graph struct {
Packages []Package
}
Graph is the induced dependency graph over the input directories.
func Discover ¶
Discover parses the manifests in each directory and returns the induced dependency graph over the resulting packages. A directory contributes one Package per manifest that declares its own name; a manifest with dependencies but no self-name (Gemfile, requirements.txt) contributes a Package named after the directory.
func (*Graph) Ecosystems ¶
Ecosystems returns the sorted set of ecosystems present in the graph.
type Package ¶
type Package struct {
// Dir is the directory containing Manifest. For workspace members it
// is the member directory, not the workspace root.
Dir string
Ecosystem string
Name string
// Manifest is the filename (no directory component) of the manifest
// this package was parsed from, inside Dir.
Manifest string
// Deps holds the Names of other packages in the same graph that this
// package depends on directly.
Deps []string
}
Package is one publishable unit discovered from a manifest.