mxlint / mxlint-cli

A set of CLI tools to enhance Mendix app development workflows. They are mainly designed for professionals but should be usable for everybody.
https://cinaq.com
GNU Affero General Public License v3.0
21 stars 5 forks source link

Ability to apply policies to microflows #5

Closed xiwenc closed 1 month ago

xiwenc commented 6 months ago

Use case

We would like to be able to implement policies that checks anatomy of microflow implementations. Like avoid commit inside of a loop.

Solution

translate the flows into nested dictionaries. Dictionaries (objects) and lists can be processed easily by OPA. If we convert to some human-readable pseudo code, OPA might not be able to parse it efficiently.

xiwenc commented 6 months ago

The current approach is:

Convert the directed cyclic graph to a directed acyclic graph. Whenever we encounter a merge, we will do a backtrack walk to check if it is cycle. If it is, we stop at the merge, mark it as a loop. This loop is then recorded as such in the list of loops.

xiwenc commented 6 months ago

mendix microflow conversion - Frame 1 (5) mendix microflow conversion - Frame 4 mendix microflow conversion - Frame 3 mendix microflow conversion - Frame 2 Above is the rough idea for dealing with loops.

xiwenc commented 6 months ago

Closed by accident. Basic has been implemented; but we still want to have looping :)