[Feature]: Using model-validators to perform validations across products
Since it's now possible to reuse products in other products, modification of those products becomes less straightforward.
When a resource type from a product block from one product has a relation to a resource type from a product block of a different product, then this relation will only be checked when subscriptions for the first product are created or modified. When the resource type is modified on a subscription of the other product then this relation will not be checked because the subscription for the first product is unaware of this change. This can be covered by checking this relation in a validation workflow for the first product, but then the inconsistency only will be visible after that validation workflow has run.
Solution direction:
During modify of a product, we need to verify if other products that depend on this product stay in a consistent (valid) state. This can be done for example by notifying all those products and let them report back details on how their state would become inconstant. That information can be presented in the modify workflow that triggered this.
Issue/remarks
- This could become quite slow when there are larger numbers of depending workflows
- We could limit the information that is send to validate to the data that is actually changed. For example in the modify firewall workflow, we only send the updated asn
- If the change is valid, should we silently propagate the changes so it will be stored in coredb? Again in the example of an updated asn, should we also change (and trigger) the l3vpn process?
- Etc.
This should be implemented by using model-validators on the domain model. Perhaps this is a good documentation issue.