st2flow
st2flow copied to clipboard
Refactor workflow build
In #224 I expressed my dissatisfaction with that fix/implementation. This dissatisfaction is on two levels. One, to my knowledge there is no current storage of the workflow graph anywhere in state. Two this type of fix would need to be implemented across all models which isn't very DRY.
We currently build/rebuild the workflow YAML based on the stored object representation. If this were stored as a graph or some other similarly optimal structure it would allow us to abstract the various parts of building out the YAML and visuals into a single render function for each workflow model we support. I propose a refactor that allows us to build a single graph representation on the canvas/UI and then each model gets a render function that understands the graph and the workflow semantics to render the proper YAML for the given workflow model.
If this were the case there would be no need to iterate over the in-memory YAML object to rename tasks. Rather the new graph would be fed into the render function and return new YAML based on the updated graph. This would isolate bugs to their respective model render function.
This makes sense and can potentially minimize cascading changes to the st2flow core on DSL changes. I agree with your assessment on Slack that this is post v3.0.