Something went wrong. Try again.
Monorepo for Tangled tangled.org
Something went wrong. Try again.
Go
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768package models
import ( "time"
"github.com/bluesky-social/indigo/atproto/syntax"
"tangled.org/core/api/tangled")
type Pipeline struct { RepoDid syntax.DID Workflows map[Engine][]Workflow // whether the code being ran was checked out from RepoDid itself TrustedSource bool // used to resolve cache hash files against the checkout the workflow builds TriggerMetadata *tangled.Pipeline_TriggerMetadata // mint after slot acquisition, unrecordable runs return ("", nil), errors abort the workflow MintIDToken func(workflowTimeBudget time.Duration, audience string) (string, error)}
func TrustedPipelineSource(metadata *tangled.Pipeline_TriggerMetadata, target string) bool { targetDid, err := syntax.ParseDID(target) if err != nil || metadata == nil || metadata.Repo == nil || metadata.Repo.RepoDid == nil { return false } checkoutDid, err := syntax.ParseDID(*metadata.Repo.RepoDid) if err != nil || checkoutDid != targetDid { return false } if metadata.SourceRepo != nil { sourceDid, err := syntax.ParseDID(*metadata.SourceRepo) if err != nil || sourceDid != checkoutDid { return false } } return true}
type Step interface { Name() string Command() string Kind() StepKind}
type StepKind int
const ( // steps injected by the CI runner StepKindSystem StepKind = iota // steps defined by the user in the original pipeline StepKindUser)
type Workflow struct { Steps []Step Name string Data any Environment map[string]string OwnerDID string RepoDID string RunID string Caches []CacheEntry CacheBindings []CacheBinding CacheNamespace string Engine string Audience string}