drift

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 6 Imported by: 0

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 Format

func Format(result *Result) string

Format renders the drift result as a human-readable table.

Types

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 {
	Phases   []PhaseDiff
	Triggers []TriggerDiff
}

Result holds the complete drift analysis.

func Compare

func Compare(cfg *config.Config, workflowPath string) (*Result, error)

Compare analyzes drift between cidx.toml config and a GitHub Actions workflow file.

func CompareFromData

func CompareFromData(cfg *config.Config, workflowData []byte) (*Result, error)

CompareFromData analyzes drift using raw YAML data (for testing).

func (*Result) DiffCount

func (r *Result) DiffCount() int

DiffCount returns the number of differences found.

func (*Result) HasDrift

func (r *Result) HasDrift() bool

HasDrift returns true if any differences were found.

type Status

type Status string

Status represents the drift status of an item.

const (
	StatusMatch   Status = "match"
	StatusMissing Status = "missing from CI"
	StatusExtra   Status = "extra in CI"
)

type TriggerDiff

type TriggerDiff struct {
	Event  string
	CIDX   bool // expected from cidx.toml pipeline names
	CI     bool // present in CI workflow
	Status Status
}

TriggerDiff represents a trigger comparison result.

Jump to

Keyboard shortcuts

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