kiwitcms / Kiwi

open source test management system with over 2 million downloads!
https://kiwitcms.org
GNU General Public License v2.0
970 stars 289 forks source link

XML-RPC: refactor parameters from dict to **kwargs #144

Closed atodorov closed 6 years ago

atodorov commented 6 years ago

Lots of methods in the XML-RPC api accept dictionaries as arguments and then extract specific keys out of them. Very often these act as field lookups for Django's QuerySet.

Instead of passing dicts we can safely pass named arguments to these methods. This will make the API more clear to use and a bit easier to document!

Everything under tcms/xmlrpc/api must be inspected and updated. The corresponding tcms_api bits as well plus a good fat changelog notice for all of this.

atodorov commented 6 years ago

There was also a commentary about accepting keyword arguments for other methods. It is possible to create some sort of wrapper around this, e.g. https://stackoverflow.com/questions/119802/using-kwargs-with-simplexmlrpcserver-in-python but I'm not sure if it won't lead to more confusion and problems.

Need to examine the idea further before final conclusion.

atodorov commented 6 years ago

Closing as wontfix for now. We've made a huge progress with the latest refactoring of the API and this doesn't seem like a huge concern atm.