Closed tonyandrewmeyer closed 7 months ago
@tonyandrewmeyer b.t.w this is a real coincidence that you are cleaning this up a bit, because I am on a kind of similar mission for slightly different reasons, and I've done in my PoC exactly what you conceptionally doing here. I've also split it up between Layer and Plan validation, but you went a bit further, actually cleaning up what is inside each category, which is super nice and brave :) Looking forward getting this merged.
This PR moves layer/plan validation into dedicated functions, with
Layer.Validate
covering validation that is specific to a layer (such as an invalid value) andPlan.Validate
covering validation that covers the plan as a whole (such as cycles or missing values).Plan validation includes layer validation, and is done in the service manager's
updatePlanLayers
and inplan.CombineLayers
.We also use the check period as the upper bound for the timeout in checks, which was happening before, but less explicitly.
No additional validation is done - all of the validation code is moved rather than changed.
Fixes #349