Resolution: a requirement nothing in the mesh answers holds its consumers too; optional ones stay absent (A-452)
The mesh-wide refusal ("nothing in this mesh provides") holds its consumers as the
node-wide one does; a module that wants the name only optionally is left absent
(ADR 0330 §3), never held. A held why still names the nodes that offer nothing
here. The two tests of the first commit are folded as rows into one table test
that replaces two existing ones.
Builds: design 47 G A-452
This commit is contained in:
@@ -291,22 +291,31 @@ func (c *composer) resolutionHolding(nodeName string) (catalogue.Resolution, map
|
||||
At: onNetwork[nodeName], PublicDomain: node.PublicDomain,
|
||||
Account: node.Account, AccountHome: node.AccountHome,
|
||||
AgentAccount: node.AgentAccount, AgentAccountHome: node.AgentAccountHome}, world)
|
||||
if err != nil {
|
||||
// What another node's set would have offered is missing when that set does not resolve here: said with the
|
||||
// refusal, so "nothing provides" is read beside why (issue 1126, probe #532).
|
||||
// What another node's set would have offered is missing when that set does not resolve here: said with the refusal, and with
|
||||
// each module held for a requirement nothing answers, so "nothing provides" is read beside why (issue 1126, probe #532).
|
||||
why := func() string {
|
||||
var out string
|
||||
if len(left) > 0 {
|
||||
var why []string
|
||||
var parts []string
|
||||
for _, l := range left {
|
||||
why = append(why, l.String())
|
||||
parts = append(parts, l.String())
|
||||
}
|
||||
err = fmt.Errorf("%w\n\nand %d node(s) offer nothing here, as they could not be resolved: %s", err, len(left), strings.Join(why, "; "))
|
||||
out += fmt.Sprintf("\n\nand %d node(s) offer nothing here, as they could not be resolved: %s", len(left), strings.Join(parts, "; "))
|
||||
}
|
||||
if len(c.unhostable) > 0 {
|
||||
err = fmt.Errorf("%w\n\nand these modules offer nothing here, as their node cannot run them in this composition: %s",
|
||||
err, strings.Join(c.unhostable, "; "))
|
||||
out += fmt.Sprintf("\n\nand these modules offer nothing here, as their node cannot run them in this composition: %s",
|
||||
strings.Join(c.unhostable, "; "))
|
||||
}
|
||||
return out
|
||||
}
|
||||
if err != nil {
|
||||
// The node's own set does not compose: the only failure a mesh-wide gatherer may pass over.
|
||||
return catalogue.Resolution{}, nil, notResolvable{err}
|
||||
return catalogue.Resolution{}, nil, notResolvable{fmt.Errorf("%w%s", err, why())}
|
||||
}
|
||||
for m, w := range held {
|
||||
if strings.Contains(w, "nothing provides") || strings.Contains(w, "nothing in this mesh provides") {
|
||||
held[m] = w + why()
|
||||
}
|
||||
}
|
||||
return resolved, held, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user