Fixes: #837
/claim #837
@tolgaOzen - Please find below the initial findings and approach, will update as i progress.
[ ] - Review the current implementation of the ‘Coverage’ command - InProgress As per the current implementation, only the action names or permission names inside the entity are added to Coverage.Assertions. https://github.com/Permify/permify/blob/60c8fb3ec00f53fc9ebe53d7e056a36c45cf6e52/pkg/development/coverage/coverage.go#L241 This is compared with scenarios->checks->assertions in the input file. Whereas the conditions inside the action/permission are not accounted, hence the coverage for assertions is inaccurate.
[ ] - Redesign the command to incorporate detailed assessments of each condition part - InProgress The starting point for the approach is - the permission’s or action’s conditions are already captured into permission object, inside the Child attribute while parsing the input file. This permission.Child attribute is made use of to capture the assertions from conditions. Refer to the current commit. Consider this as initial approach to start with. Will refine, redesign and update as I progress with the analysis and considering different scenarios.
Already there is some improvement in the accuracy (with current updates) for the following sample input file: schema.yaml.txt
Before updates :
coverage assertions percentage is 50%
After updates from current commit:
The coverage assertions percentage is now 37% , as more uncovered assertions are captured from action/permission conditions.
[ ] - Implement tests and quality checks for the revised ‘Coverage’ command - To be Started
[ ] - Update documentation to reflect the new standards and procedures - To be Started
You can assign the issue #837 to me.
Vijay
@vijayraghav-io
Permify.co
@Permify