projectconfig

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HashTypeSHA256 represents the SHA-256 hash algorithm.
	HashTypeSHA256 = fileutils.HashTypeSHA256

	// HashTypeSHA512 represents the SHA-512 hash algorithm.
	HashTypeSHA512 = fileutils.HashTypeSHA512
)
View Source
const (
	UseCaseRPMBuild   = "rpm-build"
	UseCaseImageBuild = "image-build"
)

Use-case identifiers for DistroVersionInputs. These match the TOML keys under `[distros.<d>.versions.<v>.inputs]` and are the canonical names used in error messages and CLI flags (e.g. `azldev repo query --use-case`).

View Source
const (
	DefaultLogDir           = "build/logs"
	DefaultWorkDir          = "build/work"
	DefaultOutputDir        = "out"
	DefaultLockDir          = "locks"
	DefaultRenderedSpecsDir = "specs"
)

Default project-relative paths used when the corresponding ProjectInfo field is unset. Applied by ProjectInfo.ApplyProjectDefaults.

View Source
const DefaultConfigFileName string = "azldev.toml"

The default filename of an Azure Linux project configuration file.

View Source
const DefaultSchemaURI = "https://raw.githubusercontent.com/microsoft/azure-linux-dev-tools/refs/heads/main/schemas/azldev.schema.json"

Default schema URI for this config file. Useful for capable editors to provide Intellisense and validation.

View Source
const UserConfigSubPath = "azldev/config.toml"

UserConfigSubPath is the path, relative to the XDG config home, where azldev looks for user-level configuration overrides. The full default location is `${XDG_CONFIG_HOME:-$HOME/.config}/azldev/config.toml`.

Variables

View Source
var (
	// ErrDuplicateComponents is returned when duplicate conflicting component definitions are found.
	ErrDuplicateComponents = errors.New("duplicate component")
	// ErrDuplicateComponentGroups is returned when duplicate conflicting component group definitions are found.
	ErrDuplicateComponentGroups = errors.New("duplicate component group")
	// ErrDuplicateImages is returned when duplicate conflicting image definitions are found.
	ErrDuplicateImages = errors.New("duplicate image")
	// ErrDuplicatePackageGroups is returned when duplicate conflicting package group definitions are found.
	ErrDuplicatePackageGroups = errors.New("duplicate package group")
	// ErrCircularInclude is returned when a config file include chain forms a cycle.
	ErrCircularInclude = errors.New("circular include detected")
)
View Source
var (
	// ErrDuplicateTestSuites is returned when duplicate conflicting test suite definitions are found.
	ErrDuplicateTestSuites = errors.New("duplicate test suite")
	// ErrUnknownTestType is returned for unrecognized test types.
	ErrUnknownTestType = errors.New("unknown test type")
	// ErrMissingTestField is returned when a required test config field is missing.
	ErrMissingTestField = errors.New("missing required test field")
	// ErrUndefinedTestSuite is returned when an image references a test suite name that is not defined.
	ErrUndefinedTestSuite = errors.New("undefined test suite reference")
	// ErrMismatchedTestSubtable is returned when a test config has a subtable that does not
	// match its declared type.
	ErrMismatchedTestSubtable = errors.New("mismatched test subtable")
	// ErrInvalidInstallMode is returned when a [PytestConfig.Install] value is not recognized.
	ErrInvalidInstallMode = errors.New("invalid install mode")
)

AllowedSourceFilesHashTypes defines the set of hash types that are supported for use in SourceFileReference entries in component configs. MD5 is excluded by design.

View Source
var ErrConfigFileNotFound = errors.New("could not find config file: azldev.toml")

Error returned when the config file is not present.

View Source
var ErrOverlayFileEmpty = errors.New("overlay file declares no overlays")

ErrOverlayFileEmpty is returned when an overlay file decodes to zero overlays. Such a file is almost certainly a typo (e.g. `[overlays]` instead of `[[overlays]]`) and would otherwise silently contribute nothing.

View Source
var ErrOverlayFilePerOverlayMetadata = errors.New(
	"per-overlay metadata is not allowed inside an overlay file; declare metadata once at the file level",
)

ErrOverlayFilePerOverlayMetadata is returned when an overlay file declares `metadata` on an individual `[[overlays]]` entry. Each file represents one logical change; the file-level `[metadata]` block is the single source of truth and is stamped onto every overlay in the file at load time.

View Source
var ErrOverlayFilesNoMatches = errors.New("overlay-files pattern matched no files")

ErrOverlayFilesNoMatches is returned when a literal ComponentConfig.OverlayFiles path matches no files on disk. Glob patterns may intentionally match no files when inherited across many components, but a literal path with no match is almost always a typo.

View Source
var ErrUndefinedComponent = errors.New("undefined component reference")

ErrUndefinedComponent is returned when a component group references a component name that is not defined in the project's top-level components map.

Functions

func FindProjectRootAndConfigFile

func FindProjectRootAndConfigFile(
	fs opctx.FS,
	referenceDir string,
) (projectRootDir, configFilePath string, err error)

Starting at referenceDir, locates the containing project root directory and its configuration file. Returns ErrConfigFileNotFound if they could not be located.

func IsDebugInfoPackage added in v0.2.0

func IsDebugInfoPackage(pkgName string) bool

IsDebugInfoPackage reports whether pkgName is a debuginfo or debugsource package. It matches "-debuginfo" or "-debugsource" as hyphen-delimited segments so that names like "kernel-debuginfo-common-x86_64" are correctly identified while unrelated packages like "elfutils-debuginfod" are not.

func ResolvePackagePublishChannel added in v0.2.0

func ResolvePackagePublishChannel(pkgName string, comp *ComponentConfig, proj *ProjectConfig) (string, error)

ResolvePackagePublishChannel returns the publish channel for a binary package produced by a component. The caller must pass a resolved ComponentConfig (one whose Publish field already reflects project-level, distro, and component-group defaults).

Resolution order (later wins):

  1. The project-level default package config (ProjectConfig.DefaultPackageConfig), used only as a fallback when all higher-priority sources produce an empty channel.
  2. The resolved component-level publish channel (ComponentPublishConfig.RPMChannel or ComponentPublishConfig.DebugInfoChannel, depending on the package name).
  3. The matching package-group's publish channel, if the package belongs to one.
  4. The component's explicit per-package publish channel override, if set.

func UserConfigFilePath added in v0.2.0

func UserConfigFilePath(osEnv opctx.OSEnv) string

UserConfigFilePath returns the absolute path to the user-level azldev config file, following the XDG Base Directory Specification, resolved against the given OS environment abstraction so that callers (including tests) can control environment lookups deterministically.

The returned path is the location azldev checks for user-level configuration overrides; it does not guarantee that a file actually exists at that path. If the XDG config home cannot be determined (e.g. neither `XDG_CONFIG_HOME` nor `HOME` is set to an absolute path), an empty string is returned.

Types

type CheckConfig

type CheckConfig struct {
	// Skip indicates whether the %check section should be disabled for this component.
	Skip bool `` /* 153-byte string literal not displayed */
	// SkipReason provides a required justification when Skip is true.
	SkipReason string `` /* 170-byte string literal not displayed */
}

CheckConfig encapsulates configuration for the %check section of a spec file.

func (*CheckConfig) Validate

func (c *CheckConfig) Validate() error

Validate checks that required fields are set when Skip is true.

type ComponentBuildConfig

type ComponentBuildConfig struct {
	// Which features should be enabled via `with` options to the builder.
	With []string `` /* 126-byte string literal not displayed */
	// Which features should be disabled via `without` options to the builder.
	Without []string `` /* 138-byte string literal not displayed */
	// Macro definitions.
	Defines map[string]string `` /* 140-byte string literal not displayed */
	// Undefine macros that would otherwise be defined by the component configuration.
	Undefines []string `` /* 154-byte string literal not displayed */
	// Check section configuration.
	Check CheckConfig `` /* 133-byte string literal not displayed */
	// Failure configuration and policy for this component's build.
	Failure ComponentBuildFailureConfig `` /* 194-byte string literal not displayed */
	// Hints for how or when to build the component; must not be required for correctness of builds.
	Hints ComponentBuildHints `` /* 164-byte string literal not displayed */
}

Encapsulates configuration for building a component. Configuration for how to acquire or prepare the sources for a component are out of scope.

func (*ComponentBuildConfig) Validate

func (c *ComponentBuildConfig) Validate() error

Validate checks that the build configuration is valid.

type ComponentBuildFailureConfig

type ComponentBuildFailureConfig struct {
	// Expected indicates that this component is expected to fail building. This is intended to be used as a temporary
	// marker for components that are expected to fail until they can be fixed.
	Expected bool `` /* 159-byte string literal not displayed */
	// ExpectedReason provides a required justification when Expected is true.
	ExpectedReason string `` /* 195-byte string literal not displayed */
}

ComponentBuildFailureConfig encapsulates configuration and policy regarding a component's build failure.

func (*ComponentBuildFailureConfig) Validate added in v0.2.0

func (c *ComponentBuildFailureConfig) Validate() error

Validate checks that required fields are set when Expected is true.

type ComponentBuildHints

type ComponentBuildHints struct {
	// Expensive indicates that building this component is relatively expensive compared to the rest of the distro.
	Expensive bool `` /* 207-byte string literal not displayed */
}

ComponentBuildHints encapsulates non-essential hints for how or when to build a component. These are not required for correctness of builds, but may be used by tools to provide guidance or optimizations.

type ComponentConfig

type ComponentConfig struct {
	// The component's name; not actually present in serialized files.
	Name string `toml:"-" json:"name" table:",sortkey" fingerprint:"-"`

	// Reference to the source config file that this definition came from; not present
	// in serialized files.
	SourceConfigFile *ConfigFile `toml:"-" json:"-" table:"-" fingerprint:"-"`

	// RenderedSpecDir is the output directory for this component's rendered spec files.
	// Derived at resolve time from the project's rendered-specs-dir setting; not present
	// in serialized files. Empty when rendered-specs-dir is not configured.
	RenderedSpecDir string `toml:"-" json:"renderedSpecDir,omitempty" table:"-" fingerprint:"-"`

	// Locked holds resolved lock file state for this component. Populated by
	// the component resolver from the lock store. Nil when no lock file exists.
	// During 'component update', this field may be cleared before re-resolving
	// to prevent the source provider from short-circuiting with stale values.
	Locked *ComponentLockData `toml:"-" json:"locked,omitempty" table:"-" fingerprint:"-"`

	// Where to get its spec and adjacent files from.
	Spec SpecSource `` /* 132-byte string literal not displayed */

	// Release configuration for this component.
	Release ReleaseConfig `` /* 179-byte string literal not displayed */

	// Overlays to apply to sources after they've been acquired. May mutate the spec as well as sources.
	Overlays []ComponentOverlay `` /* 159-byte string literal not displayed */

	// OverlayFiles, if set, lists path or glob patterns (relative to this component config file)
	// matched against the filesystem after component config resolution to locate per-file overlay documents.
	// Each matched file is parsed as an [OverlayFile]: one logical change consisting of a
	// file-level `[metadata]` block plus an ordered list of `[[overlays]]`. The per-file
	// metadata is stamped onto every overlay in the file. Matches are concatenated in the
	// order patterns are declared; within a single pattern, matches are applied in
	// filename (lexicographic) order, using the full path as a tie-breaker when
	// filenames match. Duplicate matches are de-duplicated, preserving first
	// occurrence. The resulting overlays are appended to [ComponentConfig.Overlays]
	// after any inline overlays. A value set in a higher-priority config layer replaces
	// lower-priority overlay-files values; an explicit empty list disables inherited
	// overlay files. Excluded from the fingerprint because the value affects only where
	// overlays are sourced from, not their content.
	OverlayFiles []string `` /* 408-byte string literal not displayed */

	// Configuration for building the component.
	Build ComponentBuildConfig `` /* 147-byte string literal not displayed */

	// Configuration for rendering the component.
	Render ComponentRenderConfig `` /* 151-byte string literal not displayed */

	// Source file references for this component.
	SourceFiles []SourceFileReference `` /* 156-byte string literal not displayed */

	// Per-package configuration overrides, keyed by exact binary package name.
	// Takes precedence over package-group defaults.
	Packages map[string]PackageConfig `` /* 197-byte string literal not displayed */

	// Publish holds the component-level publish settings. These provide default channels for
	// all packages produced by this component. Overridden by package-group and per-package settings
	// for binary and debuginfo channels.
	Publish ComponentPublishConfig `` /* 164-byte string literal not displayed */
}

Defines a component.

func ExpandResolvedOverlayFiles added in v0.2.0

func ExpandResolvedOverlayFiles(
	fs opctx.FS, component ComponentConfig, referenceDir string, permissiveConfigParsing bool,
) (ComponentConfig, error)

ExpandResolvedOverlayFiles resolves a component's post-resolution ComponentConfig.OverlayFiles glob patterns, parses every matched file as an OverlayFile, stamps the per-file metadata onto each overlay, appends the resulting overlays after inline overlays, and clears ComponentConfig.OverlayFiles so the returned config is not expanded twice.

func ResolveComponentConfig added in v0.2.0

func ResolveComponentConfig(
	comp ComponentConfig,
	projectDefaults ComponentConfig,
	distroDefaults ComponentConfig,
	groups map[string]ComponentGroupConfig,
	groupMembership []string,
) (ComponentConfig, error)

ResolveComponentConfig applies the full config inheritance chain for a single component: distro defaults → project-level defaults → group defaults (sorted) → component explicit config. Returns a fully resolved copy; the inputs are not modified. On error the returned config is undefined and must not be used.

func (*ComponentConfig) EffectiveUpstreamCommit added in v0.2.0

func (c *ComponentConfig) EffectiveUpstreamCommit() string

EffectiveUpstreamCommit returns the commit to use for upstream operations. Prefers the locked commit (resolved reality) over the config pin (user intent). Falls back to Spec.UpstreamCommit for SkipLockValidation paths (update, list, changed) where Locked may be nil. Returns empty string when neither is set.

func (*ComponentConfig) MergeUpdatesFrom

func (c *ComponentConfig) MergeUpdatesFrom(other *ComponentConfig) error

Mutates the component config, updating it with overrides present in other.

func (*ComponentConfig) WithAbsolutePaths

func (c *ComponentConfig) WithAbsolutePaths(referenceDir string) *ComponentConfig

Returns a copy of the component config with relative file paths converted to absolute file paths (relative to referenceDir, not the current working directory).

type ComponentGroupConfig

type ComponentGroupConfig struct {
	// A human-friendly description of this component group.
	Description string `` /* 136-byte string literal not displayed */

	// Optional documentation metadata describing this component group's intent and provenance.
	// It reuses the overlay metadata schema (see [OverlayMetadata]) and does not affect how the
	// group's members are resolved or built.
	Metadata *OverlayMetadata `` /* 148-byte string literal not displayed */

	// List of explicitly included components, identified by name.
	Components []string `` /* 152-byte string literal not displayed */

	// List of glob patterns specifying raw spec files that define components.
	SpecPathPatterns []string `` /* 218-byte string literal not displayed */
	// List of glob patterns specifying files to specifically ignore from spec selection.
	ExcludedPathPatterns []string `` /* 210-byte string literal not displayed */

	// Default configuration to apply to component members of this group.
	DefaultComponentConfig ComponentConfig `` /* 218-byte string literal not displayed */
}

Defines a component group. Component groups are logical groupings of components (see ComponentConfig). A component group is useful because it allows for succinctly naming/identifying a curated set of components, say in a command line interface. Note that a component group does not uniquely "own" its components; a component may belong to multiple groups, and components need not belong to any group.

func (ComponentGroupConfig) WithAbsolutePaths

func (g ComponentGroupConfig) WithAbsolutePaths(referenceDir string) ComponentGroupConfig

Returns a copy of the component group config with relative file paths converted to absolute file paths (relative to referenceDir, not the current working directory).

type ComponentLockData added in v0.2.0

type ComponentLockData struct {
	// UpstreamCommit is the resolved upstream commit from the lock file.
	UpstreamCommit string `json:"upstreamCommit,omitempty"`
	// ImportCommit is the upstream commit at fork time (write-once).
	ImportCommit string `json:"importCommit,omitempty"`
	// ManualBump is the extra rebuild counter.
	ManualBump int `json:"manualBump,omitempty"`
	// InputFingerprint is the stored fingerprint from the last update.
	// Covers build inputs (config, overlays, commit, manual bump, release ver)
	// but excludes resolution inputs like snapshot timestamp.
	InputFingerprint string `json:"inputFingerprint,omitempty"`
	// ResolutionInputHash is the stored hash of resolution inputs (snapshot,
	// distro ref, pin, upstream name). Used to determine if the locked commit
	// needs re-resolution.
	ResolutionInputHash string `json:"resolutionInputHash,omitempty"`
	// Freshness indicates whether the component's config matches its lock.
	// Runtime-only — computed by the resolver when freshness checking is enabled.
	Freshness FreshnessStatus `json:"-"`
	// ResolutionStale indicates whether resolution inputs specifically changed,
	// as opposed to build-only inputs. When true, re-resolution is needed.
	// When false but Freshness is Stale, only build inputs changed and the
	// locked commit can be reused.
	ResolutionStale bool `json:"-"`
}

ComponentLockData holds resolved lock file state attached to a component at resolve time. This separates user intent (config fields) from resolved reality (lock data). Populated by the component resolver from the lock store; nil when no lock file exists for this component.

Not serialized to TOML config and not fingerprinted - runtime-only. The data IS included in JSON output (e.g., 'component list -O json') under "locked" so users can inspect resolved lock state. The pointer must not be shared across value-copied configs; the resolver always allocates a fresh struct per component, and ComponentConfig.WithAbsolutePaths deep-copies it.

type ComponentOverlay

type ComponentOverlay struct {
	// The type of overlay to apply.
	Type ComponentOverlayType `` /* 470-byte string literal not displayed */
	// Human readable description of overlay; primarily present to document the need for the change.
	Description string `` /* 154-byte string literal not displayed */

	// For overlays that apply to non-spec files, indicates the filename. For overlays that can
	// apply to multiple files, supports glob patterns (including globstar).
	Filename string `` /* 190-byte string literal not displayed */
	// For archive-scoped overlays (file-remove and file-search-replace), the name of the source
	// archive to extract, modify, and repack (e.g. "pkg-1.0.tar.gz"). When set, [ComponentOverlay.Filename]
	// is interpreted as a glob relative to the archive's extraction root rather than a loose
	// file in the sources tree.
	Archive string `` /* 257-byte string literal not displayed */
	// For overlays that apply to specs, indicates the name of the section to which it applies.
	// Optional for spec-prepend-lines, spec-append-lines, and spec-search-replace: when omitted,
	// the overlay targets the entire spec file (prepend at top, append at end, search-replace
	// across all sections).
	SectionName string `` /* 276-byte string literal not displayed */
	// For overlays that apply to specs, indicates the name of the sub-package to which it applies.
	// A sub-package is always a sub-qualifier of a section, so this field cannot be combined
	// with an omitted SectionName on overlays that support whole-file targeting.
	PackageName string `` /* 242-byte string literal not displayed */
	// For overlays that apply to spec tags, indicates the name of the tag.
	Tag string `` /* 144-byte string literal not displayed */
	// For overlays that apply to values in specs, an exact string value to match.
	Value string `toml:"value,omitempty" json:"value,omitempty" jsonschema:"title=Value,description=An exact string value to match in the spec"`
	// For overlays that use a regular expression to match text in the spec, the regular expression to match.
	Regex string `` /* 139-byte string literal not displayed */
	// For overlays that replace text in a spec, the replacement text to use.
	Replacement string `` /* 145-byte string literal not displayed */
	// For overlays that reference lines of text, the lines of text to use.
	Lines []string `toml:"lines,omitempty" json:"lines,omitempty" jsonschema:"title=Lines,description=The lines of text to use"`
	// For overlays that require a source file as input, indicates a path to that file; relative paths are relative to
	// the config file that defines the overlay.
	// Excluded from fingerprint because it contains an absolute path that varies by checkout
	// location. Overlay content is hashed separately by [fingerprint.ComputeIdentity].
	Source string `` /* 254-byte string literal not displayed */

	// Metadata describes the intent and provenance of the overlay (category, related
	// commits, bug links, upstreamability, etc.). Optional. Populated either inline
	// in the component config file or by the [ComponentConfig.OverlayFiles] loader,
	// which stamps the per-file metadata onto every overlay declared in that file.
	// Excluded from the fingerprint because it is documentation only.
	Metadata *OverlayMetadata `` /* 186-byte string literal not displayed */
}

ComponentOverlay represents an overlay that may be applied to a component's spec and/or its sources.

func (*ComponentOverlay) ArchiveTarget added in v0.2.0

func (c *ComponentOverlay) ArchiveTarget() (archiveName, innerPath string, ok bool)

ArchiveTarget returns the archive name and the inner-archive glob when the overlay is archive-scoped (i.e. ComponentOverlay.Archive is non-empty and ComponentOverlay.Filename provides the inner path).

Returns ok=false when ComponentOverlay.Archive is empty, indicating a loose-file overlay whose ComponentOverlay.Filename refers to files in the sources tree directly.

func (*ComponentOverlay) EffectiveSourceName added in v0.2.0

func (c *ComponentOverlay) EffectiveSourceName() string

EffectiveSourceName returns the checkout-independent identity of the overlay's source file. When ComponentOverlay.Filename is set it takes precedence; otherwise the basename of ComponentOverlay.Source is used (this matches the runtime behavior in the overlay application layer, e.g., patch-add derives its destination filename from the source basename).

Returns empty string if the overlay has no source file.

func (ComponentOverlay) HashInclude added in v0.2.0

func (c ComponentOverlay) HashInclude(field string, _ any) (bool, error)

HashInclude implements the hashstructure Includable interface so the ComponentOverlay.Archive field is omitted from the component fingerprint while it holds its default (empty) value. A defaulted Archive therefore reproduces the pre-existing fingerprint (no cascading rebuild for existing overlays), while a non-empty Archive contributes to the hash. Every other field is always included, preserving existing hashing behaviour.

NOTE: Remove this method once the RFC for explicit fingerprint exclusions is implemented and ComponentOverlay.Archive can be tagged with `fingerprint:"-,nonzero"` (or equivalent) instead.

NOTE: the value receiver is required — [fingerprint.ComputeIdentity] hashes the component by value, so the struct (and its nested fields) are not addressable and a pointer-receiver method would never be detected by hashstructure.

func (*ComponentOverlay) ModifiesArchive added in v0.2.0

func (c *ComponentOverlay) ModifiesArchive() bool

ModifiesArchive returns true if the overlay modifies files inside a source archive. These overlays require extraction and repacking of the archive. Only file-remove and file-search-replace support archive scoping (see ComponentOverlay.SupportsArchiveScope), and only when their ComponentOverlay.Filename is an archive-scoped path (see ComponentOverlay.ArchiveTarget).

func (*ComponentOverlay) ModifiesLooseFiles added in v0.2.0

func (c *ComponentOverlay) ModifiesLooseFiles() bool

ModifiesLooseFiles returns true if the overlay modifies loose files in the sources tree (as opposed to the spec or files inside an archive). This includes hybrid overlays that modify both the spec and loose source files (e.g., patch overlays), since those also require loose-file modifications. Archive-scoped overlays (see [ModifiesArchive]) are excluded: they operate on files inside an archive, not loose files in the sources tree.

func (*ComponentOverlay) ModifiesSpec

func (c *ComponentOverlay) ModifiesSpec() bool

ModifiesSpec returns true if the overlay modifies a spec file. This includes hybrid overlays that modify both spec and source files (e.g., patch overlays), since those also require spec modifications.

func (*ComponentOverlay) SourceContentIdentity added in v0.2.0

func (c *ComponentOverlay) SourceContentIdentity(fs opctx.FS) (string, error)

SourceContentIdentity returns an opaque identity string for the overlay's source file, combining the effective destination filename and a SHA256 content hash. Returns empty string and nil error if the overlay has no source file. Used by [fingerprint.ComputeIdentity] so that fingerprint logic does not need overlay-specific knowledge.

func (*ComponentOverlay) SupportsArchiveScope added in v0.2.0

func (c *ComponentOverlay) SupportsArchiveScope() bool

SupportsArchiveScope reports whether the overlay type can target files inside a source archive via an archive-scoped ComponentOverlay.Filename (see ComponentOverlay.ArchiveTarget). Only file-remove and file-search-replace extract and repack archives; all other types treat the path as loose files in the sources tree.

func (*ComponentOverlay) Validate

func (c *ComponentOverlay) Validate() error

Validate checks that required fields are set based on the overlay type. This catches configuration errors at load time rather than at apply time.

func (*ComponentOverlay) WithAbsolutePaths

func (c *ComponentOverlay) WithAbsolutePaths(referenceDir string) (result *ComponentOverlay)

WithAbsolutePaths returns a copy of the overlay with config-relative file paths converted to absolute file paths (relative to referenceDir, not the current working directory). Note that paths that are intentionally relative to the destination component sources are left relative.

type ComponentOverlayType

type ComponentOverlayType string

ComponentOverlayType is the type of a component overlay.

const (
	// ComponentOverlayAddSpecTag is an overlay that adds a tag to the spec; fails if the tag already exists.
	ComponentOverlayAddSpecTag ComponentOverlayType = "spec-add-tag"
	// ComponentOverlayInsertSpecTag is an overlay that inserts a tag into the spec, placing it
	// after the last existing tag from the same family (e.g., Source9999 after the last Source* tag).
	// Falls back to after the last tag of any kind, then to appending at the section end.
	ComponentOverlayInsertSpecTag ComponentOverlayType = "spec-insert-tag"
	// ComponentOverlaySetSpecTag is an overlay that sets a tag to the spec. If the tag already exists, replaces
	// its existing value; otherwise, adds the tag.
	ComponentOverlaySetSpecTag ComponentOverlayType = "spec-set-tag"
	// ComponentOverlayUpdateSpecTag is an overlay that updates a tag in the spec; fails if the tag doesn't exist.
	ComponentOverlayUpdateSpecTag ComponentOverlayType = "spec-update-tag"
	// ComponentOverlayRemoveSpecTag is an overlay that removes a tag from the spec; fails if the tag doesn't exist.
	ComponentOverlayRemoveSpecTag ComponentOverlayType = "spec-remove-tag"
	// ComponentOverlayPrependSpecLines is an overlay that prepends lines to a section in a spec; fails if the section
	// doesn't exist.
	ComponentOverlayPrependSpecLines ComponentOverlayType = "spec-prepend-lines"
	// ComponentOverlayAppendSpecLines is an overlay that appends lines to a section in a spec; fails if the section
	// doesn't exist.
	ComponentOverlayAppendSpecLines ComponentOverlayType = "spec-append-lines"
	// ComponentOverlaySearchAndReplaceInSpec is an overlay that replaces text in a spec with other text.
	ComponentOverlaySearchAndReplaceInSpec ComponentOverlayType = "spec-search-replace"
	// ComponentOverlayRemoveSection is an overlay that removes an entire section from the spec;
	// fails if the section doesn't exist.
	ComponentOverlayRemoveSection ComponentOverlayType = "spec-remove-section"
	// ComponentOverlayRemoveSubpackage is an overlay that removes every section in the spec
	// that belongs to a given sub-package (e.g. its `%package`, `%description`, `%files`,
	// `%post`, `%postun`, etc. sections). Fails if the spec has no sections matching the
	// indicated sub-package.
	ComponentOverlayRemoveSubpackage ComponentOverlayType = "spec-remove-subpackage"
	// ComponentOverlayAddPatch is an overlay that adds a patch file and registers it in the spec.
	// It copies the source file into the component sources and adds a PatchN tag (or appends to
	// %%patchlist if one exists).
	ComponentOverlayAddPatch ComponentOverlayType = "patch-add"
	// ComponentOverlayRemovePatch is an overlay that removes a patch file and its corresponding
	// PatchN tag and/or %%patchlist entry from the spec.
	ComponentOverlayRemovePatch ComponentOverlayType = "patch-remove"
	// ComponentOverlayPrependLinesToFile is an overlay that prepends lines to a non-spec file.
	ComponentOverlayPrependLinesToFile ComponentOverlayType = "file-prepend-lines"
	// ComponentOverlaySearchAndReplaceInFile is an overlay that replaces text in a non-spec file.
	ComponentOverlaySearchAndReplaceInFile ComponentOverlayType = "file-search-replace"
	// ComponentOverlayAddFile is an overlay that adds a non-spec file.
	ComponentOverlayAddFile ComponentOverlayType = "file-add"
	// ComponentOverlayRemoveFile is an overlay that removes a non-spec file. When
	// [ComponentOverlay.Archive] is set, it removes file(s) matching the glob in
	// [ComponentOverlay.Filename] from inside that source archive instead of loose
	// files in the sources tree (see [ComponentOverlay.ArchiveTarget]).
	ComponentOverlayRemoveFile ComponentOverlayType = "file-remove"
	// ComponentOverlayRenameFile is an overlay that renames a non-spec file.
	ComponentOverlayRenameFile ComponentOverlayType = "file-rename"
)

type ComponentPublishConfig added in v0.2.0

type ComponentPublishConfig struct {
	// RPMChannel identifies the publish channel for binary (non-debuginfo) packages
	// produced by this component. When empty, the value is inherited from the next layer
	// in the resolution order.
	RPMChannel string `` /* 210-byte string literal not displayed */

	// SRPMChannel identifies the publish channel for the SRPM produced by this component.
	// When empty, the value is inherited from the next layer in the resolution order.
	SRPMChannel string `` /* 206-byte string literal not displayed */

	// DebugInfoChannel identifies the publish channel for debuginfo packages produced
	// by this component. When empty, the value is inherited from the next layer in the
	// resolution order.
	DebugInfoChannel string `` /* 231-byte string literal not displayed */
}

ComponentPublishConfig holds publish channel settings for a component's packages. The zero value means all channels are inherited from a higher-priority config layer.

type ComponentReference

type ComponentReference struct {
	// Name of the component.
	Name string

	// Version of the component (optional).
	Version *rpm.Version
}

ComponentReference encapsulates a reference to a source component.

type ComponentRenderConfig added in v0.2.0

type ComponentRenderConfig struct {
	// SkipFileFilter, when true, disables the post-render file filter for this
	// component. Normally, rendered output is filtered to only include files
	// referenced by Source/Patch tags in the spec (as reported by spectool).
	// Some specs use macros that spectool cannot expand, causing referenced
	// files to be incorrectly removed. Setting this to true preserves all
	// files from the dist-git checkout.
	SkipFileFilter bool `` /* 204-byte string literal not displayed */
}

ComponentRenderConfig encapsulates configuration for rendering a component.

type ConfigFile

type ConfigFile struct {
	// URI for the schema for this file format.
	SchemaURI string `toml:"$schema,omitempty"`

	// Basic project info.
	Project *ProjectInfo `toml:"project,omitempty" jsonschema:"title=Project info,description=Basic properties for this project"`

	// List of glob patterns specifying additional config files to load and deserialize.
	Includes []string `` /* 155-byte string literal not displayed */

	// Definitions of distros.
	Distros map[string]DistroDefinition `toml:"distros,omitempty" jsonschema:"title=Distros,description=Definitions of distros to build for or consume from"`

	// Reusable resource definitions (e.g., RPM repositories) referenced from
	// elsewhere in the configuration.
	Resources *ResourcesConfig `toml:"resources,omitempty" jsonschema:"title=Resources,description=Reusable named resource definitions"`

	// Definitions of component groups.
	ComponentGroups map[string]ComponentGroupConfig `` /* 146-byte string literal not displayed */

	// Definitions of components.
	Components map[string]ComponentConfig `` /* 128-byte string literal not displayed */

	// Definitions of images.
	Images map[string]ImageConfig `toml:"images,omitempty" validate:"dive" jsonschema:"title=Images,description=Definitions of images for this project"`

	// Configuration for tools used by azldev.
	Tools *ToolsConfig `toml:"tools,omitempty" jsonschema:"title=Tools configuration,description=Configuration for tools used by azldev"`

	// DefaultComponentConfig is the project-wide default component configuration applied before any
	// component-group or component-level config is considered.
	DefaultComponentConfig *ComponentConfig `` /* 181-byte string literal not displayed */

	// DefaultPackageConfig is the project-wide default package configuration applied before any
	// package-group or component-level config is considered.
	DefaultPackageConfig *PackageConfig `` /* 182-byte string literal not displayed */

	// Definitions of package groups. Groups allow shared configuration
	// to be applied to sets of binary packages.
	PackageGroups map[string]PackageGroupConfig `` /* 163-byte string literal not displayed */

	// Definitions of test suites.
	TestSuites map[string]TestSuiteConfig `` /* 131-byte string literal not displayed */
	// contains filtered or unexported fields
}

Encapsulates a serialized project config file; used for serialization/deserialization.

func (ConfigFile) Dir added in v0.2.0

func (f ConfigFile) Dir() string

Dir returns the directory containing the config file; relative paths within the config are resolved against this directory.

func (ConfigFile) Serialize

func (f ConfigFile) Serialize(fs opctx.FS, filePath string) error

Serializes writes the config file to the specified path in appropriate format (TOML). If the given path already exists, it will be overwritten.

func (ConfigFile) SourcePath added in v0.2.0

func (f ConfigFile) SourcePath() string

SourcePath returns the absolute path to the config file on disk.

func (ConfigFile) ToBytes

func (f ConfigFile) ToBytes() ([]byte, error)

ToBytes serializes the config file to a byte slice in TOML format.

func (ConfigFile) Validate

func (f ConfigFile) Validate() error

Validates the format and internal consistency of the config file. Semantic errors are reported.

type DistroDefinition

type DistroDefinition struct {
	// Human-readable description of the distro.
	Description string `` /* 127-byte string literal not displayed */

	// Optionally provides a default version to use for this distro when one is not explicitly specified.
	DefaultVersion string `` /* 143-byte string literal not displayed */

	// The base URI of this distro's dist-git spec source repository.
	DistGitBaseURI string `` /* 179-byte string literal not displayed */

	// The base URI of this distro's lookaside cache for source archives.
	LookasideBaseURI string `` /* 175-byte string literal not displayed */

	// Published artifact information
	PackageRepositories []PackageRepository `` /* 136-byte string literal not displayed */

	// When true, source file downloads will not fall back to configured origins if the lookaside cache fails.
	DisableOrigins bool `` /* 213-byte string literal not displayed */

	// Versions: maps version => definition
	Versions map[string]DistroVersionDefinition `` /* 129-byte string literal not displayed */
}

Defines a distro that components may be built for/against.

func (*DistroDefinition) MergeUpdatesFrom

func (d *DistroDefinition) MergeUpdatesFrom(other *DistroDefinition) error

MergeUpdatesFrom mutates the distro definition, updating it with overrides present in other. Uses mergo.WithOverride without WithAppendSlice so that slice fields like DistroDefinition.PackageRepositories are replaced, not appended. This supports the primary use case of swapping between package sources via --config-file overrides.

For map fields like DistroDefinition.Versions, mergo replaces the entire value for a matching key rather than doing a field-level merge within the value struct.

func (*DistroDefinition) WithAbsolutePaths

func (d *DistroDefinition) WithAbsolutePaths(referenceDir string) DistroDefinition

Returns a copy of the distro definition with relative file paths converted to absolute file paths (relative to referenceDir, not the current working directory).

func (*DistroDefinition) WithResolvedConfigs

func (d *DistroDefinition) WithResolvedConfigs() DistroDefinition

type DistroReference

type DistroReference struct {
	// Name of the referenced distro.
	Name string `toml:"name" json:"name,omitempty" jsonschema:"required,title=Name,description=Name of the referenced distro"`
	// Version of the referenced distro.
	Version string `toml:"version,omitempty" json:"version,omitempty" jsonschema:"title=Version,description=Version of the referenced distro"`
	// Snapshot date/time for source code if specified components will use source as it existed at this time.
	// Note: set this on the distro or group default-component-config, not on individual components.
	// Per-component snapshots are rejected when lock validation is enabled.
	Snapshot string `` /* 262-byte string literal not displayed */
}

Encapsulates a reference to a version of a distro.

func (*DistroReference) String

func (r *DistroReference) String() string

Implements the [Stringer] interface for DistroReference.

type DistroVersionDefinition

type DistroVersionDefinition struct {
	// Human-readable description of this version
	Description string `` /* 149-byte string literal not displayed */

	// Formal `releasever` for this version.
	ReleaseVer string `toml:"release-ver" json:"releaseVer,omitempty" jsonschema:"title=Release version,description=Formal releasever string"`

	// Dist-git branch for this version (if applicable)
	DistGitBranch string `` /* 161-byte string literal not displayed */

	// Default config for components.
	DefaultComponentConfig ComponentConfig `` /* 212-byte string literal not displayed */

	// Path to mock configuration file for this project (if one exists).
	MockConfigPath        string `` /* 195-byte string literal not displayed */
	MockConfigPathX86_64  string `` /* 202-byte string literal not displayed */
	MockConfigPathAarch64 string `` /* 203-byte string literal not displayed */

	// Inputs maps build use-cases ([UseCaseRPMBuild], [UseCaseImageBuild]) to
	// ordered lists of input references. Each entry references either a
	// [RpmRepoResource] or a [RpmRepoSet]; sets are expanded at validation time.
	Inputs DistroVersionInputs `toml:"inputs,omitempty" json:"inputs,omitempty" jsonschema:"title=Inputs,description=Per-use-case input repositories"`
}

Defines a specific version of a distro.

func (DistroVersionDefinition) EffectiveImageBuildRepos added in v0.2.0

func (v DistroVersionDefinition) EffectiveImageBuildRepos(resources *ResourcesConfig) ([]string, error)

EffectiveImageBuildRepos returns the deduplicated, ordered list of effective repo names exposed to the image-build use-case for this distro version. Same semantics as DistroVersionDefinition.EffectiveRpmBuildRepos.

func (DistroVersionDefinition) EffectiveRpmBuildRepos added in v0.2.0

func (v DistroVersionDefinition) EffectiveRpmBuildRepos(resources *ResourcesConfig) ([]string, error)

EffectiveRpmBuildRepos returns the deduplicated, ordered list of effective repo names exposed to the rpm-build use-case for this distro version. The `inputs.rpm-build` list is processed entry-by-entry in declaration order: `repo` entries contribute their name, `set` entries expand into the names of every sub-repo the set instantiates. Duplicates across the resulting list (whether two direct repos with the same name or a direct repo named the same as a set's expansion) are reported as errors so that consumers do not have to dedupe.

This method does NOT verify that direct `repo = "..."` entries reference an existing RpmRepoResource; doing so requires a fully-built effective repo map (the union of `[resources.rpm-repos]` and every set's expansion), which is constructed once at the project level. Cross-reference validation against ResourcesConfig.EffectiveRpmRepos happens in ProjectConfig.Validate via validateDistroVersionInputs.

func (DistroVersionDefinition) WithAbsolutePaths

func (v DistroVersionDefinition) WithAbsolutePaths(referenceDir string) DistroVersionDefinition

Returns a copy of the distro version definition with relative file paths converted to absolute file paths (relative to referenceDir, not the current working directory).

func (DistroVersionDefinition) WithResolvedConfigs

func (v DistroVersionDefinition) WithResolvedConfigs() DistroVersionDefinition

type DistroVersionInput added in v0.2.0

type DistroVersionInput struct {
	// Repo names a top-level [ResourcesConfig.RpmRepos] entry. Mutually
	// exclusive with `Set`.
	Repo string `` /* 153-byte string literal not displayed */

	// Set names a top-level [ResourcesConfig.RpmRepoSets] entry. Mutually
	// exclusive with `Repo`.
	Set string `` /* 155-byte string literal not displayed */
}

DistroVersionInput is a single entry in a DistroVersionInputs list. Exactly one of `Repo` or `Set` must be set; the validator rejects entries that set neither or both.

type DistroVersionInputs added in v0.2.0

type DistroVersionInputs struct {
	// RpmBuild is the ordered list of inputs made available when building RPMs
	// (the mock/comp build path). Order is preserved on emission but not
	// interpreted as priority by dnf.
	RpmBuild []DistroVersionInput `` /* 162-byte string literal not displayed */

	// ImageBuild is the ordered list of inputs made available when building
	// images (the kiwi/image build path). Order is preserved on emission but
	// not interpreted as priority by kiwi.
	ImageBuild []DistroVersionInput `` /* 170-byte string literal not displayed */
}

DistroVersionInputs maps build use-cases to ordered lists of input references. Each DistroVersionInput entry references either a RpmRepoResource (by `repo`) or a RpmRepoSet (by `set`); sets are expanded at validation time into their constituent repo names. The final, deduplicated effective list is what consumers (mock, kiwi) see.

type FreshnessStatus added in v0.2.0

type FreshnessStatus int

FreshnessStatus indicates whether a component's current config matches its locked state. Computed at resolve time when freshness checking is enabled; FreshnessUnknown otherwise.

const (
	// FreshnessUnknown means freshness was not computed (no lock, no stored
	// fingerprint, or freshness checking not requested).
	FreshnessUnknown FreshnessStatus = iota
	// FreshnessCurrent means both the input fingerprint and resolution hash
	// match the lock — the component is fully up-to-date.
	FreshnessCurrent
	// FreshnessStale means the recomputed fingerprint or resolution hash
	// differs from the lock — config, overlays, snapshot, or other inputs
	// changed since the last update.
	FreshnessStale
)

func (FreshnessStatus) String added in v0.2.0

func (f FreshnessStatus) String() string

String returns a human-readable label for the freshness status.

type ImageCapabilities added in v0.2.0

type ImageCapabilities struct {
	// MachineBootable indicates whether the image can be booted on a machine (bare metal,
	// VM, etc.). Images that lack a kernel are not machine-bootable.
	MachineBootable *bool `` /* 178-byte string literal not displayed */

	// Container indicates whether the image can be run on an OCI container host.
	Container *bool `` /* 148-byte string literal not displayed */

	// Systemd indicates whether the image runs systemd as its init system.
	Systemd *bool `` /* 138-byte string literal not displayed */

	// RuntimePackageManagement indicates whether the image supports installing or
	// removing packages at runtime (e.g., via dnf/tdnf).
	RuntimePackageManagement *bool `` /* 213-byte string literal not displayed */
}

ImageCapabilities describes the features and properties of an image. Boolean fields use *bool to distinguish "explicitly true", "explicitly false", and "unspecified" (nil). This tristate enables correct merge semantics (unspecified inherits, false overrides) and detection of underspecification.

func (*ImageCapabilities) EnabledNames added in v0.2.0

func (c *ImageCapabilities) EnabledNames() []string

EnabledNames returns the TOML field names of capabilities that are explicitly set to true, in a stable order matching the struct field declaration order.

func (*ImageCapabilities) IsContainer added in v0.2.0

func (c *ImageCapabilities) IsContainer() bool

IsContainer returns true if the image is explicitly marked as runnable on an OCI container host.

func (*ImageCapabilities) IsMachineBootable added in v0.2.0

func (c *ImageCapabilities) IsMachineBootable() bool

IsMachineBootable returns true if the image is explicitly marked as machine-bootable.

func (*ImageCapabilities) IsRuntimePackageManagement added in v0.2.0

func (c *ImageCapabilities) IsRuntimePackageManagement() bool

IsRuntimePackageManagement returns true if the image explicitly supports runtime package management.

func (*ImageCapabilities) IsSystemd added in v0.2.0

func (c *ImageCapabilities) IsSystemd() bool

IsSystemd returns true if the image explicitly runs systemd.

type ImageConfig

type ImageConfig struct {
	// The image's name; not actually present in serialized TOML files.
	Name string `toml:"-" json:"name" table:",sortkey"`

	// Reference to the source config file that this definition came from; not present
	// in serialized files.
	SourceConfigFile *ConfigFile `toml:"-" json:"-" table:"-"`

	// Description of the image.
	Description string `toml:"description,omitempty" json:"description,omitempty" jsonschema:"title=Description,description=Description of the image"`

	// Where to find its definition.
	Definition ImageDefinition `` /* 152-byte string literal not displayed */

	// Capabilities describes the features and properties of this image.
	Capabilities ImageCapabilities `` /* 141-byte string literal not displayed */

	// Tests holds the test configuration for this image, including which test suites
	// apply to it.
	Tests ImageTestsConfig `toml:"tests,omitempty" json:"tests,omitempty" jsonschema:"title=Tests,description=Test configuration for this image"`

	// Publish holds the publish settings for this image.
	Publish ImagePublishConfig `` /* 132-byte string literal not displayed */
}

Defines an image.

func (*ImageConfig) MergeUpdatesFrom

func (i *ImageConfig) MergeUpdatesFrom(other *ImageConfig) error

Mutates the image config, updating it with overrides present in other.

func (*ImageConfig) TestNames added in v0.2.0

func (i *ImageConfig) TestNames() []string

TestNames returns the test suite names referenced by this image.

func (*ImageConfig) WithAbsolutePaths

func (i *ImageConfig) WithAbsolutePaths(referenceDir string) *ImageConfig

Returns a copy of the image config with relative file paths converted to absolute file paths (relative to referenceDir, not the current working directory).

type ImageCustomizerConfig

type ImageCustomizerConfig struct {
	// Full tag name of the Image Customizer container.
	ContainerTag string `` /* 152-byte string literal not displayed */
}

Encapsulates information about the tools used by the image customizer.

type ImageDefinition

type ImageDefinition struct {
	// DefinitionType indicates the type of image definition.
	DefinitionType ImageDefinitionType `toml:"type,omitempty" json:"type,omitempty" jsonschema:"title=Type,description=Type of image definition"`

	// Path points to the image definition file.
	Path string `toml:"path,omitempty" json:"path,omitempty" jsonschema:"title=Path,description=Path to the image definition file"`

	// Profile is an optional field that specifies the profile to use when building the image.
	Profile string `` /* 161-byte string literal not displayed */
}

Defines where to find an image definition.

type ImageDefinitionType

type ImageDefinitionType string

Type of image definition.

const (
	// Default (unspecified) source.
	ImageDefinitionTypeUnspecified ImageDefinitionType = ""
	// kiwi-ng image definition.
	ImageDefinitionTypeKiwi ImageDefinitionType = "kiwi"
)

type ImagePublishConfig added in v0.2.0

type ImagePublishConfig struct {
	// Channels lists the publish channels for this image.
	Channels []string `` /* 183-byte string literal not displayed */
}

ImagePublishConfig holds publish settings for an image. Unlike packages (which target a single channel), images may be published to multiple channels simultaneously.

type ImageTestsConfig added in v0.2.0

type ImageTestsConfig struct {
	// TestSuites is the list of test suite references that apply to this image. Each
	// reference identifies a test suite defined in the top-level [test-suites] section
	// and may carry per-test metadata in the future (e.g., required vs optional).
	TestSuites []TestSuiteRef `` /* 154-byte string literal not displayed */
}

ImageTestsConfig holds the test-related configuration for an image.

type Origin

type Origin struct {
	// Type indicates how the source file should be acquired.
	Type OriginType `` /* 153-byte string literal not displayed */
	// Uri to download the source file from if origin type is 'download'. Ignored for other origin types.
	Uri string `` /* 200-byte string literal not displayed */

	// Script is the filename of a shell script, relative to the component's spec directory,
	// that is run inside a mock chroot to generate this source file.
	// Required when [Origin.Type] is 'custom'; must be empty otherwise.
	Script string `` /* 234-byte string literal not displayed */

	// MockPackages is a list of RPM package names to install in the mock chroot before
	// running [Origin.Script]. Only valid when [Origin.Type] is 'custom'.
	MockPackages []string `` /* 227-byte string literal not displayed */

	// Inputs is a list of source-output filenames to copy next to [Origin.Script]
	// before it runs. Each entry must be a plain filename. Only valid when
	// [Origin.Type] is 'custom'.
	Inputs []string `` /* 214-byte string literal not displayed */
}

Origin describes where a source file comes from and how to retrieve it. When omitted from a source file reference, the file will be resolved via the lookaside cache.

func (Origin) HashInclude added in v0.2.0

func (o Origin) HashInclude(field string, _ any) (bool, error)

HashInclude implements the hashstructure [Includable] interface so that Origin.Script, Origin.MockPackages, and Origin.Inputs are omitted from the component fingerprint when they hold their zero values.

type OriginType

type OriginType string

OriginType indicates the type of origin for a source file.

const (
	// OriginTypeURI indicates that the source file is fetched from a URI.
	OriginTypeURI OriginType = "download"

	// OriginTypeCustom indicates that the source file is generated by running a local
	// shell script inside a mock chroot. The script is expected to populate a specific
	// output directory; azldev then packages that directory into a deterministic archive.
	OriginTypeCustom OriginType = "custom"
)

type OverlayCategory added in v0.2.0

type OverlayCategory string

OverlayCategory is a classification label for an overlay's intent. Categories help reviewers and tooling reason about why an overlay exists and when it can be removed.

const (
	// OverlayCategoryUpstreamBackport applies a fix backported from an upstream source
	// (Fedora dist-git or the component's OSS project) that AZL will inherit once its
	// upstream pin bumps past the fix.
	OverlayCategoryUpstreamBackport OverlayCategory = "upstream-backport"
	// OverlayCategoryAZLPruning removes content from a component for AZL: dependencies that
	// are not shipped, unneeded features, subpackages, or files. Replaces the more granular
	// historical 'azl-dependency-pruning' and 'azl-feature-disablement' categories.
	OverlayCategoryAZLPruning OverlayCategory = "azl-pruning"
	// OverlayCategoryAZLCompatibility makes a component work in the AZL build/runtime
	// environment: toolchain and mock adjustments and similar compatibility fixes that
	// are not themselves backports.
	OverlayCategoryAZLCompatibility OverlayCategory = "azl-compatibility"
	// OverlayCategoryAZLTemporaryWorkaround marks overlays that are explicitly intended to be
	// dropped once an upstream or environmental fix lands. This covers both overlays that
	// work around a runtime or build dependency that has not yet been imported into AZL
	// and any other transient workaround waiting on an external change.
	OverlayCategoryAZLTemporaryWorkaround OverlayCategory = "azl-temp-workaround"
	// OverlayCategoryAZLBrandingPolicy handles Fedora→Azure Linux identity differences:
	// name/path/vendor conventions and fixes for specs that hard-code Fedora identity
	// strings (e.g. `_vendor=redhat`, `redhat-linux` triples). Use `upstream-status` to
	// distinguish permanent AZL choices from fallout that could be upstreamed.
	OverlayCategoryAZLBrandingPolicy OverlayCategory = "azl-branding-policy"
	// OverlayCategoryAZLDisableFlakyTests skips tests that fail intermittently or due to
	// environmental flakiness rather than a real problem with the component,
	// may require retry logic / improve the tests.
	OverlayCategoryAZLDisableFlakyTests OverlayCategory = "azl-disable-flaky-tests"
	// OverlayCategoryAZLDisableUnsupportedTests skips tests that cannot meaningfully run
	// in AZL's build/runtime environment (e.g. tests that require network access, root,
	// or hardware that is unavailable in mock), may require figuring out how to extend support.
	OverlayCategoryAZLDisableUnsupportedTests OverlayCategory = "azl-disable-unsupported-tests"
	// OverlayCategoryAZLSecurityCompliance applies FIPS or crypto policy changes.
	OverlayCategoryAZLSecurityCompliance OverlayCategory = "azl-security-compliance"
	// OverlayCategoryAZLReleaseManagement adjusts release tag and changelog mechanics.
	OverlayCategoryAZLReleaseManagement OverlayCategory = "azl-release-management"
	// OverlayCategoryAZLPlatformAdaptation applies architecture-specific adjustments.
	OverlayCategoryAZLPlatformAdaptation OverlayCategory = "azl-platform-adaptation"
)

func (OverlayCategory) IsValid added in v0.2.0

func (c OverlayCategory) IsValid() bool

IsValid reports whether c is one of the recognized OverlayCategory values.

type OverlayFile added in v0.2.0

type OverlayFile struct {
	// Metadata is the shared metadata for every overlay in this file. Required.
	Metadata OverlayMetadata `toml:"metadata"`

	// Overlays is the ordered list of overlays applied by this file. Must be non-empty.
	// Per-overlay `metadata` is not allowed — the file-level [OverlayFile.Metadata] is
	// the single source of truth.
	Overlays []ComponentOverlay `toml:"overlays"`
}

OverlayFile is the on-disk representation of a single overlay document. Each file represents one logical change: the file-level OverlayFile.Metadata is applied to every overlay in OverlayFile.Overlays at load time, after which the resulting overlays are appended to the owning component's ComponentConfig.Overlays slice.

type OverlayMetadata added in v0.2.0

type OverlayMetadata struct {
	// Category classifies the overlay's intent. Required.
	Category OverlayCategory `` /* 382-byte string literal not displayed */

	// Commits references upstream commits (typically Fedora dist-git or upstream-project
	// commits) that this overlay backports or references. Each entry must carry an
	// http(s) URL (see [URLRef]).
	Commits []URLRef `` /* 168-byte string literal not displayed */

	// Bugs holds references to issue-tracker entries related to this overlay. Each entry
	// must carry an http(s) URL (see [URLRef]).
	Bugs []URLRef `` /* 175-byte string literal not displayed */

	// UpstreamStatus classifies the overlay's relationship to its upstream project.
	// Required. Use [OverlayUpstreamStatusUnknown] when the assessment has not been
	// made yet; reviewers should push for a definite status before approving.
	UpstreamStatus OverlayUpstreamStatus `` /* 252-byte string literal not displayed */
}

OverlayMetadata describes the intent and provenance of an overlay. It is documentation only — it does not affect how the overlay is applied and is excluded from component fingerprints. When present, it must declare a OverlayMetadata.Category; other fields are optional but constrained by category-specific rules (see OverlayMetadata.Validate).

func (*OverlayMetadata) Validate added in v0.2.0

func (m *OverlayMetadata) Validate() error

Validate checks that the metadata is internally consistent: the category is recognized, category-specific required fields are present, and URL-shaped fields parse as http(s) URLs.

type OverlayUpstreamStatus added in v0.2.0

type OverlayUpstreamStatus string

OverlayUpstreamStatus classifies an overlay's relationship to its upstream project. It distinguishes "already upstream", "could be upstreamed", "needs an upstream mechanism first", "permanent AZL-only deviation", and "not yet assessed".

const (
	// OverlayUpstreamStatusUpstreamed indicates the change is already in Fedora / the
	// upstream project. The overlay is carried only until AZL bumps past the fix.
	OverlayUpstreamStatusUpstreamed OverlayUpstreamStatus = "upstreamed"
	// OverlayUpstreamStatusUpstreamable indicates the change could be sent upstream
	// as-is. Reviewers should ask the author to link the upstream PR.
	OverlayUpstreamStatusUpstreamable OverlayUpstreamStatus = "upstreamable"
	// OverlayUpstreamStatusNeedsUpstreamHook indicates an AZL specialization that today
	// requires invasive spec edits; upstream could add a bcond / ifdef / config knob
	// that would let us drop the overlay. Reviewers should ask whether the hook can be
	// upstreamed instead of the change itself.
	OverlayUpstreamStatusNeedsUpstreamHook OverlayUpstreamStatus = "needs-upstream-hook"
	// OverlayUpstreamStatusInapplicable indicates a permanent AZL-only deviation.
	// Reviewers should push back on why we have to fork upstream forever.
	OverlayUpstreamStatusInapplicable OverlayUpstreamStatus = "inapplicable"
	// OverlayUpstreamStatusUnknown indicates the author has not yet assessed the
	// overlay's upstream story. Reviewers should push for a definite status before
	// approving.
	OverlayUpstreamStatusUnknown OverlayUpstreamStatus = "unknown"
)

func (OverlayUpstreamStatus) IsValid added in v0.2.0

func (s OverlayUpstreamStatus) IsValid() bool

IsValid reports whether s is one of the recognized OverlayUpstreamStatus values.

type PackageConfig added in v0.2.0

type PackageConfig struct {
	// Publish holds the publish settings for this package.
	Publish PackagePublishConfig `` /* 157-byte string literal not displayed */
}

PackageConfig holds all configuration applied to a single binary package. Currently only publish settings are supported; additional fields may be added in the future.

func ResolvePackageConfig added in v0.2.0

func ResolvePackageConfig(pkgName string, comp *ComponentConfig, proj *ProjectConfig) (PackageConfig, error)

ResolvePackageConfig returns the effective PackageConfig for a binary package produced by a component, merging contributions from all applicable config layers.

Resolution order (each layer overrides the previous — later wins):

  1. The project's DefaultPackageConfig (lowest priority)
  2. The PackageGroupConfig whose Packages list contains pkgName, if any
  3. The component's explicit Packages entry for the exact package name (highest priority)

func (*PackageConfig) MergeUpdatesFrom added in v0.2.0

func (p *PackageConfig) MergeUpdatesFrom(other *PackageConfig) error

MergeUpdatesFrom updates the package config with non-zero values from other.

type PackageGroupConfig added in v0.2.0

type PackageGroupConfig struct {
	// Description is an optional human-readable description of this group.
	Description string `` /* 149-byte string literal not displayed */

	// Packages is an explicit list of binary package names that belong to this group.
	Packages []string `` /* 160-byte string literal not displayed */

	// DefaultPackageConfig is the configuration applied to all packages listed in Packages.
	DefaultPackageConfig PackageConfig `` /* 185-byte string literal not displayed */
}

PackageGroupConfig defines a named group of binary packages with shared configuration. It is analogous to ComponentGroupConfig for components.

If a binary package name appears in a group's PackageGroupConfig.Packages list, that group's PackageGroupConfig.DefaultPackageConfig is applied when resolving the package's PackageConfig. A package may belong to at most one group.

func (*PackageGroupConfig) Validate added in v0.2.0

func (g *PackageGroupConfig) Validate() error

Validate checks that all package names in the group are non-empty and unique within the group.

type PackagePublishConfig added in v0.2.0

type PackagePublishConfig struct {
	// RPMChannel identifies the publish channel specifically for binary (non-debuginfo)
	// packages. When set at the package level, it overrides the component-level
	// [ComponentPublishConfig.RPMChannel]. When empty, the value is inherited. The
	// reserved value `"none"` keeps RPMs in the base directory and means they should
	// not be published.
	RPMChannel string `` /* 293-byte string literal not displayed */
	// DebugInfoChannel identifies the publish channel specifically for debuginfo packages.
	// When set at the package level, it overrides the component-level
	// [ComponentPublishConfig.DebugInfoChannel]. When empty, the value is inherited.
	// The reserved value `"none"` keeps RPMs in the base directory and means they
	// should not be published.
	DebugInfoChannel string `` /* 320-byte string literal not displayed */

	// Deprecated: use 'rpm-channel' instead. When set, the value is used as a fallback
	// for [PackagePublishConfig.RPMChannel] during channel resolution if 'rpm-channel' is not
	// already set. Kept for backwards compatibility with older config files.
	DeprecatedChannel string `` /* 251-byte string literal not displayed */
}

PackagePublishConfig holds publish settings for a single binary package. The zero value means all channels are inherited from a higher-priority config layer.

func (PackagePublishConfig) EffectiveRPMChannel added in v0.2.0

func (p PackagePublishConfig) EffectiveRPMChannel() string

EffectiveRPMChannel returns the configured RPM channel, falling back to the deprecated 'channel' field for backwards compatibility with older config files that predate the 'rpm-channel' field.

type PackageRepository

type PackageRepository struct {
	BaseURI string `toml:"base-uri" json:"baseUri" jsonschema:"required,title=Base URI,description=Base URI for the repository"`
}

Defines how to access the published repository for a distro.

func (PackageRepository) WithAbsolutePaths

func (r PackageRepository) WithAbsolutePaths(referenceDir string) PackageRepository

Returns a copy of the package repository definition with relative file paths converted to absolute file paths (relative to referenceDir, not the current working directory).

type ProjectConfig

type ProjectConfig struct {
	// Basic project info.
	Project ProjectInfo `toml:"project,omitempty" json:"project,omitempty" jsonschema:"title=Project Info,description=Basic project information"`
	// Definitions of component groups.
	ComponentGroups map[string]ComponentGroupConfig `` /* 165-byte string literal not displayed */
	// Definitions of components.
	Components map[string]ComponentConfig `` /* 142-byte string literal not displayed */
	// Definitions of images.
	Images map[string]ImageConfig `` /* 126-byte string literal not displayed */
	// Definitions of distros.
	Distros map[string]DistroDefinition `` /* 133-byte string literal not displayed */
	// Reusable resource definitions (e.g., RPM repositories) referenced from
	// elsewhere in the configuration.
	Resources ResourcesConfig `` /* 130-byte string literal not displayed */
	// Configuration for tools used by azldev.
	Tools ToolsConfig `` /* 135-byte string literal not displayed */

	// DefaultComponentConfig is the project-wide default applied to every component before any
	// component-group or component-level config is considered. It is the lowest-priority layer in
	// the component publish config resolution order.
	DefaultComponentConfig ComponentConfig `` /* 221-byte string literal not displayed */

	// DefaultPackageConfig is the project-wide default applied to every binary package before any
	// package-group or component-level config is considered. It is the lowest-priority layer in the
	// package config resolution order.
	DefaultPackageConfig PackageConfig `` /* 220-byte string literal not displayed */

	// Definitions of package groups with shared configuration.
	PackageGroups map[string]PackageGroupConfig `` /* 182-byte string literal not displayed */

	// Definitions of test suites.
	TestSuites map[string]TestSuiteConfig `` /* 145-byte string literal not displayed */

	// Root config file path; not serialized.
	RootConfigFilePath string `toml:"-" json:"-"`
	// Map from component names to groups they belong to; not serialized.
	GroupsByComponent map[string][]string `toml:"-" json:"-"`
}

Encapsulates loaded project configuration.

func LoadProjectConfig

func LoadProjectConfig(
	dryRunnable opctx.DryRunnable,
	fs opctx.FS,
	osEnv opctx.OSEnv,
	referenceDir string,
	disableDefaultConfig bool,
	tempDirPath string,
	extraConfigFilePaths []string,
	permissiveConfigParsing bool,
) (projectDir string, config *ProjectConfig, err error)

LoadProjectConfig takes a reference directory, searches for the project's configuration, and loads it with any appropriate default configurations appropriately incorporated. If needed, this function may make use of the provided temporary directory, with the expectation that the caller is responsible for cleaning it up -- but not until after it is done using the loaded configuration. The loaded configuration may implicitly depend on the contents of the temporary directory.

func NewProjectConfig

func NewProjectConfig() ProjectConfig

Constructs a default (empty) project configuration.

func (*ProjectConfig) Validate

func (cfg *ProjectConfig) Validate() error

Validates the configuration, returning an error if any semantic errors are found.

type ProjectInfo

type ProjectInfo struct {
	// Human-readable description of this project.
	Description string `` /* 135-byte string literal not displayed */

	// Path to log directory to use for this project.
	LogDir string `` /* 132-byte string literal not displayed */
	// Path to temp work directory to use for this project.
	WorkDir string `` /* 145-byte string literal not displayed */
	// Path to output directory to use for this project.
	OutputDir string `` /* 143-byte string literal not displayed */

	// Path to the output directory for rendered specs (component render).
	RenderedSpecsDir string `` /* 175-byte string literal not displayed */

	// Path to the directory for per-component lock files.
	LockDir string `` /* 149-byte string literal not displayed */

	// Default-selected distro. May be overridden at runtime.
	DefaultDistro DistroReference `` /* 142-byte string literal not displayed */

	// Default email address used for synthetic changelog entries and commits
	// when no author email is available (e.g. when no synthetic commits exist).
	DefaultAuthorEmail string `` /* 183-byte string literal not displayed */
}

Basic information regarding a project.

func (*ProjectInfo) ApplyProjectDefaults added in v0.2.0

func (p *ProjectInfo) ApplyProjectDefaults(projectDir string)

ApplyProjectDefaults fills in any unset path fields with their project-relative defaults. Should be called once after all config files have been merged, so that user-provided values always win over defaults.

To add a new path default:

  1. Define a `Default<Field>` constant above
  2. Add a line below

func (*ProjectInfo) MergeUpdatesFrom

func (p *ProjectInfo) MergeUpdatesFrom(other *ProjectInfo) error

Mutates the project info, updating it with overrides present in other.

func (*ProjectInfo) WithAbsolutePaths

func (p *ProjectInfo) WithAbsolutePaths(referenceDir string) *ProjectInfo

Returns a copy of the project info with relative file paths converted to absolute file paths (relative to referenceDir, not the current working directory).

type PytestConfig added in v0.2.0

type PytestConfig struct {
	// WorkingDir is the directory to use as the current working directory when running pytest.
	// Relative paths are resolved against the config file's directory.
	WorkingDir string `` /* 149-byte string literal not displayed */

	// TestPaths is the list of test file paths or directories to pass to pytest as positional
	// arguments. Glob patterns (e.g., cases/test_*.py) are expanded relative to WorkingDir.
	TestPaths []string `` /* 173-byte string literal not displayed */

	// ExtraArgs is the list of additional arguments to pass to pytest. These are passed
	// verbatim after placeholder substitution. Use {image-path} as a placeholder for the
	// image path, which will be substituted at runtime.
	ExtraArgs []string `` /* 194-byte string literal not displayed */

	// Install specifies how Python dependencies are installed into the venv before running
	// pytest. Defaults to "none" (no install) when not specified.
	Install PytestInstallMode `` /* 219-byte string literal not displayed */
}

PytestConfig holds configuration specific to pytest-based test suites.

func (*PytestConfig) EffectiveInstallMode added in v0.2.0

func (p *PytestConfig) EffectiveInstallMode() PytestInstallMode

EffectiveInstallMode returns the install mode, defaulting to PytestInstallNone when the field is not set.

func (*PytestConfig) Validate added in v0.2.0

func (p *PytestConfig) Validate() error

Validate checks that the PytestConfig fields are valid.

type PytestInstallMode added in v0.2.0

type PytestInstallMode string

PytestInstallMode specifies how Python dependencies are installed for a pytest suite.

const (
	// PytestInstallPyproject installs dependencies from pyproject.toml using editable mode.
	// Returns an error if pyproject.toml is not found in the working directory.
	PytestInstallPyproject PytestInstallMode = "pyproject"
	// PytestInstallRequirements installs dependencies from requirements.txt.
	// Returns an error if requirements.txt is not found.
	PytestInstallRequirements PytestInstallMode = "requirements"
	// PytestInstallNone skips dependency installation entirely. This is the default
	// when [PytestConfig.Install] is not specified — pytest must already be available
	// in the venv (e.g., pre-installed, or installed by the test author out-of-band).
	PytestInstallNone PytestInstallMode = "none"
)

type ReleaseCalculation added in v0.2.0

type ReleaseCalculation string

ReleaseCalculation controls how the Release tag is managed during rendering.

const (
	// ReleaseCalculationAuto is the default. azldev auto-detects whether the spec uses
	// %autorelease or a static integer release, and handles each accordingly.
	ReleaseCalculationAuto ReleaseCalculation = "auto"

	// ReleaseCalculationAutorelease explicitly declares that the spec uses %autorelease.
	// azldev skips all Release tag manipulation, letting rpmautospec resolve the release
	// number from git history. Use this for specs with conditional %autorelease/%else
	// fallbacks that confuse auto-detection.
	ReleaseCalculationAutorelease ReleaseCalculation = "autorelease"

	// ReleaseCalculationStatic explicitly declares that the spec uses a static
	// release tag. azldev parses and bumps the release value during rendering.
	// Use this for specs with conditional Release tags where auto-detection
	// picks the wrong branch but the static release logic still works correctly.
	ReleaseCalculationStatic ReleaseCalculation = "static"

	// ReleaseCalculationManual skips all automatic Release tag manipulation. Use this for
	// components that manage their own release numbering (e.g. kernel).
	ReleaseCalculationManual ReleaseCalculation = "manual"
)

type ReleaseConfig added in v0.2.0

type ReleaseConfig struct {
	// Calculation controls how the Release tag is managed during rendering.
	Calculation ReleaseCalculation `` /* 317-byte string literal not displayed */
}

ReleaseConfig holds release-related configuration for a component.

type ResourcesConfig added in v0.2.0

type ResourcesConfig struct {
	// RpmRepos is the set of reusable RPM repository definitions, keyed by name.
	RpmRepos map[string]RpmRepoResource `` /* 142-byte string literal not displayed */

	// RpmRepoSetTemplates defines named layout templates that describe a fixed
	// matrix of sub-repos (e.g., the standard Azure Linux base/sdk x main/debuginfo/srpms
	// matrix, or a Koji dist-repo layout). Templates are instantiated by [RpmRepoSet]
	// entries.
	RpmRepoSetTemplates map[string]RpmRepoSetTemplate `` /* 195-byte string literal not displayed */

	// RpmRepoSets instantiates a [RpmRepoSetTemplate] for a specific deployment by
	// supplying a base URI and shared GPG configuration. Each set expands at validation
	// time into one or more synthesized [RpmRepoResource] entries; consumers reach the
	// expanded repos via [ResourcesConfig.EffectiveRpmRepos].
	RpmRepoSets map[string]RpmRepoSet `` /* 172-byte string literal not displayed */
}

ResourcesConfig is a top-level container for reusable, named resource definitions referenced from elsewhere in the configuration (e.g., from a distro version's DistroVersionDefinition.Inputs).

The container is intentionally namespaced (e.g., resources.rpm-repos rather than rpm-repos) so that future sibling resource types (container registries, signing keys, etc.) can live under the same top-level key without crowding the schema.

JSONSchemaExtend uses a value receiver because the invopop/jsonschema library only invokes value-receiver methods when reflecting on the type; the rest of the methods use pointer receivers because they mutate.

func (*ResourcesConfig) EffectiveRpmRepos added in v0.2.0

func (r *ResourcesConfig) EffectiveRpmRepos() (map[string]RpmRepoResource, error)

EffectiveRpmRepos returns the union of explicitly-defined RpmRepoResource entries and the entries synthesized by expanding each RpmRepoSet. Conflicts are reported as errors.

Path-typed inputs (e.g. relative `gpg-key` values) must already be absolutized before calling this method — that happens during config load/merge via [WithAbsolutePaths]. This method itself only joins each set's `base-uri` with each sub-repo's `subpath` and validates the result; it does not resolve any remaining relative paths.

Validation rules applied during expansion:

  • Every set's `template` must resolve to a defined RpmRepoSetTemplate.
  • Every name in `subrepos` (the set's allowlist) must match a sub-repo in the referenced template.
  • Synthesized repo IDs (`<name-prefix><subrepo.name>`) must satisfy the same grammar as explicit repo names, and must not collide with explicit RpmRepoResource entries or with other sets' expansions.
  • The set's `base-uri` must be an http(s) URL; sub-repo subpaths must be relative (no leading `/`, no `..` segments).

func (*ResourcesConfig) IsEmpty added in v0.2.0

func (r *ResourcesConfig) IsEmpty() bool

IsEmpty reports whether the ResourcesConfig contains no entries.

func (ResourcesConfig) JSONSchemaExtend added in v0.2.0

func (ResourcesConfig) JSONSchemaExtend(schema *jsonschema.Schema)

JSONSchemaExtend tightens the generated schema for the resources maps so editors can flag invalid names at edit time. The runtime validator ([validateRpmRepoName]) is the source of truth; this keeps the schema in sync.

func (*ResourcesConfig) MergeUpdatesFrom added in v0.2.0

func (r *ResourcesConfig) MergeUpdatesFrom(other *ResourcesConfig)

MergeUpdatesFrom mutates r, updating it with overrides present in other. Maps are merged by key with **wholesale replacement** at the entry level: a duplicate name in `other` fully replaces the existing entry, including any fields that happen to be the Go zero value in the new entry. This avoids subtle bugs where, e.g., a later config file intentionally setting `disable-gpg-check = false` (the zero value) would otherwise fail to override an earlier `true`.

func (*ResourcesConfig) WithAbsolutePaths added in v0.2.0

func (r *ResourcesConfig) WithAbsolutePaths(referenceDir string) *ResourcesConfig

WithAbsolutePaths returns a copy of the ResourcesConfig with relative path-shaped fields (currently only `gpg-key`) resolved relative to referenceDir and re-emitted as absolute `file://` URIs. URI-shaped fields are returned unchanged.

This runs at TOML load time, so the consumers (mock / kiwi) only ever see absolute references — no working-directory ambiguity at run time.

type RpmRepoResource added in v0.2.0

type RpmRepoResource struct {
	// Description is a human-readable description of the repository. Used only
	// for `azldev config dump` and similar diagnostics; not projected into dnf
	// or kiwi configuration (avoids newline/encoding pitfalls).
	Description string `` /* 145-byte string literal not displayed */

	// Type discriminates the repository's access protocol. Defaults to "rpm-md" when unset.
	Type RpmRepoType `` /* 138-byte string literal not displayed */

	// BaseURI is the repository base URI (dnf's `baseurl`). Mutually exclusive with
	// [RpmRepoResource.Metalink]. Either BaseURI or Metalink must be set for type "rpm-md".
	BaseURI string `` /* 221-byte string literal not displayed */

	// Metalink is the repository metalink URL. Mutually exclusive with [RpmRepoResource.BaseURI].
	Metalink string `` /* 212-byte string literal not displayed */

	// DisableGPGCheck disables GPG signature verification for this repo. The zero
	// value (false) means GPG checking is *enabled* — the safe default. Setting
	// this to true is an explicit opt-out and load-time validation requires either
	// `disable-gpg-check = true` or a non-empty `gpg-key`.
	DisableGPGCheck bool `` /* 200-byte string literal not displayed */

	// GPGKey is a path or URI to the GPG key used to verify signatures.
	//
	// Accepted forms:
	//   * `https://...` or `http://...` URI: passed through verbatim to both consumers.
	//   * `file:///absolute/path`: passed through verbatim. Note that mock evaluates this
	//     *inside* the chroot, while kiwi evaluates it on the host. Prefer http(s)://
	//     for portability across consumers.
	//   * Bare path: resolved at TOML-load time relative to the directory containing the
	//     defining TOML file, then emitted to consumers as a `file://` URI.
	GPGKey string `` /* 240-byte string literal not displayed */

	// Arches optionally restricts the repository to a specific list of target architectures
	// (e.g., ["x86_64"]). When empty, the repository is available for all architectures.
	Arches []string `` /* 140-byte string literal not displayed */
}

RpmRepoResource describes a single reusable RPM repository. Per-distro-version configuration (DistroVersionDefinition.Inputs) selects which repos are made available to which build use-cases (rpm-build, image-build).

dnf-side variables ($basearch, $releasever) in `base-uri`/`metalink`/`gpg-key` fields are passed through verbatim and expanded by the consuming tool (mock/dnf or kiwi).

**GPG checking defaults to enabled** (the safe default). Set `disable-gpg-check = true` to opt out. A repo with GPG checking enabled and no `gpg-key` is invalid; load-time validation rejects it.

JSONSchemaExtend uses a value receiver because the invopop/jsonschema library only invokes value-receiver methods when reflecting on the type; the rest of the methods use pointer receivers because they read shared state.

func (*RpmRepoResource) EffectiveType added in v0.2.0

func (r *RpmRepoResource) EffectiveType() RpmRepoType

EffectiveType returns the repository type, applying the rpm-md default when RpmRepoResource.Type is unset.

func (*RpmRepoResource) IsAvailableForArch added in v0.2.0

func (r *RpmRepoResource) IsAvailableForArch(arch string) bool

IsAvailableForArch reports whether the repository is available for the given target architecture. A repository with no RpmRepoResource.Arches restriction is available for all architectures.

func (*RpmRepoResource) IsLocalGPGKey added in v0.2.0

func (r *RpmRepoResource) IsLocalGPGKey() bool

IsLocalGPGKey reports whether the repo's gpg-key (if any) refers to a local filesystem path (either bare or via a `file://` URI). This is the form that does NOT work for rpm-build (mock) consumers because mock evaluates the URI inside the chroot.

func (RpmRepoResource) JSONSchemaExtend added in v0.2.0

func (RpmRepoResource) JSONSchemaExtend(schema *jsonschema.Schema)

JSONSchemaExtend tightens the generated schema for an RpmRepoResource so that editors can flag invalid TOML at edit time. Mirrors the runtime constraints in [validateRpmRepo]:

  • exactly one of `base-uri` / `metalink` must be set;
  • `gpg-key` must be a bare path or an `http://` / `https://` / `file://` URI.

The runtime validator is the source of truth; this keeps the schema in sync.

type RpmRepoSet added in v0.2.0

type RpmRepoSet struct {
	// Description is a human-readable description (diagnostic only).
	Description string `` /* 145-byte string literal not displayed */

	// Template is the name of the [RpmRepoSetTemplate] to instantiate. Must
	// resolve to a defined template at validation time.
	Template string `` /* 129-byte string literal not displayed */

	// BaseURI is the URL prefix under which all sub-repos for this deployment
	// live. The synthesized repo's `base-uri` is `BaseURI/<subrepo.subpath>`.
	BaseURI string `` /* 171-byte string literal not displayed */

	// NamePrefix is prepended to each sub-repo's `name` to form the synthesized
	// repo ID. May be empty, in which case bare sub-repo names are used (only
	// safe when no other set or explicit repo collides with those names).
	NamePrefix string `` /* 153-byte string literal not displayed */

	// GPGKey is the shared GPG key for sub-repos in this set; same shape rules
	// as [RpmRepoResource.GPGKey] apply.
	GPGKey string `` /* 240-byte string literal not displayed */

	// DisableGPGCheck opts out of GPG signature verification for sub-repos in
	// this set; same default semantics as [RpmRepoResource.DisableGPGCheck].
	DisableGPGCheck bool `` /* 176-byte string literal not displayed */

	// Arches optionally restricts every synthesized repo in this set to a
	// specific list of target architectures. Empty = all.
	Arches []string `` /* 140-byte string literal not displayed */

	// Subrepos is an optional allowlist of sub-repo names from the referenced
	// template to instantiate. When unset (or empty), every sub-repo in the
	// template is instantiated. When non-empty, only the listed sub-repos are
	// instantiated. Listed names must match a sub-repo declared in the
	// referenced template.
	Subrepos []string `` /* 154-byte string literal not displayed */
}

RpmRepoSet instantiates an RpmRepoSetTemplate for a specific deployment by supplying a base URI and shared GPG configuration. At validation time each set expands into one synthesized RpmRepoResource per included sub-repo, keyed by `<name-prefix><subrepo.name>`.

type RpmRepoSetTemplate added in v0.2.0

type RpmRepoSetTemplate struct {
	// Description is a human-readable description of the layout (diagnostic only).
	Description string `` /* 145-byte string literal not displayed */

	// Subrepos is the ordered list of sub-repo entries that make up the layout.
	Subrepos []SubrepoSpec `toml:"subrepos" json:"subrepos" jsonschema:"required,title=Sub-repos,description=Ordered list of sub-repos in the layout"`
}

RpmRepoSetTemplate is a named layout that describes a fixed set of sub-repos hosted under a common URL prefix. Templates are reusable across deployments; pair a template with a RpmRepoSet to produce a concrete bundle of repos.

type RpmRepoType added in v0.2.0

type RpmRepoType string

RpmRepoType is the type discriminator for an RpmRepoResource. New types may be added in the future (e.g., "rpm-dir" for unindexed directories of RPMs, or "oci" for delta-RPM repos hosted in container registries). For now, only "rpm-md" is supported.

const (
	// RpmRepoTypeRpmMd designates a standard rpm-md (dnf) repository accessed via a
	// `base-uri` or `metalink`. This is the default when [RpmRepoResource.Type] is unset.
	RpmRepoTypeRpmMd RpmRepoType = "rpm-md"
)

func (RpmRepoType) IsValid added in v0.2.0

func (t RpmRepoType) IsValid() bool

IsValid reports whether the given RpmRepoType is a value the loader currently understands.

type SourceFileReference

type SourceFileReference struct {
	// Reference to the component to which the source file belongs.
	Component ComponentReference `toml:"-" json:"-" fingerprint:"-"`

	// Name of the source file; must be non-empty.
	Filename string `toml:"filename" json:"filename"`

	// Hash of the source file, expressed as a hex string.
	Hash string `toml:"hash,omitempty" json:"hash,omitempty"`

	// Type of hash used by Hash (e.g., "SHA256", "SHA512").
	HashType fileutils.HashType `` /* 156-byte string literal not displayed */

	// Origin for this source file. When omitted, the file is resolved via the lookaside cache.
	Origin Origin `toml:"origin,omitempty" json:"origin,omitempty"`

	// ReplaceUpstream, when true, intentionally replaces an upstream entry with the same
	// [SourceFileReference.Filename] in the dist-git 'sources' file. The matching upstream
	// entry must exist or source preparation fails. When false (the default), a filename
	// collision with an existing 'sources' entry is treated as an error.
	// [SourceFileReference.ReplaceReason] is required when this is true.
	ReplaceUpstream bool `` /* 228-byte string literal not displayed */

	// ReplaceReason is a human-readable explanation for why an upstream 'sources' entry is
	// being replaced. Required when [SourceFileReference.ReplaceUpstream] is true; must be
	// empty otherwise. Excluded from the fingerprint because it is documentation only.
	ReplaceReason string `` /* 214-byte string literal not displayed */
}

SourceFileReference encapsulates a reference to a specific source file artifact.

func (SourceFileReference) HashInclude added in v0.2.0

func (r SourceFileReference) HashInclude(field string, _ any) (bool, error)

HashInclude implements the hashstructure [Includable] interface so that SourceFileReference.Origin is omitted from the component fingerprint when none of Origin.Script, Origin.MockPackages, or Origin.Inputs are set.

type SpecSource

type SpecSource struct {
	// SourceType indicates the type of source for the spec.
	SourceType SpecSourceType `` /* 186-byte string literal not displayed */

	// Path indicates the path to the spec file; only relevant for local specs.
	// Excluded from fingerprint because it contains an absolute path that varies by checkout
	// location. Spec content identity is captured separately via [fingerprint.IdentityOptions.SourceIdentity].
	Path string `` /* 239-byte string literal not displayed */

	// UpstreamDistro indicates the upstream distro providing the spec; only relevant for upstream specs.
	UpstreamDistro DistroReference `` /* 163-byte string literal not displayed */

	// UpstreamName indicates the name of the component in the upstream distro; only relevant for upstream specs.
	UpstreamName string `` /* 230-byte string literal not displayed */

	// UpstreamCommit pins the upstream spec to a specific git commit hash; only relevant for upstream specs.
	// When set, this takes priority over the snapshot date-time on the distro reference.
	UpstreamCommit string `` /* 339-byte string literal not displayed */
}

Provides source information for locating the spec for a component.

func (*SpecSource) String

func (s *SpecSource) String() string

Implements the [Stringer] interface.

type SpecSourceType

type SpecSourceType string

Type of source for a spec.

const (
	// Default (unspecified) source.
	SpecSourceTypeUnspecified SpecSourceType = ""
	// Local source: the spec is present in the local filesystem.
	SpecSourceTypeLocal SpecSourceType = "local"
	// Upstream source: the spec is present in an upstream source (may not local).
	SpecSourceTypeUpstream SpecSourceType = "upstream"
)

type SubrepoKind added in v0.2.0

type SubrepoKind string

SubrepoKind classifies a sub-repo within an RpmRepoSetTemplate by the type of RPMs it carries. Consumers (and authors of allowlist filters) use the kind when reasoning about a sub-repo's role in a build.

const (
	// SubrepoKindBinary identifies a sub-repo carrying ordinary binary RPMs.
	// This is the default when [SubrepoSpec.Kind] is unset.
	SubrepoKindBinary SubrepoKind = "binary"
	// SubrepoKindDebug identifies a sub-repo carrying debuginfo / debugsource RPMs.
	SubrepoKindDebug SubrepoKind = "debug"
	// SubrepoKindSource identifies a sub-repo carrying source RPMs (SRPMs).
	SubrepoKindSource SubrepoKind = "source"
)

func (SubrepoKind) Default added in v0.2.0

func (k SubrepoKind) Default() SubrepoKind

Default returns the kind, defaulting to SubrepoKindBinary when unset.

func (SubrepoKind) IsValid added in v0.2.0

func (k SubrepoKind) IsValid() bool

IsValid reports whether the given SubrepoKind is one this loader understands.

type SubrepoSpec added in v0.2.0

type SubrepoSpec struct {
	// Name is a stable short identifier for this sub-repo within the template
	// (e.g., "base", "base-debug"). Combined with the [RpmRepoSet]'s
	// `name-prefix` it forms the synthesized repo's ID, so it must satisfy the
	// same grammar as [RpmRepoResource] names.
	Name string `` /* 149-byte string literal not displayed */

	// Subpath is the relative path (under the set's base URI) that hosts the
	// sub-repo's repodata. May contain dnf-side variables such as `$basearch`,
	// which are passed through verbatim.
	Subpath string `` /* 140-byte string literal not displayed */

	// Kind classifies the sub-repo (binary, debug, source). Defaults to "binary".
	// Authors of [RpmRepoSet] entries can filter by kind only indirectly, by
	// listing specific sub-repo names in `subrepos`.
	Kind SubrepoKind `` /* 158-byte string literal not displayed */
}

SubrepoSpec describes one sub-repo entry within an RpmRepoSetTemplate. The `subpath` is appended to a RpmRepoSet's `base-uri` to form the synthesized repo's `base-uri`. `$basearch` (and any other dnf-side variables) are passed through verbatim and expanded by the consuming tool.

type TestSuiteConfig added in v0.2.0

type TestSuiteConfig struct {
	// The test suite's name; not present in serialized TOML files (populated from the map key).
	Name string `toml:"-" json:"name" table:",sortkey"`

	// Description of the test suite.
	Description string `` /* 131-byte string literal not displayed */

	// Type indicates the test framework to use.
	Type TestType `` /* 130-byte string literal not displayed */

	// Pytest holds pytest-specific configuration. Required when Type is "pytest".
	Pytest *PytestConfig `` /* 153-byte string literal not displayed */

	// Reference to the source config file that this definition came from; not present
	// in serialized files.
	SourceConfigFile *ConfigFile `toml:"-" json:"-" table:"-"`
}

TestSuiteConfig defines a named test suite.

func (*TestSuiteConfig) MergeUpdatesFrom added in v0.2.0

func (t *TestSuiteConfig) MergeUpdatesFrom(other *TestSuiteConfig) error

MergeUpdatesFrom updates the test suite config with overrides present in other.

func (*TestSuiteConfig) Validate added in v0.2.0

func (t *TestSuiteConfig) Validate() error

Validate checks that the test suite config has valid type-specific required fields and that only the matching subtable is present.

func (*TestSuiteConfig) WithAbsolutePaths added in v0.2.0

func (t *TestSuiteConfig) WithAbsolutePaths(referenceDir string) *TestSuiteConfig

WithAbsolutePaths returns a copy of the test suite config with relative file paths converted to absolute paths (relative to referenceDir).

type TestSuiteRef added in v0.2.0

type TestSuiteRef struct {
	// Name is the key into the top-level [test-suites] map.
	Name string `` /* 127-byte string literal not displayed */
}

TestSuiteRef is a reference to a named test suite. Using a structured type (rather than a bare string) allows per-test metadata to be added later without a breaking config change.

type TestType added in v0.2.0

type TestType string

TestType indicates the type of test framework used to run a test suite.

const (
	// TestTypePytest uses pytest to run static/offline validation checks.
	TestTypePytest TestType = "pytest"
	// TestTypeLisa uses LISA (Linux Integration Services Automation) to run VM-level tests.
	TestTypeLisa TestType = "lisa"
)

type ToolsConfig

type ToolsConfig struct {
	// Configuration for the Image Customizer tool.
	ImageCustomizer ImageCustomizerConfig `` /* 176-byte string literal not displayed */
}

Encapsulates information about the tools used by azldev.

func (*ToolsConfig) MergeUpdatesFrom

func (tc *ToolsConfig) MergeUpdatesFrom(other *ToolsConfig) error

type URLRef added in v0.2.0

type URLRef struct {
	// URL is the http(s) link to the referenced resource. Required.
	URL string `` /* 164-byte string literal not displayed */
}

URLRef is a typed reference to an external resource (an upstream commit, issue- tracker entry, or similar). Today it carries only a URL; the struct form leaves room for source-specific metadata to be added later without breaking the on-disk schema.

Jump to

Keyboard shortcuts

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