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

Remove general logic that is inlined with route handlers #328

Closed
7 tasks done
zelima opened this issue Apr 7, 2017 · 1 comment
Closed
7 tasks done

Remove general logic that is inlined with route handlers #328

zelima opened this issue Apr 7, 2017 · 1 comment
Assignees

Comments

@zelima
Copy link
Contributor

zelima commented Apr 7, 2017

There is an undesirable pattern through all this code of having general logic inlined with route handlers. As the codebase grows, this gets unmanageable very quickly, and leads to duplication of logic and introduction of bugs. example, have a README util that gets called in the handler, rather than inlining the README processing logic: https://github.com/frictionlessdata/dpr-api/blob/master/app/site/controllers.py#L100

Acceptance criteria

  • most inlined logic moved into function into utils
  • functions are tested

Tasks

  • Create logic folder and move site/logic.py up to there as /logic/__init__.py + move tests [no new test needed]
  • Move package/controllers.py get package stuff into logic and refactor package/controllers.py to use [enhance existing logic test, no change to controller test]
  • Marshmallow-ify logic.get_package(prep for all other work we are about to do) [new tests or addition to existing logic test]
  • Refactor other code into logic from controllers
  • move search "model" into logic (it really is logic ...)
@zelima zelima added this to the Backlog milestone Apr 7, 2017
@pwalsh pwalsh mentioned this issue Apr 7, 2017
24 tasks
@zelima zelima modified the milestones: Sprint - 8 May 2017, Backlog Apr 26, 2017
zelima added a commit that referenced this issue May 3, 2017
- new logic layer for getting the datapackage
- removed inlined logic from router
- test for logic layer
refs #328
zelima added a commit that referenced this issue May 4, 2017
zelima added a commit that referenced this issue May 8, 2017
[logic][xl]: 
* logic removed from auth controllers
* inlined logic moved from package controllers to logic.py
* models for search moved to logic - where it actually belongs
refs #328
@zelima
Copy link
Contributor Author

zelima commented May 8, 2017

FIXED

@zelima zelima closed this as completed May 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants