Let the merge preview and the provided manifest decode instead of judging (ADR 0578 §3)
Issue 1585, S12 (mesh-sdk half): buildstep's named paths and delivery.ProvidedManifest read with catalogue.Decode. Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
This commit is contained in:
@@ -75,11 +75,12 @@ func ModuleTrees(ctx context.Context, run forgekey.Runner, env []string, dir, co
|
||||
}
|
||||
|
||||
// narrow sets mt's Paths and its named Tree when the module's manifest names paths on every artifact (novox/hq ADR 0499
|
||||
// clause 2): one `git ls-tree -z` gives each named path's object at commit. The merge preview reads the manifest here, as
|
||||
// the indexer does, with catalogue.ParseManifestForInputs (issue 1751), and no other build step reads paths from one (ADR 0495 clause 1). A manifest that does not parse
|
||||
// is not narrowed: the indexer gives it none. A named path absent at commit fails, naming the module and the path.
|
||||
// clause 2): one `git ls-tree -z` gives each named path's object at commit. The merge preview decodes the manifest here
|
||||
// (catalogue.Decode: a build step judges no manifest, novox/hq ADR 0578 §3), and no other build step reads paths from one
|
||||
// (ADR 0495 clause 1). A manifest that does not decode is not narrowed: the indexer gives it none. A named path absent at
|
||||
// commit fails, naming the module and the path.
|
||||
func narrow(ctx context.Context, run forgekey.Runner, env []string, dir, commit, mdir string, raw []byte, mt *ModuleTree) error {
|
||||
m, err := catalogue.ParseManifestForInputs(raw)
|
||||
m, err := catalogue.Decode(raw)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -29,9 +29,10 @@ func ProvidedManifest(module string) (catalogue.Manifest, []byte, error) {
|
||||
if err != nil {
|
||||
return catalogue.Manifest{}, nil, err
|
||||
}
|
||||
m, err := catalogue.ParseManifestForInputs(raw)
|
||||
// Decoded as every reader decodes a manifest (novox/hq ADR 0578 §3); its judgement is the indexer's.
|
||||
m, err := catalogue.Decode(raw)
|
||||
if err != nil {
|
||||
return catalogue.Manifest{}, raw, fmt.Errorf("delivery: the manifest mesh-sdk provides for %s is refused by its own reader: %w", module, err)
|
||||
return catalogue.Manifest{}, raw, fmt.Errorf("delivery: the manifest mesh-sdk provides for %s does not decode: %w", module, err)
|
||||
}
|
||||
return m, raw, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user