tirith
tirith copied to clipboard
🚀 Update SG workflow provider
The current SG workflow provider is outdated and doesn't support all the attributes of a workflow. Although it is an abstracted form of JSON provider. It gives user to define the attributes in a high-level way.
Needs ideas to update the SG workflow provider.
Just discussed a little with @AkashS0510 . One idea would be to change the SGWorkflow provider from getting the attributes imperatively, to getting the attributes declaratively using JMESPath definition.
In summary, we'll be having a map to translate the current SGWorkflow Policy to a JSON Policy. The key will be the attribute, the value will be the equivalent JMESPath operation
Discussion note with @AkashS0510:
- We should evaluate this more: "Creating a mapping from SGWorkflowProvider to JSONProvider using JMESPath" because we think that the advantage is only about refactoring our Python code to JMESPath syntax (imperative->declarative) which is nice, but if there's no more advantage on top of that, I'd not do this
- We think that JMESPath is nice to have when the user want to use advanced JSON processing things because we can't expose the user to write Python code (very unsafe)
- JMESPath usages are very useful in JSONProvider (see point 2)