verify

package
v0.11.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package verify implements the read-only "cascade verify" command. It compares the workflow and action files committed to a repository against what the manifest would currently generate, reporting any drift. verify never writes to the filesystem, invokes git, or creates scratch state: the comparison is done entirely in memory.

Index

Constants

This section is empty.

Variables

View Source
var ErrDrift = &exitError{code: exitDrift, err: errors.New("workflow drift detected")}

ErrDrift is returned (wrapped) by Run when the committed files diverge from what the manifest would generate (a file is missing or its bytes differ). Callers distinguish drift from operational failures (a missing or invalid manifest) with errors.Is(err, ErrDrift). It carries exit code 1.

Functions

func NewCommand

func NewCommand() *cobra.Command

NewCommand creates the verify command, a read-only drift check that compares committed workflow and action files against what the manifest would generate.

func Run

func Run(o Options, stdout, stderr io.Writer) error

Run compares every file the manifest would generate against the bytes committed on disk. It returns:

  • nil when every planned file is present and byte-identical, mapping to exit code 0 (no drift),
  • ErrDrift when any planned file is missing or differs, mapping to exit code 1 (drift detected), or
  • an operational error when the manifest cannot be read or validated, mapping to exit code 2 (the check could not run).

The returned error carries its exit code through an ExitCode() int method that cmd/cascade/main.go reads to set the process status.

Run is read-only: it reads the manifest, the reusable-workflow stubs the generators inspect, and the committed files, and writes nothing.

Types

type Options

type Options struct {
	ConfigPath        string
	ManifestKey       string
	ActionFolder      string
	OutputPath        string
	PromoteOutputPath string
	Quiet             bool
	// AllowOrphans disables orphan detection. When false (the default), verify
	// reports cascade-owned workflow files that the manifest no longer plans as
	// drift; when true, those files are ignored and never affect the exit code.
	AllowOrphans bool
	// OwnRepo plans cascade's own-repo release-plumbing variant of the
	// orchestrate workflow and the manage-release composite action, matching
	// generate-workflow --own-repo. Cascade's own manifest is generated in that
	// mode, so its committed orchestrate.yaml and action.yaml are drift-locked to
	// the own-repo output; without this, verify would compute the plain variant
	// and report the deliberate own-repo differences as spurious drift.
	OwnRepo bool
}

Options configures a verify run. The fields mirror the generate-workflow flags that determine which files the manifest emits and where they live.

Jump to

Keyboard shortcuts

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