Branch: refs/heads/master
Home: https://github.com/openSUSE/open-build-service
Commit: 733828158888e61ae71edf5568ba38943bad2332
https://github.com/openSUSE/open-build-service/commit/733828158888e61ae71edf...
Author: Eduardo Navarro
Date: 2021-03-31 (Wed, 31 Mar 2021)
Changed paths:
M src/api/app/controllers/request_controller.rb
M src/api/app/models/bs_request.rb
M src/api/app/models/bs_request/data_table/find_for_user_or_group_query.rb
Log Message:
-----------
Remove unnecessary `includes` in requests query
Sorting the requests by the Source, Target or Type columns led to
missing results.
This was caused by a wrong DISTINCT clause, that was taking fields from
two tables (`bs_request_actions` and `requests`) instead of one
(`requests`). Those extra fields in the DISTINCT clause were introduced
by an `includes` finder method.
The problem was fixed by replacing the `includes` in the `.with_action`
scope with a `joins` finder method, so the fields from
`bs_requests_actions` are no longer part of the DISTINCT modifier in the
SQL sentence.
Additionally, the `includes` in the
BsRequest::DataTable::FindForUserOrGroup#requests method was redundant.
We add `preload(:bs_request_actions)` instead.
In order to prevent using LIMIT inside subqueries, we moved the limit
finder method to the last step of the query.
Co-authored-by: Saray Cabrera Padrón
Commit: 49fe8af8b4c2940a98102cc7e584c977beddb3ac
https://github.com/openSUSE/open-build-service/commit/49fe8af8b4c2940a98102c...
Author: Eduardo J
Date: 2021-04-01 (Thu, 01 Apr 2021)
Changed paths:
M src/api/app/controllers/request_controller.rb
M src/api/app/models/bs_request.rb
M src/api/app/models/bs_request/data_table/find_for_user_or_group_query.rb
Log Message:
-----------
Merge pull request #10961 from eduardoj/fix-10950
Remove unnecessary `includes` in requests query
Compare: https://github.com/openSUSE/open-build-service/compare/001cf1cbda01...49fe8a...