Verify record inheritance through pipeline resolution
This commit is contained in:
@@ -186,6 +186,14 @@ step requirement. Validator chains are not automatically identified. Authors
|
||||
may declare identities for other lists when needed. CLI list assignment replaces
|
||||
the complete decoded list.
|
||||
|
||||
Record inheritance does not create template-only steps: every record in the
|
||||
final step list executes and must have artifact lanes. A child that inherits
|
||||
its parent's named lanes also conflicts with the requirement that lane IDs be
|
||||
unique across steps; adding differently named lanes does not remove inherited
|
||||
ones. Use pipeline-level inheritance with step upsert for pipeline variants.
|
||||
Native identified-record inheritance is also available in compatible collections,
|
||||
such as an author-identified validator list, subject to ordinary domain validation.
|
||||
|
||||
For example, an overlay can opt into replacing a pipeline's steps:
|
||||
|
||||
~~~yaml
|
||||
|
||||
@@ -360,7 +360,12 @@ was identified. One additional test/documentation integration gap remains.
|
||||
|
||||
### Finding CK-3 — Verify Identified-Record Inheritance At The Runtime Boundary
|
||||
|
||||
Priority: P3. Category: integration coverage and support-scope clarity. Status: open.
|
||||
Priority: P3. Category: integration coverage and support-scope clarity. Status: complete.
|
||||
|
||||
Completed 2026-11-18: reframed the reference-only step fixture as a negative
|
||||
resolution case and added compatible validator-record inheritance that reaches
|
||||
Config.Resolve and verifies inherited options. Documented step/lane constraints
|
||||
without relaxing them. Core configuration and CLI/example suites pass.
|
||||
Affected stages: 4, 9, and 11.
|
||||
|
||||
`TestIdentifiedStepRecordInheritance` in
|
||||
|
||||
@@ -3,6 +3,7 @@ package config
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
configkit "go.maximumdirect.net/configkit"
|
||||
@@ -179,7 +180,7 @@ pipelines:
|
||||
}
|
||||
}
|
||||
|
||||
func TestIdentifiedStepRecordInheritance(t *testing.T) {
|
||||
func TestIdentifiedStepInheritanceDoesNotCreateTemplateSteps(t *testing.T) {
|
||||
main := filepath.Join(t.TempDir(), "main.yml")
|
||||
if err := os.WriteFile(main, []byte(`version: 5
|
||||
pipelines:
|
||||
@@ -205,6 +206,52 @@ pipelines:
|
||||
if err := loaded.Config.Validate(); err != nil {
|
||||
t.Fatalf("validate inherited steps: %v", err)
|
||||
}
|
||||
if _, err := loaded.Config.Resolve(ResolveInput{PipelineID: "session", Catalog: effectiveCatalog(t)}); err == nil || !strings.Contains(err.Error(), `step "parent" must declare at least one artifact lane`) {
|
||||
t.Fatalf("expected non-executable parent rejection, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIdentifiedValidatorRecordInheritanceResolves(t *testing.T) {
|
||||
main := filepath.Join(t.TempDir(), "main.yml")
|
||||
if err := os.WriteFile(main, []byte(`version: 5
|
||||
config:
|
||||
sequences:
|
||||
- destination: [pipelines, session, artifacts, result, extract, validators]
|
||||
key: module
|
||||
pipelines:
|
||||
session:
|
||||
input: {module: input}
|
||||
artifacts:
|
||||
result:
|
||||
extract:
|
||||
module: extract
|
||||
validators:
|
||||
- module: configured-a
|
||||
options: {nested: {inherited: true}}
|
||||
- module: configured-b
|
||||
extends: {module: configured-a}
|
||||
`), 0600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
loaded, err := Load(main, LoadOptions{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
effective, err := loaded.Config.Resolve(ResolveInput{PipelineID: "session", Catalog: effectiveCatalog(t)})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, chain := range effective.ResolvedPipeline.ValidatorChains {
|
||||
for _, validator := range chain.Validators {
|
||||
if validator.Binding.Module == "configured-b" {
|
||||
if nested, ok := validator.Binding.Options["nested"].(map[string]any); !ok || nested["inherited"] != true {
|
||||
t.Fatalf("inherited options = %#v", validator.Binding.Options)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
t.Fatal("inheriting validator missing from resolved pipeline")
|
||||
}
|
||||
|
||||
func TestEmptyStepOperationsAndOptionalImports(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user