controller_configuration icon indicating copy to clipboard operation
controller_configuration copied to clipboard

rewrite diff plugin

Open djdanielsson opened this issue 1 year ago • 4 comments

creating this because that is the solution to all the other diff issues that are open and I am closing those referencing this issue to track the rewrite of the diff plugin.

djdanielsson avatar Sep 30 '22 00:09 djdanielsson

Hi, unless a completely different approach is considered for the object diff, I would suggest splitting the controller_object_diff.py file into multiple files, one for each object type, containing a class that would implement the methods of an abstract class(acting as an interface). The definition of which keys to keep from the 2 lists, updating and removing keys, expanding values, etc - any logic specific to an object type would go in it's own class.

I also think it would help a lot to have a very easy test setup, where one would just clone the repo, add api_list and compare_list and run tests on their local machines. The more test cases, the better, as it would give more confidence for people collaborating to it.

bogdanmuresan avatar Mar 29 '23 07:03 bogdanmuresan

Hi, unless a completely different approach is considered for the object diff, I would suggest splitting the controller_object_diff.py file into multiple files, one for each object type, containing a class that would implement the methods of an abstract class(acting as an interface). The definition of which keys to keep from the 2 lists, updating and removing keys, expanding values, etc - any logic specific to an object type would go in it's own class.

I also think it would help a lot to have a very easy test setup, where one would just clone the repo, add api_list and compare_list and run tests on their local machines. The more test cases, the better, as it would give more confidence for people collaborating to it.

You seem to have the idea very clear... PRs are welcome! ^_^

ivarmu avatar Apr 04 '23 10:04 ivarmu

So a few notes to just mention. One the API has a limited number of items it can return in one call and needs to be considered. Another is it needs to be able to compare items not only at the object name level but ownership (such as org and user) to ensure that you are comparing the same two objects.

djdanielsson avatar Apr 04 '23 11:04 djdanielsson

This is partially done with the new export module, we need to push for more endpoints to be covered and then it will be complete.

sean-m-sullivan avatar Apr 29 '23 12:04 sean-m-sullivan