release

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package release owns the local durable boundary for release idempotency, audit records, protected version snapshots, and rollback previews.

Index

Constants

This section is empty.

Variables

View Source
var ErrCorrupt = errors.New("release audit store is corrupt")
View Source
var ErrIdempotencyConflict = errors.New("idempotency key conflicts with a different request")
View Source
var ErrNotFound = errors.New("release not found")
View Source
var ErrPreviewNotFound = errors.New("rollback preview not found")

Functions

func NewID

func NewID() string

Types

type AuditState

type AuditState struct {
	RemoteETag string          `json:"remote_etag"`
	Version    string          `json:"version"`
	ObservedAt time.Time       `json:"observed_at"`
	Summary    *remote.Summary `json:"summary"`
}

type Release

type Release struct {
	ReleaseID           string             `json:"release_id"`
	EnvironmentID       string             `json:"environment_id"`
	Kind                string             `json:"kind"`
	Outcome             string             `json:"outcome"`
	CreatedAt           time.Time          `json:"created_at"`
	CompletedAt         time.Time          `json:"completed_at"`
	OperationID         string             `json:"operation_id"`
	RemoteState         string             `json:"remote_state"`
	SemanticSummary     string             `json:"semantic_summary"`
	RiskSummary         string             `json:"risk_summary"`
	PlanID              string             `json:"plan_id,omitempty"`
	RollbackOfReleaseID string             `json:"rollback_of_release_id,omitempty"`
	SourceDigest        string             `json:"source_digest,omitempty"`
	PlanDigest          string             `json:"plan_digest,omitempty"`
	RemoteBefore        AuditState         `json:"remote_before"`
	RemoteAfter         *AuditState        `json:"remote_after,omitempty"`
	Failure             *operation.Failure `json:"failure,omitempty"`
}

type RollbackPreview

type RollbackPreview struct {
	RollbackPreviewID        string          `json:"rollback_preview_id"`
	EnvironmentID            string          `json:"environment_id"`
	TargetReleaseID          string          `json:"target_release_id"`
	TargetRemoteVersion      string          `json:"target_remote_version"`
	Status                   string          `json:"status"`
	ExpectedRemoteETag       string          `json:"expected_remote_etag"`
	CreatedAt                time.Time       `json:"created_at"`
	ExpiresAt                time.Time       `json:"expires_at"`
	InvalidationReason       string          `json:"invalidation_reason,omitempty"`
	CurrentRemote            AuditState      `json:"current_remote"`
	SemanticChanges          json.RawMessage `json:"semantic_changes"`
	RemoteParameterChanges   json.RawMessage `json:"remote_parameter_changes"`
	Severity                 string          `json:"severity"`
	RiskItems                json.RawMessage `json:"risk_items"`
	BlockingReasons          json.RawMessage `json:"blocking_reasons"`
	ConfirmationRequirements json.RawMessage `json:"confirmation_requirements"`
}

RollbackPreview is the durable immutable read model consumed by the rollback confirmation endpoint. Its target template is held separately in disk.PrivateTemplates and is never included here.

type Store

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

func Open

func Open(path string) (*Store, error)

func (*Store) Get

func (s *Store) Get(id string) (Release, bool, error)

func (*Store) InvalidatePreview

func (s *Store) InvalidatePreview(id, reason string) error

func (*Store) List

func (s *Store) List(environmentID string, limit int, cursor string) ([]Release, error)

func (*Store) Lookup

func (s *Store) Lookup(environmentID, key, digest string) (string, bool, error)

func (*Store) LookupAction

func (s *Store) LookupAction(environmentID, action, key, digest string) (string, bool, error)

func (*Store) Preview

func (s *Store) Preview(environmentID, targetID string) (RollbackPreview, error)

func (*Store) PreviewByID

func (s *Store) PreviewByID(id string) (RollbackPreview, error)

func (*Store) Reserve

func (s *Store) Reserve(environmentID, key, digest, operationID string) (string, error)

Reserve maps one environment/action/key to one durable Operation. The caller serializes operation creation with this call, making the mapping atomic at the application boundary without exposing credentials or request bodies.

func (*Store) ReserveAction

func (s *Store) ReserveAction(environmentID, action, key, digest, operationID string) (string, error)

func (*Store) Save

func (s *Store) Save(value Release) error

func (*Store) SavePreview

func (s *Store) SavePreview(value RollbackPreview) error

func (*Store) SaveWithTemplate

func (s *Store) SaveWithTemplate(value Release, template []byte) error

func (*Store) Template

func (s *Store) Template(id string) ([]byte, error)

Jump to

Keyboard shortcuts

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