cartographer icon indicating copy to clipboard operation
cartographer copied to clipboard

Better error when forward refs exist, OR, don't require ordered resources (In biueprints)

Open squeedee opened this issue 3 years ago • 0 comments

Description of problem

Today, a blueprint with a resource that contains a forward source/image/config/deployment resource reference will fail with

failed to interpolate map value: ....... evaluate: failed to find results: <image|url|config|etc...> not found

this occurs because the template context for the output is never fulfilled.

Proposed solution

Proposed Solution 1, Error:

Given I make a forward ref in my supply chain
When I submit the supply chain
Then My supply chain is rejected
And I see a message describing the forward reference in detail

Proposed Solution 2, support forward refs:

Given I make a forward ref in my supply chain
When I submit the supply chain
Then my supply chain is accepted and just works

In this scenario we:

  1. validate that the supply chain has no circular refs in the graph (orphans and disconnected graphs are fine) (returning an error if we do have a circular graph)
  2. use a stack method to process all the resources until the stack is exhausted (no longer emitting new outputs or empty)

squeedee avatar May 17 '22 14:05 squeedee