Documentation
¶
Overview ¶
Package resolver turns a requested source reference into a resolved, immutable revision, keeping requested, resolved, and immutable refs distinct.
Index ¶
Constants ¶
const ( VersionKindRelease = "release" // semver-parseable tag VersionKindTag = "tag" // non-semver tag VersionKindBranch = "branch" )
Version kinds for SourceVersion (spec 011 US3).
Variables ¶
var ErrNoMatchingVersion = errors.New("no version matches constraint")
ErrNoMatchingVersion is returned when no tag satisfies a version constraint.
Functions ¶
This section is empty.
Types ¶
type OutdatedResult ¶
OutdatedResult reports whether a newer version is available for a skill.
func Outdated ¶
func Outdated(ctx context.Context, runner git.Runner, ref source.Ref, req Requested, current Revision) (OutdatedResult, error)
Outdated reports available updates for a skill given its current locked revision and the requested constraint, with semantics that depend on the pin type (FR-009, design §9.2). Commit and local pins are never outdated; semver and tag pins compare against the highest satisfying tag; branch pins compare the branch head commit.
type RefKind ¶
type RefKind string
RefKind records how a requested reference was resolved to a revision.
const ( RefKindSemver RefKind = "semver" RefKindTag RefKind = "tag" RefKindBranch RefKind = "branch" RefKindCommit RefKind = "commit" RefKindLocal RefKind = "local" )
Ref kinds (FR-009, FR-010). semver, tag, and commit are immutable; branch and local are mutable.
type Requested ¶
type Requested struct {
Version string // semver constraint
Ref string // branch or tag
Commit string // explicit commit
}
Requested is the human's version intent (at most one field drives resolution).
type Revision ¶
type Revision struct {
RefKind RefKind
Version string
Tag string
Branch string
Commit string
MutableRef bool
}
Revision is the resolved, possibly-immutable identity to pin (FR-009, FR-010).
func Resolve ¶
func Resolve(ctx context.Context, runner git.Runner, ref source.Ref, req Requested) (Revision, []string, error)
Resolve turns a source reference plus requested version into a Revision, returning any advisory warnings (e.g. mutable refs, SC-008). Git sources report the ls-remote round-trip through the context progress sink, so every caller gets resolve progress without emitting its own.
type SourceVersion ¶ added in v0.3.0
SourceVersion is one selectable version of a git source.
func ListVersions ¶ added in v0.3.0
ListVersions lists a source's selectable versions: release tags in descending semver order, then other tags, then branch heads. Listing failures are returned to the caller — the app layer decides how to degrade (FR-012); the resolver only reports.