unicesi / amelia

:airplane: DSL for deploying distributed systems, with custom commands to compile and execute FraSCAti applications
GNU Lesser General Public License v3.0
2 stars 3 forks source link

Avoiding inconsistent deployments by user omission #14

Closed juan3036 closed 8 years ago

juan3036 commented 8 years ago

Hi.

The lastest features are really useful, however the "maintainability" of the code could be hard to trace. The new version of the library forces to add to the graphDescriptor all commandDescriptors used in a class. Sometimes the classes to execute a deployment may require many CommandDescriptors that are difficult to trace at the time to add these to the graph. So, if you could make a validation of the commandDescriptors created and used in methods like runsOn or dependsOn and compare these against the added to the graph you can show a warming or error message that is one or more commandDescriptors "unused" or missing.

Please let me know if you need more clarification with respect to this issue.

Thanks :+1:

jachinte commented 8 years ago

Hi @juan3036!

Yes, it sounds very useful for large projects. Now, adding all descriptors to the graph is not a new thing, the same had to be done with previous versions of the library; although it seems like an additional thing, given that you must specify hosts using a different method.

This kind of validation can only be performed to verify if you are not forgetting to add some descriptor to the graph, when it has been specified as a dependency. Unfortunately this cannot be done with hosts, because there is no way to infer your intention of deployment in certain host.

jachinte commented 8 years ago

Hi again @juan3036, This is now a reality! each time you call execute on a graph, either SubsystemGraph or DescriptorGraph, it is going to first execute a validation to avoid the problem you describe (with the limitations I mentioned).