Documentation
¶
Index ¶
- func AddComponentsToConfig(fs opctx.FS, config *projectconfig.ProjectConfig, options *AddComponentOptions, ...) error
- func CheckOutputDir(env *azldev.Env, options *PrepareSourcesOptions) error
- func DiffComponentSources(env *azldev.Env, options *DiffSourcesOptions) (interface{}, error)
- func ListComponentConfigs(env *azldev.Env, options *ListComponentOptions) (results []projectconfig.ComponentConfig, err error)
- func NewBuildCmd(opts ...CmdOption) *cobra.Command
- func NewChangedCmd(opts ...CmdOption) *cobra.Command
- func NewComponentAddCommand() *cobra.Command
- func NewComponentListCommand(opts ...CmdOption) *cobra.Command
- func NewComponentMetadataCommand() *cobra.Command
- func NewComponentQueryCommand() *cobra.Command
- func NewComponentTestCmd() *cobra.Command
- func NewDiffSourcesCmd(opts ...CmdOption) *cobra.Command
- func NewHistoryCmd() *cobra.Command
- func NewPrepareSourcesCmd(opts ...CmdOption) *cobra.Command
- func NewRefreshUpstreamCommitCmd() *cobra.Command
- func NewRenderCmd(opts ...CmdOption) *cobra.Command
- func NewUpdateCmd() *cobra.Command
- func OnAppInit(app *azldev.App)
- func PlaceRPMsByChannel(env *azldev.Env, rpmResults []RPMResult, rpmsDir string) error
- func PrepareComponentSources(env *azldev.Env, options *PrepareSourcesOptions) error
- func QueryComponents(env *azldev.Env, options *QueryComponentsOptions) ([]*componentDetails, error)
- type AddComponentOptions
- type BuildEnvPreservePolicy
- type ChangedComponentOptions
- type ChangedResult
- type CmdOption
- type ComponentBuildOptions
- type ComponentBuildResults
- func BuildComponent(env *azldev.Env, component components.Component, ...) (ComponentBuildResults, error)
- func BuildComponents(env *azldev.Env, components *components.ComponentSet, ...) ([]ComponentBuildResults, error)
- func SelectAndBuildComponents(env *azldev.Env, options *ComponentBuildOptions) ([]ComponentBuildResults, error)
- type ComponentTestOptions
- type CustomizationItem
- type DiffSourcesOptions
- type FingerprintChange
- type HistoryOptions
- type HistoryResult
- type ListComponentOptions
- type MetadataInfo
- type MetadataOptions
- type MetadataSource
- type PrepareSourcesOptions
- type QueryComponentsOptions
- type RPMResult
- type RefreshUpstreamCommitOptions
- type RefreshUpstreamCommitResult
- type RenderOptions
- type RenderResult
- type UpdateComponentOptions
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddComponentsToConfig ¶
func AddComponentsToConfig( fs opctx.FS, config *projectconfig.ProjectConfig, options *AddComponentOptions, names []string, ) error
Updates project config to include new software components.
func CheckOutputDir ¶
func CheckOutputDir(env *azldev.Env, options *PrepareSourcesOptions) error
CheckOutputDir verifies the output directory state before source preparation. If the directory exists and is non-empty, it either removes it (when Force is set) or returns an actionable error suggesting --force.
func DiffComponentSources ¶
func DiffComponentSources(env *azldev.Env, options *DiffSourcesOptions) (interface{}, error)
DiffComponentSources computes the diff between original and overlaid sources for a single component. When color is enabled and the output format is not JSON, the returned value is a pre-colorized string. Otherwise it is *dirdiff.DiffResult for structured output.
func ListComponentConfigs ¶
func ListComponentConfigs( env *azldev.Env, options *ListComponentOptions, ) (results []projectconfig.ComponentConfig, err error)
ListComponentConfigs lists components in the env, in accordance with options. Lock validation is always skipped regardless of the caller's SkipLockValidation value — list is read-only.
func NewBuildCmd ¶
func NewChangedCmd ¶ added in v0.2.0
NewChangedCmd constructs a cobra.Command for the "component changed" CLI subcommand.
func NewComponentAddCommand ¶
Constructs a cobra.Command for "component add" CLI subcommand.
func NewComponentListCommand ¶
Constructs a cobra.Command for "component list" CLI subcommand.
func NewComponentMetadataCommand ¶ added in v1.1.0
NewComponentMetadataCommand constructs the 'component metadata' subcommand.
func NewComponentQueryCommand ¶
Constructs a cobra.Command for "component query" CLI subcommand.
func NewComponentTestCmd ¶ added in v1.0.0
NewComponentTestCmd constructs the 'component test' command.
func NewDiffSourcesCmd ¶
NewDiffSourcesCmd constructs a cobra.Command for the "component diff-sources" CLI subcommand.
func NewHistoryCmd ¶ added in v0.2.0
NewHistoryCmd constructs a cobra.Command for the "component history" CLI subcommand.
func NewPrepareSourcesCmd ¶
func NewRefreshUpstreamCommitCmd ¶ added in v1.0.0
NewRefreshUpstreamCommitCmd constructs the "component refresh-upstream-commit" command.
func NewRenderCmd ¶ added in v0.2.0
NewRenderCmd constructs a cobra.Command for the "component render" CLI subcommand.
func NewUpdateCmd ¶ added in v0.2.0
NewUpdateCmd constructs a cobra.Command for the "component update" CLI subcommand.
func OnAppInit ¶
Called once when the app is initialized; registers any commands or callbacks with the app.
func PlaceRPMsByChannel ¶ added in v0.2.0
PlaceRPMsByChannel moves each RPM with a configured channel from its initial location in rpmsDir to a channel-specific subdirectory rpmsDir/<channel>/. RPMs whose channel is empty or the reserved value "none" remain in rpmsDir. RPMResult.Path is updated in-place to reflect the final location of each RPM.
func PrepareComponentSources ¶
func PrepareComponentSources(env *azldev.Env, options *PrepareSourcesOptions) error
func QueryComponents ¶
func QueryComponents( env *azldev.Env, options *QueryComponentsOptions, ) ([]*componentDetails, error)
QueryComponents queries info for selected components by reading the locally rendered specs and running rpmspec against them in a single shared mock chroot. Returns one entry per successfully queried component, in the order returned by the resolver. Components with a RENDER_FAILED marker are skipped with a loud warning. Per-component rpmspec failures are surfaced as warnings; the corresponding entry is omitted from the result list and the function returns an aggregated error after attempting every component.
Types ¶
type AddComponentOptions ¶
type AddComponentOptions struct{}
Options for adding components to the project configuration.
type BuildEnvPreservePolicy ¶
type BuildEnvPreservePolicy string
BuildEnvPreservePolicy defines policy for when to preserve auto-created build environments.
const ( // BuildEnvPreserveOnFailure indicates build environments should only be preserved for failed builds. BuildEnvPreserveOnFailure BuildEnvPreservePolicy = "on-failure" // BuildEnvPreserveAlways indicates all build environments should be preserved. BuildEnvPreserveAlways BuildEnvPreservePolicy = "always" // BuildEnvPreserveNever indicates build environments should *never* be preserved (i.e., always destroyed). BuildEnvPreserveNever BuildEnvPreservePolicy = "never" )
func (*BuildEnvPreservePolicy) Set ¶
func (f *BuildEnvPreservePolicy) Set(value string) error
Set parses the format from a string; used by command-line parser.
func (*BuildEnvPreservePolicy) ShouldPreserve ¶
func (f *BuildEnvPreservePolicy) ShouldPreserve(buildSucceeded bool) bool
ShouldPreserve is a helper to decide whether to preserve a build environment, based on the policy and the actual results of the build.
func (*BuildEnvPreservePolicy) String ¶
func (f *BuildEnvPreservePolicy) String() string
func (*BuildEnvPreservePolicy) Type ¶
func (f *BuildEnvPreservePolicy) Type() string
Type returns a descriptive string used in command-line help.
type ChangedComponentOptions ¶ added in v0.2.0
type ChangedComponentOptions struct {
ComponentFilter components.ComponentFilter
// From is the git ref to compare from (e.g., branch, tag, commit hash).
From string
// To is the git ref to compare to. Defaults to HEAD.
To string
// IncludeUnchanged includes unchanged components in the output.
IncludeUnchanged bool
}
ChangedComponentOptions holds options for the component changed command.
type ChangedResult ¶ added in v0.2.0
type ChangedResult struct {
Component string `json:"component"`
ChangeType string `json:"changeType"`
SourcesChange bool `json:"sourcesChange"`
}
ChangedResult holds the change status for a single component.
func ChangedComponents ¶ added in v0.2.0
func ChangedComponents( env *azldev.Env, options *ChangedComponentOptions, ) ([]ChangedResult, error)
ChangedComponents determines which components changed between two git refs, using the comparison that matches the active mode: stored lock file fingerprints by default, or configuration resolved at each ref when the global '--without-lockfile' flag is set.
type CmdOption ¶ added in v1.0.0
type CmdOption func(*cmdOptions)
CmdOption customizes how a component command is constructed.
func WithoutLockfileFlags ¶ added in v1.0.0
func WithoutLockfileFlags() CmdOption
WithoutLockfileFlags omits the lock-file-specific flags from a component command. Commands are registered with this option when the global '--without-lockfile' flag selects lock-file-free mode, so the flags that only lock files can honor are never offered.
type ComponentBuildOptions ¶
type ComponentBuildOptions struct {
ComponentFilter components.ComponentFilter
ContinueOnError bool
NoCheck bool
WithoutGitRepo bool
RPMDevBumpspec bool
SourcePackageOnly bool
BuildEnvPolicy BuildEnvPreservePolicy
LocalRepoPaths []string
LocalRepoWithPublishPath string
// MockConfigOpts is an optional set of key-value config options that will be passed through
// to mock as --config-opts key=value arguments.
MockConfigOpts map[string]string
// contains filtered or unexported fields
}
type ComponentBuildResults ¶
type ComponentBuildResults struct {
// Names of the component that was built.
ComponentName string `json:"componentName"`
// Absolute paths to any source RPMs built by the operation.
SRPMPaths []string `json:"srpmPaths" table:"SRPM Paths"`
// SRPMChannel is the resolved publish channel for the SRPM.
// Empty when no channel is configured.
SRPMChannel string `json:"srpmPublishChannel,omitempty" table:"SRPM Publish Channel"`
// Absolute paths to any RPMs built by the operation.
RPMPaths []string `json:"rpmPaths" table:"RPM Paths"`
// RPMChannels holds the resolved publish channel for each RPM, parallel to [RPMPaths].
// Empty string means no channel was configured for that package.
RPMChannels []string `json:"rpmChannels" table:"Publish Channels"`
// RPMs contains enriched per-RPM information including the resolved publish channel.
RPMs []RPMResult `json:"rpms" table:"-"`
}
ComponentBuildResults summarizes the results of building a single component.
func BuildComponent ¶
func BuildComponent( env *azldev.Env, component components.Component, workDirFactory *workdir.Factory, options *ComponentBuildOptions, ) (ComponentBuildResults, error)
func BuildComponents ¶
func BuildComponents( env *azldev.Env, components *components.ComponentSet, options *ComponentBuildOptions, ) ([]ComponentBuildResults, error)
func SelectAndBuildComponents ¶
func SelectAndBuildComponents(env *azldev.Env, options *ComponentBuildOptions, ) ([]ComponentBuildResults, error)
type ComponentTestOptions ¶ added in v1.0.0
type ComponentTestOptions struct {
ImagePath string
RPMPaths []string
Tests []string
WorkDir string
Provision string
// SourceDir points tmt straight at a local fmf tree instead of cloning the
// catalog 'source' — any directory with an fmf root works, whether produced
// by 'azldev component render' (with render.skip-file-filter=true) or
// 'azldev component prepare-sources'.
SourceDir string
// Plan overrides 'tmt.plan' from the catalog. Empty means tmt itself
// discovers and runs every enabled plan it finds, instead of a fixed name
// (the virtual provisioner is the one exception: it requires an explicit
// plan, since hardware export is resolved per-plan).
Plan string
// FromSpec is deprecated: use SourceDir instead. When set, it resolves to
// the component's rendered spec directory, preserving the pre-rename
// '--from-spec' behavior for existing invocations.
FromSpec bool
}
ComponentTestOptions holds options for running component TMT tests locally.
type CustomizationItem ¶ added in v0.2.0
type CustomizationItem struct {
Kind string `json:"kind"`
Value string `json:"value,omitempty"`
Description string `json:"description,omitempty"`
}
CustomizationItem captures one user-authored customization on a component.
Kind is a dotted-namespace string forming part of the JSON wire contract (downstream `jq`/`gjson` consumers key on it). It is either an overlay type emitted verbatim (e.g. "spec-remove-tag", "patch-add") or a fixed token derived from the structured TOML path. The fixed set:
build.with, build.without, build.defines, build.undefines, build.check.skip, spec.source-type, spec.upstream-commit, spec.upstream-name, spec.upstream-distro, release.calculation, render.skip-file-filter, packages, source-files, source-files.replace-upstream
Adding a Kind is non-breaking; renaming or removing one is breaking. Value is a short summary suitable for table cells; Description is the human-readable rationale from the config (overlay.description, check.skip_reason, etc.).
type DiffSourcesOptions ¶
type DiffSourcesOptions struct {
ComponentFilter components.ComponentFilter
OutputFile string
// contains filtered or unexported fields
}
DiffSourcesOptions holds the options for the diff-sources command.
type FingerprintChange ¶ added in v0.2.0
type FingerprintChange struct {
Hash string `json:"hash"`
Author string `json:"author"`
AuthorEmail string `json:"authorEmail"`
Timestamp int64 `json:"timestamp"`
Message string `json:"message"`
UpstreamCommit string `json:"upstreamCommit,omitempty"`
}
FingerprintChange is the wire-level representation of one lock-file fingerprint change for the HistoryResult.FingerprintChangeDetails field. It mirrors the fields of sources.FingerprintChange (and its embedded sources.CommitMetadata) that consumers of `azldev component history` JSON output care about.
The fields are copied explicitly in [populateLockMetrics] rather than embedding sources.FingerprintChange directly so that:
- the JSON contract for this command is owned by this package, and
- dropping a field from the synthetic-history source type produces a compile error at the copy site instead of silently emptying the downstream changelog data.
type HistoryOptions ¶ added in v0.2.0
type HistoryOptions struct {
ComponentFilter components.ComponentFilter
// components that share their source TOML file with at least one other
// component:
// "show" (default): include the row, report the count, set SharedToml=true
// "omit": drop the row entirely
//
// JSON consumers always see the raw TomlCommits + SharedToml fields and
// can apply their own presentation (e.g., zero out shared rows) via jq.
SharedTomlMode string
// IncludeBare, when true, keeps components with zero customizations in
// the output. By default they are filtered out -- they have no
// per-component config worth reporting, and computing their git
// metrics across all selected components is the dominant cost on
// large projects (e.g., azurelinux).
IncludeBare bool
}
HistoryOptions holds options for the component history command.
type HistoryResult ¶ added in v0.2.0
type HistoryResult struct {
// Name of the component. We intentionally do *not* tag this with
// 'sortkey' -- the reflectable table writer would otherwise re-sort
// by name and stomp our customizations-first sort.
Name string `json:"name"`
// TomlCommits is the number of commits touching the component's source
// TOML file. When shared-mode = "omit" and the component shares its TOML
// with another component, the count is suppressed to zero (with
// SharedToml=true) -- unless the component was named explicitly, which
// always reports the real count.
TomlCommits int `json:"tomlCommits"`
// project (not just within the current selection) uses the same source
// TOML file. The TomlCommits count is then coarse because git history
// is on a per-file basis -- the count includes commits that touched the
// shared file for any reason, not just for this component.
SharedToml bool `json:"sharedToml,omitempty"`
// TomlPath is the repo-relative path of the component's source TOML file.
TomlPath string `json:"tomlPath,omitempty"`
// LatestCommit is the timestamp of the most recent commit to the TOML
// file. Zero if no commits found. Uses 'omitzero' (Go 1.24+) rather than
// 'omitempty' because the latter is a no-op for struct types and would
// serialize as "0001-01-01T00:00:00Z" for components with no history.
LatestCommit time.Time `json:"latestCommit,omitzero" table:"-"`
// Customizations is the count of customization items (len of the
// Customization slice).
Customizations int `json:"customizations"`
// CustomizationItems are the individual customization records;
// rendered as JSON detail and as inline expansion for single-component
// invocations.
CustomizationItems []CustomizationItem `json:"customizationItems,omitempty" table:"-"`
// FingerprintChanges is the number of commits where the lock file's
// input-fingerprint actually changed.
FingerprintChanges int `json:"fingerprintChanges"`
// FingerprintChangeDetails is the per-commit metadata for each
// fingerprint change counted in [FingerprintChanges] (oldest first).
// Hidden from the human-readable table -- use JSON output to consume
// them (e.g., to hand-author changelog entries).
//
// Each entry is populated from [sources.FingerprintChange] via an
// explicit field-by-field copy in [populateLockMetrics]. The
// gathering algorithm is shared with the synthetic dist-git history
// flow; the wire-level type is local so that:
// - the JSON contract for this command lives in this file, and
// - removing a field from [sources.FingerprintChange] /
// [sources.CommitMetadata] surfaces as a compile error at the
// copy site rather than silently dropping changelog metadata.
// The compile-error guard is one-directional (it catches REMOVED
// upstream fields); a NEWLY ADDED upstream field is caught instead by
// TestFingerprintChangeDTOMirrorsSource.
FingerprintChangeDetails []FingerprintChange `json:"fingerprintChangeDetails,omitempty" table:"-"`
// HasLock is true when a lock file currently exists for this component.
HasLock bool `json:"hasLock,omitempty" table:"-"`
// HasImport is true when the lock file records a non-empty
// import-commit (i.e., the component was forked from upstream).
HasImport bool `json:"hasImport,omitempty" table:"-"`
// ManualBump is the lock file's manual-bump counter. Always emitted
// (no omitempty) so a real bump of 0 isn't indistinguishable from an
// absent field; pair it with HasLock to tell "no lock" from "bump 0".
ManualBump int `json:"manualBump" table:"-"`
// Warnings collects per-component diagnostics for failure paths that
// were swallowed to keep the overall report rendering. Empty when no
// problems were encountered. Surfaces in the single-component card
// view and in JSON; hidden from the human-readable table.
Warnings []string `json:"warnings,omitempty" table:"-"`
}
HistoryResult is the per-component output row.
This is the stable wire contract that downstream tooling pins against: adding a field is non-breaking; renaming or removing one is a breaking change. Keep JSON tags stable.
func ComponentHistory ¶ added in v0.2.0
func ComponentHistory(env *azldev.Env, options *HistoryOptions) ([]HistoryResult, error)
ComponentHistory computes the per-component history data for the components matching options.ComponentFilter. Per-component work runs in parallel; a progress event tracks completion for the (often slow) -a case.
By default, components with zero customizations are skipped before any git work runs (set IncludeBare to keep them). This is the dominant performance lever on large projects -- the vast majority of components in real distros inherit everything from defaults and have no per-component history worth reporting.
When the user explicitly names component(s) (via positional args, --component, or --spec-path) the bare filter is force-disabled regardless of IncludeBare, so `azldev component history nano` always returns a row for nano even when nano has zero customizations. The perf rationale for the default does not apply to scope-limiting explicit selections.
type ListComponentOptions ¶
type ListComponentOptions struct {
// Standard filter for selecting components.
ComponentFilter components.ComponentFilter
}
Options for listing components within the environment.
type MetadataInfo ¶ added in v1.1.0
type MetadataInfo struct {
// Component is the name of the component the entry relates to. The output is
// pre-sorted by [sortMetadataInfos] (by component, then overlays before groups, then
// index/group name); no `sortkey` tag is set so the table writer preserves that order
// and stays consistent with JSON/CSV output.
Component string `json:"component"`
// Source identifies whether the entry describes an overlay or a component group.
Source MetadataSource `json:"source"`
// Index is the 1-based position of the overlay within the component's overlay list. It
// is 0 for group entries.
Index int `json:"index,omitempty" table:",omitempty"`
// Group is the name of the component group for group entries. Empty for overlay entries.
Group string `json:"group,omitempty" table:",omitempty"`
// Type is the overlay type (e.g. 'spec-set-tag', 'patch-add'). Empty for group entries.
Type projectconfig.ComponentOverlayType `json:"type,omitempty" table:",omitempty"`
// Description is the overlay's or group's top-level human-readable description.
Description string `json:"description,omitempty" table:",omitempty"`
// Category surfaces [projectconfig.OverlayMetadata.Category] for tabular output without
// forcing callers to drill into [MetadataInfo.Metadata]. Empty when the entry has no metadata.
Category projectconfig.OverlayCategory `json:"category,omitempty" table:",omitempty"`
// UpstreamStatus surfaces [projectconfig.OverlayMetadata.UpstreamStatus] for tabular
// output without forcing callers to drill into [MetadataInfo.Metadata]. Empty when
// the entry has no metadata.
UpstreamStatus projectconfig.OverlayUpstreamStatus `json:"upstreamStatus,omitempty" table:",omitempty"`
// Metadata is the full metadata for the entry. Nil when it has none.
Metadata *projectconfig.OverlayMetadata `json:"metadata,omitempty" table:"-"`
}
MetadataInfo is the per-entry output for the 'component metadata' subcommand. Each entry describes either one of a component's overlays or a component group it belongs to.
func ListMetadata ¶ added in v1.1.0
func ListMetadata(env *azldev.Env, options *MetadataOptions) ([]MetadataInfo, error)
ListMetadata returns the documentation-metadata entries across the selected components. Only entries carrying metadata are returned; entries with no metadata are excluded. Overlay entries and/or component-group entries are included according to the source selectors in options (both by default). Lock validation is always skipped - this command is read-only.
type MetadataOptions ¶ added in v1.1.0
type MetadataOptions struct {
// ComponentFilter selects which components to inspect.
ComponentFilter components.ComponentFilter
// Overlays selects overlay metadata for output. When both Overlays and Groups are
// false, both sources are listed.
Overlays bool
// Groups selects component-group metadata for output. When both Overlays and Groups
// are false, both sources are listed.
Groups bool
// Category, when non-empty, filters output to entries whose metadata declares this
// category.
Category string
// UpstreamStatus, when non-empty, filters output to entries whose metadata declares
// this upstream status (one of the [projectconfig.OverlayUpstreamStatus] values).
UpstreamStatus string
}
MetadataOptions configures the 'component metadata' subcommand.
type MetadataSource ¶ added in v1.1.0
type MetadataSource string
MetadataSource identifies where a listed documentation-metadata entry originates.
const ( // MetadataSourceOverlay marks an entry describing one of a component's overlays // (declared inline in the component config or inherited from an overlay-files entry). MetadataSourceOverlay MetadataSource = "overlay" // MetadataSourceGroup marks an entry describing a component group that the component is // an explicit member of. MetadataSourceGroup MetadataSource = "group" )
type PrepareSourcesOptions ¶
type PrepareSourcesOptions struct {
ComponentFilter components.ComponentFilter
OutputDir string
SkipOverlays bool
WithoutGitRepo bool
RPMDevBumpspec bool
Force bool
AllowNoHashes bool
SkipSources bool
// contains filtered or unexported fields
}
type QueryComponentsOptions ¶
type QueryComponentsOptions struct {
// Standard filter for selecting components.
ComponentFilter components.ComponentFilter
// Target architecture passed to rpmspec via --target. Defaults to
// x86_64. Drives ExclusiveArch/ExcludeArch evaluation; specs that
// exclude the target are emitted with only SpecInfo.Name populated
// (no Version/Subpackages) rather than as errors.
Arch qemu.Arch
}
Options for querying components from the environment.
type RPMResult ¶ added in v0.2.0
type RPMResult struct {
// Path is the absolute path to the RPM file in the build output directory.
Path string `json:"path" table:"Path"`
// PackageName is the binary package name extracted from the RPM header tag (e.g., "libcurl-devel").
PackageName string `json:"packageName" table:"Package"`
// Channel is the resolved publish channel from project config.
// Empty when no channel is configured for this package.
Channel string `json:"publishChannel" table:"Publish Channel"`
}
RPMResult encapsulates a single binary RPM produced by a component build, together with the resolved publish channel for that package.
type RefreshUpstreamCommitOptions ¶ added in v1.0.0
type RefreshUpstreamCommitOptions struct {
ComponentFilter components.ComponentFilter
// UpstreamCommitsDir is the project-relative or absolute directory containing
// generated per-component TOML files.
UpstreamCommitsDir string
// CheckOnly resolves upstream commits but does not write TOML files or
// prune orphans.
CheckOnly bool
}
RefreshUpstreamCommitOptions holds options for the component refresh-upstream-commit command.
type RefreshUpstreamCommitResult ¶ added in v1.0.0
type RefreshUpstreamCommitResult struct {
Component string `json:"component" table:",sortkey"`
UpstreamCommit string `json:"upstreamCommit,omitempty"`
PreviousCommit string `json:"previousCommit,omitempty" table:"-"`
Changed bool `json:"changed"`
Removed bool `json:"removed,omitempty" table:",omitempty"`
Skipped bool `json:"skipped,omitempty"`
SkipReason string `json:"skipReason,omitempty" table:",omitempty"`
Error string `json:"error,omitempty" table:",omitempty"`
}
RefreshUpstreamCommitResult is the per-component output for the refresh command.
func RefreshUpstreamCommits ¶ added in v1.0.0
func RefreshUpstreamCommits( env *azldev.Env, options *RefreshUpstreamCommitOptions, ) ([]RefreshUpstreamCommitResult, error)
RefreshUpstreamCommits resolves upstream commits for all selected components and writes the results to per-component TOML files.
type RenderOptions ¶ added in v0.2.0
type RenderOptions struct {
ComponentFilter components.ComponentFilter
OutputDir string
OutputDirExplicit bool // True when --output-dir was explicitly passed on the CLI.
FailOnError bool
Force bool
CleanStale bool
CheckOnly bool
RPMDevBumpspec bool
// contains filtered or unexported fields
}
RenderOptions holds the options for the render command.
type RenderResult ¶ added in v0.2.0
type RenderResult struct {
Component string `json:"component" table:"Component"`
OutputDir string `json:"outputDir" table:"Output"`
Status string `json:"status" table:"Status"`
Error string `json:"error,omitempty" table:"Error,omitempty"`
Changed bool `json:"changed" table:"Changed"`
}
RenderResult holds the result of rendering a single component.
func RenderComponents ¶ added in v0.2.0
func RenderComponents(env *azldev.Env, options *RenderOptions) ([]*RenderResult, error)
RenderComponents renders the post-overlay spec and sidecar files for each selected component into the output directory. Processing is done in three phases:
- Parallel source preparation (clone, overlay, synthetic git)
- Batch mock processing (rpmautospec + spectool in a single chroot call)
- Parallel finishing (filter files, remove .git, copy output)
type UpdateComponentOptions ¶ added in v0.2.0
type UpdateComponentOptions struct {
ComponentFilter components.ComponentFilter
// Bump increments the manual-rebuild counter on matched components'
// lock files. Used for mass-rebuild scenarios.
Bump bool
// CheckOnly runs the full update pipeline (resolve identities,
// recompute fingerprints) but does not write lock files or prune
// orphans. Returns a non-nil error when any component would be
// changed or any lock file would be pruned. Intended for CI gates:
// `azldev component update -a --check-only` exits 0 when locks are
// fresh and 1 when something is stale.
CheckOnly bool
// ForceRecalculate disables freshness optimizations that skip
// re-resolution for unchanged components. When set, all components
// are re-resolved regardless of their freshness status.
ForceRecalculate bool
}
UpdateComponentOptions holds options for the component update command.
type UpdateResult ¶ added in v0.2.0
type UpdateResult struct {
Component string `json:"component" table:",sortkey"`
UpstreamCommit string `json:"upstreamCommit,omitempty"`
PreviousCommit string `json:"previousCommit,omitempty" table:"-"`
// Changed is set by checkLockChanged (commit diff) or saveComponentLocks (fingerprint diff).
Changed bool `json:"changed"`
Skipped bool `json:"skipped,omitempty"`
SkipReason string `json:"skipReason,omitempty" table:",omitempty"`
Error string `json:"error,omitempty" table:",omitempty"`
// contains filtered or unexported fields
}
UpdateResult is the per-component output for the update command.
func UpdateComponents ¶ added in v0.2.0
func UpdateComponents(env *azldev.Env, options *UpdateComponentOptions) ([]UpdateResult, error)
UpdateComponents resolves source identities for all selected components and writes the results to per-component lock files under locks/. Lock validation is always skipped regardless of the caller's SkipLockValidation value — update is the lock writer.
Source Files
¶
- add.go
- build.go
- buildenvpreservepolicy.go
- changed.go
- changed_upstreamcommit.go
- cmdoptions.go
- component.go
- diffsources.go
- history.go
- history_customizations.go
- history_gitmetrics.go
- history_render.go
- legacy.go
- list.go
- metadata.go
- mockproc.go
- mockprocessor.go
- orphans.go
- preparerctx.go
- preparesources.go
- query.go
- refreshupstreamcommit.go
- render.go
- sourcepreparer.go
- speceditor.go
- test.go
- update.go