uc-cdis / sheepdog

API for herding data submissions
Apache License 2.0
11 stars 17 forks source link

PXD-1347 ⁃ use flask restful to consolidate routing #170

Open rudyardrichter opened 6 years ago

rudyardrichter commented 6 years ago

Instead of the current approach with generating blueprint routes at startup using functions like this, we should use flask-restful to consolidate these and eliminate the hacks around setting up the blueprints.

kulgan commented 6 years ago

I would also suggest certain functionalities are broken up so they can be clearer to work with. The Transaction classes are convoluted and intertwined with the actual functionality being implemented. For example ReleaseTransaction, SubmissionTransaction. Those are always 2 different features, of which one is relatively constant (ie Transaction) being coupled into a set of classes. These can be simplified using a simple context manager for handling transaction which remains constant and reusable then developers can focus on the actual functionality being implemented, eg release, submit, rollback etc. Also we need to consider breaking the project into a reusable library and the actual application that way we don't import an entire application into other projects say gdcapi, only the library gets imported and gdcapi can inherit from the library in ways that does not affect other people's use cases and possibly remove flags

rudyardrichter commented 6 years ago

these sound like good ideas :) could you maybe make some separate, more granular issues for these? I think the scope of this issue won't get into the transaction classes.

Also you bring up a good point about separating the application itself. I think that would be simple enough to do just by modifying api.py to return the app through a function instead of exporting it directly.