-
-
Notifications
You must be signed in to change notification settings - Fork 782
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
Optimize test statistic queries #7789
base: master
Are you sure you want to change the base?
Optimize test statistic queries #7789
Conversation
✅ Deploy Preview for inventree-web-pui-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
5ba8743
to
de2a067
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7789 +/- ##
==========================================
- Coverage 83.49% 82.96% -0.53%
==========================================
Files 1121 1119 -2
Lines 49829 50751 +922
Branches 1645 1618 -27
==========================================
+ Hits 41606 42107 +501
- Misses 7781 8212 +431
+ Partials 442 432 -10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@martonmiklos for some reason when testing this I am getting a 404 error which I did not seem to be getting before: This is using part 903 on the demo dataset Note that I also get the same 404 on master branch - so it is not related to this PR. Note also that the "by-build" API endpoint seems to function correctly still: |
I will look into it, I kept the PR in WIP because I want to add API tests. |
Well I have to admit that I seriously messed it up here: My django knowledge appraching zero from the negative side, I would be glad if you could check whether my approach is proper here too: |
@martonmiklos can you be bit more specific what you are trying to do in the linked row? Maybe comment on the code in the PR |
Could you please link the row? |
Could you link what specifically you want to be reviewed (what are your concerns) in which code section? |
There are two things: the part statistic queries accumulated the pass-fail counts by iterating over the affected build outputs. This had been optimized by using filters which translates to joins in the SQL. The other issue what had been highlighted by was higlighted here with accessing the serializer here: |
@martonmiklos now that the new user interface supports proper plugins (you can see an example here) I would like to consider whether the "test statistics" could be offloaded to a plugin. In my opinion it is not quite a "core" feature but would certainly be useful to some users! If you are open to this, I can help set it up as a plugin, and dedicate some time to looking into what is going on with the query efficencies here... |
Sure I am open to transforming it to plugin. The main intention is to decouple it from the main repo to get rid from it to reduce the maintenance burden, or the plan is the same as the printing plugins: making them optional? I did not have time to work on InvenTree recently, but I hope this will change in the near future. |
Replace individual queries with joins in the test statistic queries