Documentation
¶
Overview ¶
Package drift compares cidx.toml declarations with actual CI platform configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MajorOf ¶ added in v3.4.4
MajorOf reads the major version of an action ref: "v6", "v6.1" and "v6.1.0" all answer 6. Anything else — a SHA, a branch — is not a version.
func Summary ¶
Summary is the verdict `cidx check drift` closes with: the reassurance when the workflow matches the config, or the count that becomes the command's error otherwise. The error branch carries no colour of its own — the CLI renders errors — which is why only the clean verdict is styled here.
Types ¶
type ActionDiff ¶ added in v3.4.4
type ActionDiff struct {
Action string // "actions/checkout"
InCI string // the ref the workflow uses, "v6"
Generated string // the version `cidx generate` writes today, "v7"
}
ActionDiff is a generated action the workflow runs behind what cidx writes.
type PhaseDiff ¶
type PhaseDiff struct {
Name string
CIDX bool // present in cidx.toml
CI bool // present in CI workflow
Status Status
}
PhaseDiff represents a phase comparison result.
type Result ¶
type Result struct {
Workflow string // workflow file the config was compared against
Pipeline string // pipeline the workflow implements ("" = every pipeline)
Phases []PhaseDiff
Triggers []TriggerDiff
// Actions lists the generated actions the workflow runs at a major behind
// the one this cidx generates (#424). Only those: an action at the
// current major, pinned by SHA, or never generated is not drift.
Actions []ActionDiff
}
Result holds the complete drift analysis.
func CompareFromData ¶
CompareFromData analyzes drift using raw YAML data. workflowPath is not read; it names the workflow so the comparison can be scoped to the pipeline that workflow implements (see pipelineFor).