Simplify schema/v1 to YAML-only unmarshaling with consolidated validation

Previously, the schema package used a two-phase approach: the top-level Step was decoded with a YAML unmarshaler, which then re-encoded child values to JSON and decoded them again to invoke UnmarshalJSON on types like Reference, GitReference, OCIReference, and OutputType. This made YAML the entry point but JSON the internal wire format.

Since YAML is a superset of JSON and ReadSteps is the only entry point, the JSON roundtrip and all UnmarshalJSON implementations are replaced with a direct YAML marshal/unmarshal. Struct tags are simplified to yaml-only, and the json/mapstructure tags and imports are dropped.

Validation that was scattered across UnmarshalJSON and UnmarshalYAML methods is consolidated into Step.validate() and Spec.validate(), called from ReadSteps after decoding. This separates the concerns of decoding and validation, and adds identifier pattern validation (matching the JSON schema) for step names, env keys, and input/output names. The valueCompiler struct is also simplified to a plain compileValue function.

Tests are updated to match: git_reference_test.go and oci_reference_test.go are folded into reference_test.go alongside a consolidated TestReferenceValidation table; the check helper drops its generic marshal/unmarshal parameters in favour of YAML directly; and a duplicate test case in step_json_test.go is removed.

Edited by Arran Walker

Merge request reports

Loading