Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SeverityStrings ¶
func SeverityStrings() []string
SeverityStrings returns a slice of all String values of the enum
func ShouldBlockDiff ¶
func ShouldBlockDiff(after *pipelinespec.Pipeline, result *CheckResult) bool
ShouldBlockDiff decides whether a semantic diff should fail preflight/CI. Breaking semantic changes block because the current pipeline contract would no longer hold.
func StepDiffKindStrings ¶
func StepDiffKindStrings() []string
StepDiffKindStrings returns a slice of all String values of the enum
Types ¶
type CheckResult ¶
type CheckResult struct {
Severity Severity `json:"severity"`
Findings []Finding `json:"findings"`
}
CheckResult is the overall outcome of a semantic check against a DiffResult.
func Check ¶
func Check(d *DiffResult) *CheckResult
Check evaluates the semantic impact of a DiffResult and returns a structured result. It classifies each change by severity so callers can decide whether to block (e.g. in CI).
func (*CheckResult) Format ¶
func (r *CheckResult) Format() string
Format returns a human-readable text summary suitable for CI logs or PR comments.
type DiffResult ¶
type DiffResult struct {
HasChanges bool
Metadata []FieldChange
Steps []StepDiff
}
DiffResult is the structured output of a semantic pipeline comparison.
func Diff ¶
func Diff(before, after *pipelinespec.Pipeline) *DiffResult
Diff computes the semantic difference between two pipeline specs. Both before and after must be non-nil. Steps are matched by slug.
type FieldChange ¶
FieldChange is a single field that changed between two pipeline versions.
type Severity ¶
type Severity int
Severity represents the impact level of a pipeline change.
const ( // SeveritySafe means the change is additive or cosmetic with no behavioral risk. SeveritySafe Severity = iota // safe // SeverityWarning means the change alters behavior and warrants careful review. SeverityWarning // warning // SeverityBreaking means the change removes or incompatibly alters the pipeline contract. SeverityBreaking // breaking )
func SeverityString ¶
SeverityString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func SeverityValues ¶
func SeverityValues() []Severity
SeverityValues returns all values of the enum
func (Severity) IsASeverity ¶
IsASeverity returns "true" if the value is listed in the enum definition. "false" otherwise
func (Severity) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for Severity
func (*Severity) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for Severity
type StepDiff ¶
type StepDiff struct {
Slug string
Kind StepDiffKind
Fields []FieldChange // populated for Modified steps only
}
StepDiff describes what changed for a given step.
type StepDiffKind ¶
type StepDiffKind int
StepDiffKind describes the type of change for a step.
const ( StepAdded StepDiffKind = iota // added StepRemoved // removed StepModified // modified )
func StepDiffKindString ¶
func StepDiffKindString(s string) (StepDiffKind, error)
StepDiffKindString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func StepDiffKindValues ¶
func StepDiffKindValues() []StepDiffKind
StepDiffKindValues returns all values of the enum
func (StepDiffKind) IsAStepDiffKind ¶
func (i StepDiffKind) IsAStepDiffKind() bool
IsAStepDiffKind returns "true" if the value is listed in the enum definition. "false" otherwise
func (StepDiffKind) MarshalJSON ¶
func (i StepDiffKind) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for StepDiffKind
func (StepDiffKind) String ¶
func (i StepDiffKind) String() string
func (*StepDiffKind) UnmarshalJSON ¶
func (i *StepDiffKind) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for StepDiffKind