buildplan

package
v0.0.0-...-419e056 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const NamespaceInternal = "internal"

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	ArtifactID  strfmt.UUID
	DisplayName string
	MimeType    string
	URL         string
	LogURL      string
	Errors      []string
	Checksum    string
	Status      string

	Ingredients []*Ingredient `json:"-"` // While most artifacts only have a single ingredient, some artifacts such as installers can have multiple.

	IsRuntimeDependency   bool
	IsBuildtimeDependency bool
	// contains filtered or unexported fields
}

Artifact represents a downloadable artifact. This artifact may or may not be installable by the State Tool.

func (*Artifact) Dependencies

func (a *Artifact) Dependencies(recursive bool, ignore *map[strfmt.UUID]struct{}) Artifacts

Dependencies returns ALL dependencies that an artifact has, this covers runtime and build time dependencies. It does not cover test dependencies as we have no use for them in the state tool.

func (*Artifact) Licenses

func (a *Artifact) Licenses() []string

func (*Artifact) Name

func (a *Artifact) Name() string

Name returns the name of the ingredient for this artifact, if it only has exactly one ingredient associated. Otherwise it returns the DisplayName, which is less reliable and consistent.

func (*Artifact) NameAndVersion

func (a *Artifact) NameAndVersion() string

func (*Artifact) Revision

func (a *Artifact) Revision() int

Revision returns the name of the ingredient for this artifact, if it only has exactly one ingredient associated. Otherwise it returns an empty version.

func (*Artifact) RuntimeDependencies

func (a *Artifact) RuntimeDependencies(recursive bool, ignore *map[strfmt.UUID]struct{}) Artifacts

func (*Artifact) SetDownload

func (a *Artifact) SetDownload(uri string, checksum string)

SetDownload is used to update the URL and checksum of an artifact. This allows us to keep using the same artifact type, while also facilitating dressing up in-progress artifacts with their download info later on

func (*Artifact) Version

func (a *Artifact) Version() string

Version returns the name of the ingredient for this artifact, if it only has exactly one ingredient associated. Otherwise it returns an empty version.

type ArtifactChange

type ArtifactChange struct {
	ChangeType ChangeType
	Artifact   *Artifact
	Old        *Artifact // Old is only set when ChangeType=ArtifactUpdated
}

func (ArtifactChange) VersionsChanged

func (a ArtifactChange) VersionsChanged() bool

type ArtifactChangeset

type ArtifactChangeset []ArtifactChange

func (ArtifactChangeset) Filter

type ArtifactIDMap

type ArtifactIDMap map[strfmt.UUID]*Artifact

type ArtifactNameMap

type ArtifactNameMap map[string]*Artifact

type ArtifactRelation

type ArtifactRelation struct {
	Artifact *Artifact
	Relation Relation
}

type Artifacts

type Artifacts []*Artifact

func (Artifacts) Dependencies

func (as Artifacts) Dependencies(recursive bool, ignore *map[strfmt.UUID]struct{}) Artifacts

Dependencies returns ALL dependencies that an artifact has, this covers runtime and build time dependencies. It does not cover test dependencies as we have no use for them in the state tool.

func (Artifacts) Filter

func (a Artifacts) Filter(filters ...FilterArtifact) Artifacts

func (Artifacts) Ingredients

func (a Artifacts) Ingredients() Ingredients

func (Artifacts) RuntimeDependencies

func (as Artifacts) RuntimeDependencies(recursive bool, ignore *map[strfmt.UUID]struct{}) Artifacts

func (Artifacts) ToIDMap

func (a Artifacts) ToIDMap() ArtifactIDMap

func (Artifacts) ToIDSlice

func (a Artifacts) ToIDSlice() []strfmt.UUID

func (Artifacts) ToNameMap

func (a Artifacts) ToNameMap() ArtifactNameMap

type BuildPlan

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

func Unmarshal

func Unmarshal(data []byte) (*BuildPlan, error)

func (*BuildPlan) Artifacts

func (b *BuildPlan) Artifacts(filters ...FilterArtifact) Artifacts

func (*BuildPlan) DiffArtifacts

func (b *BuildPlan) DiffArtifacts(oldBp *BuildPlan, requestedOnly bool) ArtifactChangeset

func (*BuildPlan) Engine

func (b *BuildPlan) Engine() types.BuildEngine

func (*BuildPlan) Ingredients

func (b *BuildPlan) Ingredients(filters ...filterIngredient) Ingredients

func (*BuildPlan) IsBuildInProgress

func (b *BuildPlan) IsBuildInProgress() bool

func (*BuildPlan) IsBuildReady

func (b *BuildPlan) IsBuildReady() bool

func (*BuildPlan) LegacyRecipeID

func (b *BuildPlan) LegacyRecipeID() strfmt.UUID

LegacyRecipeID extracts the recipe ID from the BuildLogIDs. We do this because if the build is in progress we will need to reciepe ID to initialize the build log streamer. This information will only be populated if the build is an alternate build. This is specified in the build planner queries.

func (*BuildPlan) Marshal

func (b *BuildPlan) Marshal() ([]byte, error)

func (*BuildPlan) Platforms

func (b *BuildPlan) Platforms() []strfmt.UUID

func (*BuildPlan) RequestedArtifacts

func (b *BuildPlan) RequestedArtifacts() Artifacts

RequestedArtifacts returns the resolved requirements of the buildplan as artifacts

func (*BuildPlan) RequestedIngredients

func (b *BuildPlan) RequestedIngredients() Ingredients

RequestedIngredients returns the resolved requirements of the buildplan as ingredients

func (*BuildPlan) Requirements

func (b *BuildPlan) Requirements() Requirements

Requirements returns what the project has defined as the top level requirements (ie. the "order"). This is usually the same as the "ingredients" but it can be different if the project has multiple requirements that are satisfied by the same ingredient. eg. rake is satisfied by ruby.

type ChangeType

type ChangeType int
const (
	ArtifactAdded ChangeType = iota
	ArtifactRemoved
	ArtifactUpdated
)

func (ChangeType) String

func (c ChangeType) String() string

type FilterArtifact

type FilterArtifact func(a *Artifact) bool

func FilterArtifactIDs

func FilterArtifactIDs(ids ...strfmt.UUID) FilterArtifact

func FilterBuildtimeArtifacts

func FilterBuildtimeArtifacts() FilterArtifact

func FilterFailedArtifacts

func FilterFailedArtifacts() FilterArtifact

func FilterNotBuild

func FilterNotBuild() FilterArtifact

func FilterPlatformArtifacts

func FilterPlatformArtifacts(platformID strfmt.UUID) FilterArtifact

func FilterRuntimeArtifacts

func FilterRuntimeArtifacts() FilterArtifact

func FilterStateArtifacts

func FilterStateArtifacts() FilterArtifact

func FilterSuccessfulArtifacts

func FilterSuccessfulArtifacts() FilterArtifact

type FilterOutIngredients

type FilterOutIngredients struct {
	Ingredients IngredientIDMap
}

func (FilterOutIngredients) Filter

func (f FilterOutIngredients) Filter(i *Ingredient) bool

type Ingredient

type Ingredient struct {
	*raw.IngredientSource

	IsBuildtimeDependency bool
	IsRuntimeDependency   bool
	Artifacts             Artifacts
	// contains filtered or unexported fields
}

func (*Ingredient) RuntimeDependencies

func (i *Ingredient) RuntimeDependencies(recursive bool) Ingredients

type IngredientIDMap

type IngredientIDMap map[strfmt.UUID]*Ingredient

type IngredientNameMap

type IngredientNameMap map[string]*Ingredient

type Ingredients

type Ingredients []*Ingredient

func (Ingredients) CommonRuntimeDependencies

func (i Ingredients) CommonRuntimeDependencies() Ingredients

CommonRuntimeDependencies returns the set of runtime dependencies that are common between all ingredients. For example, given a set of python ingredients this will return at the very least the python language ingredient.

func (Ingredients) Filter

func (i Ingredients) Filter(filters ...filterIngredient) Ingredients

func (Ingredients) ToIDMap

func (i Ingredients) ToIDMap() IngredientIDMap

func (Ingredients) ToNameMap

func (i Ingredients) ToNameMap() IngredientNameMap

type Relation

type Relation int
const (
	RuntimeRelation Relation = iota
	BuildtimeRelation
)

type Requirement

type Requirement struct {
	*types.Requirement
	// Requirements are not ingredients, because multiple requirements can be satisfied by the same ingredient,
	// for example `rake` is satisfied by `ruby`.
	Ingredient *Ingredient
}

type Requirements

type Requirements []*Requirement

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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