Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadOutput ¶
func ReadOutput[T executiondag.Persistable](ctx context.Context, input Input) (T, error)
func ValidateFetchFlags ¶
ValidateFetchFlags rejects combinations of --no-fetch and --write-fetch-only that don't make sense together.
Types ¶
type BaseOutput ¶
type BaseOutput struct {
executiondag.BaseOutput `json:",inline"`
Input Input `json:"-"`
Output *Input `json:"output,omitempty"`
}
BaseOutput provides common fields and methods for all dag-impl outputs. It embeds executiondag.BaseOutput for status management and implements MergeableOutput for Input.Merge() operations.
All dag-impl outputs should embed this type.
func NewBaseOutput ¶
func NewBaseOutput(status executiondag.Status, statusReason string, input Input) BaseOutput
func (*BaseOutput) GetInput ¶
func (b *BaseOutput) GetInput() *Input
func (*BaseOutput) GetOutput ¶
func (b *BaseOutput) GetOutput() *Input
type Input ¶
type Input struct {
AnalysisIdentifier string `json:"analysis_identifier"`
SourceURL *string `json:"source_url,omitempty"`
Commit *string `json:"commit,omitempty"`
Version *string `json:"version,omitempty"`
Packages []models.PackageInfo `json:"packages,omitempty"`
Trusted bool `json:"trusted,omitempty"`
OverridesHash string `json:"overrides_hash,omitempty"`
// Per-run runtime flags. Kept out of JSON so they don't pollute the
// analysis identity / cache key.
NoFetch bool `json:"-"`
WriteFetchOnly bool `json:"-"`
}
func NewSourceInputWithCommit ¶
NewSourceInputWithCommit creates a source input with optional commit and trust flag. The trusted flag affects AnalysisIdentifier (cache key) because trusted analyses apply .riskguardignore patterns which delete files, producing different results.
func (*Input) BasePath ¶
BasePath returns a filesystem-safe path derived from AnalysisIdentifier. The query-string portion (?version=..., &overrides=..., &trusted=...) is preserved as part of the path so distinct work items get distinct dirs; otherwise concurrent audits of the same package at different versions race on a single destDir and corrupt each other's clones.
func (Input) GetNoFetch ¶
GetNoFetch satisfies executiondag.NoFetchProvider so the generic executor can honor --no-fetch without depending on this package.
func (*Input) HasSourceKey ¶
func (*Input) HasSourceURL ¶
func (*Input) Merge ¶
func (i *Input) Merge(output executiondag.StatusProvider)
Merge implements the Mergeable interface. This merges node outputs back into the input for downstream nodes. Only merges if the node set an Output field (indicating it wants to modify input for downstream). - AnalysisIdentifier: Immutable, never merged - SourceURL: Can be set from nil/empty, but cannot be changed once set to a non-empty value - Packages: Accumulated from all nodes
func (*Input) MustHaveSourceURL ¶
MustHaveSourceURL returns the SourceURL or panics if it's nil/empty. This should only be called from nodes that have a hard dependency on nodes that provide SourceURL (like git_clone). If this panics, it indicates a bug in the DAG framework's dependency resolution.
type MergeableOutput ¶
MergeableOutput is an interface that dag-impl outputs can implement to provide data that should be merged back into the Input.