Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure the entire app #14

Closed
noracato opened this issue Feb 25, 2021 · 2 comments
Closed

Restructure the entire app #14

noracato opened this issue Feb 25, 2021 · 2 comments
Assignees
Labels
pitch Some big brand new idea

Comments

@noracato
Copy link
Member

After struggling with the undocumented, untested code base that was mostly written by others than @redekok and me (think of the EnergySystemHandler, ETM_API and such) once again yesterday, I finally became fed up with it. Sorry again that my ETEngine commits took the fall for that @antw.

So, here's my pitch to restructure the entire app!

First off I would really like to add a test suite. Normally easily done by using pytest and loading the app in as a fixture. Trying this out I came to the conclusion that the entire structure of the app is.. well.. not even following the first step of the how-to-build-a-basic-flask-app tutorial. Meaning we can't load up the app in the test suite right now. My guess is that this app was set up as a bit of a playground - not to be a solid application.

What's needed:

  1. Create a Flask factory with app configs and routes, separated from the controllers etc
  2. Setup a basic test suite
  3. Move all api controllers to their own file and put them in a nice folder
  4. Add tests for all api controllers
  5. Review the scripts that are in helpers and put them in more fitting folders (including interface.py)
  6. Setup test integration on github/semaphore
  7. Set Roos up with a testing environnement for the conversion methods in interface.py
  8. Remove the data folder
  9. Add tests for all the files/classes that were in helpers

The first four + the integration of tests are the most pressing IMO. I think that can be done 4-5 days with some help from @redekok, as we only have 2 controllers at the moment.

The other three are also important, but maybe as a second phase if we don't have time/budget right now. I expect 7 and 9 to both be effort:high as well.

This restucture will not only help us right now, but I think having a solid test suite will also help Roos in adding new assets to the etm-esdl conversion in the future (see 7). I we want to be serious in this ESDL business, this app needs some love.

@ChaelKruip @redekok what do you think of this restructure idea, do we have time/budget for it?

@noracato noracato added the pitch Some big brand new idea label Feb 25, 2021
@noracato noracato self-assigned this Feb 25, 2021
@redekok
Copy link

redekok commented Feb 25, 2021

This sounds like an excellent plan @noracato! I love the idea for a restructure including a testing environment. That will definitely save us lots of frustration. Let's discuss the possibilities for time and budget offline.

@noracato
Copy link
Member Author

Closed with #42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pitch Some big brand new idea
Projects
None yet
Development

No branches or pull requests

2 participants