provider

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaVersion = "v1"

Variables

This section is empty.

Functions

func ResolveReferences

func ResolveReferences(value string, resolved map[domain.ItemID]RemoteRef) (string, error)

func UniqueSorted added in v0.16.4

func UniqueSorted(values []string) []string

UniqueSorted returns the distinct non-empty values in sorted order, so label sets stay stable across plans and therefore keep the plan digest stable.

Types

type Adapter

type Adapter interface {
	ID() string
	Plan(context.Context, PlanInput, config.Target) ([]Operation, []string, error)
	// Resolve reports which of the given operations already exist remotely, keyed by
	// idempotency key. Apply calls it once with the operations a receipt has not already
	// accounted for, so an adapter can search for exactly the work that remains.
	Resolve(context.Context, config.Target, *Plan, []Operation) (map[string]RemoteRef, error)
	Execute(context.Context, config.Target, Operation, map[domain.ItemID]RemoteRef) (RemoteRef, error)
}

type Operation

type Operation struct {
	ID             string         `yaml:"id" json:"id"`
	Action         string         `yaml:"action" json:"action"`
	ItemID         domain.ItemID  `yaml:"item_id" json:"item_id"`
	DependsOn      []string       `yaml:"depends_on,omitempty" json:"depends_on,omitempty"`
	IdempotencyKey string         `yaml:"idempotency_key" json:"idempotency_key"`
	Summary        string         `yaml:"summary" json:"summary"`
	Fields         map[string]any `yaml:"fields" json:"fields"`
}

type OperationResult

type OperationResult struct {
	Status string        `yaml:"status" json:"status"`
	ItemID domain.ItemID `yaml:"item_id" json:"item_id"`
	Remote *RemoteRef    `yaml:"remote,omitempty" json:"remote,omitempty"`
	Error  string        `yaml:"error,omitempty" json:"error,omitempty"`
}

type Plan

type Plan struct {
	SchemaVersion string        `yaml:"schema_version" json:"schema_version"`
	ID            string        `yaml:"id" json:"id"`
	Provider      string        `yaml:"provider" json:"provider"`
	TargetName    string        `yaml:"target" json:"target"`
	Target        config.Target `yaml:"target_config" json:"target_config"`
	DiscoveryID   string        `yaml:"discovery_id" json:"discovery_id"`
	BundlePath    string        `yaml:"bundle_path" json:"bundle_path"`
	SourceDigest  string        `yaml:"source_digest" json:"source_digest"`
	PlanDigest    string        `yaml:"plan_digest" json:"plan_digest"`
	GeneratedAt   time.Time     `yaml:"generated_at" json:"generated_at"`
	Warnings      []string      `yaml:"warnings,omitempty" json:"warnings,omitempty"`
	Operations    []Operation   `yaml:"operations" json:"operations"`
}

type PlanInput added in v0.16.5

type PlanInput struct {
	WorkBreakdown *domain.WorkBreakdown
	// DocumentURL resolves the discovery document for a reader, empty when no URL can be built.
	DocumentURL string
	// TrackingURL is the issue the discovery document links from its title, empty when absent.
	TrackingURL string
}

PlanInput carries the bundle and everything derived from its surroundings that planning needs. The derived fields are best-effort: a bundle outside a GitHub checkout has no document URL, and a discovery document that links no tracking issue has no tracking URL.

type Receipt

type Receipt struct {
	SchemaVersion string                     `yaml:"schema_version" json:"schema_version"`
	PlanID        string                     `yaml:"plan_id" json:"plan_id"`
	Provider      string                     `yaml:"provider" json:"provider"`
	TargetName    string                     `yaml:"target" json:"target"`
	PlanDigest    string                     `yaml:"plan_digest" json:"plan_digest"`
	Status        string                     `yaml:"status" json:"status"`
	UpdatedAt     time.Time                  `yaml:"updated_at" json:"updated_at"`
	Operations    map[string]OperationResult `yaml:"operations" json:"operations"`
}

type RemoteRef

type RemoteRef struct {
	ID   string `yaml:"id" json:"id"`
	Key  string `yaml:"key,omitempty" json:"key,omitempty"`
	URL  string `yaml:"url" json:"url"`
	Type string `yaml:"type" json:"type"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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