Replace SQL with ORM in reporting app. Fix #127 #146

Open
wants to merge 6 commits into
from

Conversation

Projects
None yet
2 participants
@atodorov
Contributor

atodorov commented Feb 16, 2017

Note: I've wanted to have each change in its own commit but when I started working on Custom Report and Testing Report I realized some of the classes inherit from each other and that's why the last commit lumps several changes together.

I realize this PR is quite big and possibly impractical for review but I've taken case to optimize the new ORM queries and validate the results are correct.

Note2: In Testing Report (possibly others) there are places which utilize 2 or 3 queries but can be now optimized to only 1 query. These are often where we count number of plans, runs. All of that info can be fetched with a single query and put together with a bit of Python code if need be. I've optimized in a few places but not all of them since my goal was to get all reports running on PostgreSQL.

CC @mihailgmihaylov

atodorov added some commits Feb 7, 2017

More SQL to ORM refactoring for reports, including
- product build report
- product component report
- product version report
- custom report
- custom details report
- testing report (needs few more improvements)

- updated templates to match some field names which changed

NOTE: in all cases the ORM queries are either the same as their
SQL counterparts or better. For Custom Report I have removed
some of the methods and instead collect the same information using
a single ORM query.

atodorov added a commit to MrSenko/Nitrate that referenced this pull request Mar 2, 2017

Refactor TC_REMOVE_CC SQL into ORM
by updating xmlrpc.testcase.notification_remove_cc() method. I've
made this method very similar to notification_add_cc() and
notification_get_cc() methods. Also added a test!

Related to #146

Signed-off-by: Mr. Senko <atodorov@mrsenko.com>

tkdchen added a commit that referenced this pull request Mar 2, 2017

Refactor TC_REMOVE_CC SQL into ORM
by updating xmlrpc.testcase.notification_remove_cc() method. I've
made this method very similar to notification_add_cc() and
notification_get_cc() methods. Also added a test!

Related to #146

Signed-off-by: Mr. Senko <atodorov@mrsenko.com>

@tkdchen tkdchen added this to the Compatible with both MariaDB and PostgreSQL milestone Dec 7, 2017

@tkdchen tkdchen modified the milestones: Compatible with both MariaDB and PostgreSQL, 4.3 Apr 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment