Help us shape the future of Go! Take the 2026 Go Developer Survey

gitops

package
v0.2.47 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PatchManifest

func PatchManifest(content []byte, pointer, expected, desired string) ([]byte, error)

func ReadManifestField

func ReadManifestField(content []byte, pointer string) (string, error)

Types

type Configuration

type Configuration struct {
	Environment           string   `json:"environment"`
	SourceRepositoryID    string   `json:"source_repository_id"`
	DeliveryRepositoryID  string   `json:"delivery_repository_id"`
	Version               int64    `json:"version"`
	Enabled               bool     `json:"enabled"`
	TargetBranch          string   `json:"target_branch"`
	ManifestPath          string   `json:"manifest_path"`
	Pointer               string   `json:"pointer"`
	ImageRepository       string   `json:"image_repository"`
	ProvenancePublicKey   string   `json:"provenance_public_key"`
	HealthPublicKey       string   `json:"health_public_key"`
	HealthChecks          []string `json:"health_checks"`
	BuildWorkflowPath     string   `json:"build_workflow_path,omitempty"`
	BuildWorkflowSHA256   string   `json:"build_workflow_sha256,omitempty"`
	ObservationSeconds    int64    `json:"observation_seconds"`
	MaxEvidenceAgeSeconds int64    `json:"max_evidence_age_seconds"`
	DeadlineSeconds       int64    `json:"deadline_seconds"`
	RecoveryAllowed       bool     `json:"recovery_allowed"`
	PromoteFrom           string   `json:"promote_from,omitempty"`
}

type Detail

type Detail struct {
	Promotion Promotion     `json:"promotion"`
	Gate      Gate          `json:"gate"`
	Health    *HealthReport `json:"health,omitempty"`
}

type Gate

type Gate struct {
	ID                        string         `json:"id"`
	OperationID               string         `json:"operation_id"`
	Configuration             Configuration  `json:"configuration"`
	Request                   PreviewRequest `json:"request"`
	Source                    forge.RepoRef  `json:"source"`
	Delivery                  forge.RepoRef  `json:"delivery"`
	SourceConnectionID        string         `json:"source_connection_id"`
	DeliveryConnectionID      string         `json:"delivery_connection_id"`
	SourceConnectionVersion   int64          `json:"source_connection_version"`
	DeliveryConnectionVersion int64          `json:"delivery_connection_version"`
	SourcePolicyHash          string         `json:"source_policy_hash"`
	DeliveryPolicyHash        string         `json:"delivery_policy_hash"`
	TargetSHA                 string         `json:"target_sha"`
	Before                    string         `json:"before"`
	After                     string         `json:"after"`
	ManifestSHA256            string         `json:"manifest_sha256"`
	PatchedManifest           []byte         `json:"patched_manifest"`
	Decision                  policy.Result  `json:"decision"`
	Blockers                  []string       `json:"blockers"`
	ExpiresAt                 time.Time      `json:"expires_at"`
}

type HealthReport

type HealthReport struct {
	OrgID                string          `json:"org_id"`
	PromotionID          string          `json:"promotion_id"`
	Environment          string          `json:"environment"`
	ConfigurationVersion int64           `json:"configuration_version"`
	SourceSHA            string          `json:"source_sha"`
	ArtifactDigest       string          `json:"artifact_digest"`
	DeliveryRevision     string          `json:"delivery_revision"`
	Healthy              bool            `json:"healthy"`
	Checks               map[string]bool `json:"checks"`
	ObservedAt           time.Time       `json:"observed_at"`
	Nonce                string          `json:"nonce"`
}

type PreviewRequest

type PreviewRequest struct {
	ChangeID           string                      `json:"change_id"`
	SourceSHA          string                      `json:"source_sha"`
	ArtifactDigest     string                      `json:"artifact_digest"`
	Provenance         deployment.SignedProvenance `json:"provenance"`
	RecoveryOf         string                      `json:"recovery_of,omitempty"`
	RestorePromotionID string                      `json:"restore_promotion_id,omitempty"`
}

type Promotion

type Promotion struct {
	CancelRequested      bool          `json:"cancel_requested"`
	ID                   string        `json:"id"`
	Environment          string        `json:"environment"`
	SourceRepositoryID   string        `json:"source_repository_id"`
	DeliveryRepositoryID string        `json:"delivery_repository_id"`
	GateID               string        `json:"gate_id"`
	State                string        `json:"state"`
	Reason               string        `json:"reason"`
	Version              int64         `json:"version"`
	RequestedBy          string        `json:"requested_by"`
	Branch               string        `json:"branch"`
	CandidateSHA         string        `json:"candidate_sha"`
	Change               *forge.Change `json:"change,omitempty"`
	MergeSHA             string        `json:"merge_sha"`
	RecoveryOf           string        `json:"recovery_of,omitempty"`
	CreatedAt            time.Time     `json:"created_at"`
	UpdatedAt            time.Time     `json:"updated_at"`
	FinishedAt           *time.Time    `json:"finished_at,omitempty"`
}

type Service

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

func New

func New(db *store.Store, identity *auth.Service, connections *connections.Service, policies *policy.Service, providers providers.Client, merges *mergecontrol.Service) *Service

func (*Service) Cancel

func (s *Service) Cancel(ctx context.Context, session auth.Session, org, id string, expected int64, request string) (Promotion, error)

func (*Service) CheckMergeTx

func (s *Service) CheckMergeTx(ctx context.Context, tx pgx.Tx, org, repo string, snapshot forge.MergeEvidence, actor domain.Actor) (string, error)

func (*Service) Configurations

func (s *Service) Configurations(ctx context.Context, session auth.Session, org string) ([]Configuration, error)

func (*Service) Continue

func (s *Service) Continue(ctx context.Context, session auth.Session, org, id, request string) (Promotion, error)

func (*Service) Get

func (s *Service) Get(ctx context.Context, session auth.Session, org, id string) (Detail, error)

func (*Service) List

func (s *Service) List(ctx context.Context, session auth.Session, org, env, cursor string, limit int) (domain.Page[Promotion], error)

func (*Service) MergePreview

func (s *Service) MergePreview(ctx context.Context, session auth.Session, org, id, method, request string) (mergecontrol.Gate, error)

func (*Service) Observe

func (s *Service) Observe(ctx context.Context, org, id string) (Promotion, error)

func (*Service) ObserveAs

func (s *Service) ObserveAs(ctx context.Context, session auth.Session, org, id string) (Promotion, error)

func (*Service) Preview

func (s *Service) Preview(ctx context.Context, session auth.Session, org, env string, in PreviewRequest, request string) (Gate, error)

func (*Service) PutConfiguration

func (s *Service) PutConfiguration(ctx context.Context, session auth.Session, org string, c Configuration, expected int64, request string) (Configuration, error)

func (*Service) ReceiveHealth

func (s *Service) ReceiveHealth(ctx context.Context, org, id string, in HealthReport, signature string) error

func (*Service) RegisterGateAuthority

func (s *Service) RegisterGateAuthority(check func(context.Context, pgx.Tx, string, string) error)

func (*Service) Request

func (s *Service) Request(ctx context.Context, session auth.Session, org, gateID, key, request string) (Promotion, error)

func (*Service) RequestMerge

func (s *Service) RequestMerge(ctx context.Context, session auth.Session, org, id, gateID, key, request string) (mergecontrol.Operation, error)

func (*Service) Run

func (s *Service) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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