tirith icon indicating copy to clipboard operation
tirith copied to clipboard

🚀 Update SG workflow provider

Open AkashS0510 opened this issue 10 months ago • 2 comments

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.

AkashS0510 avatar Jan 09 '25 13:01 AkashS0510

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

refeed avatar Jan 10 '25 09:01 refeed

Discussion note with @AkashS0510:

  1. 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
  2. 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)
  3. JMESPath usages are very useful in JSONProvider (see point 2)

refeed avatar Jan 21 '25 13:01 refeed