[Rails5] failing ./spec/features/milestones/user_deletes_milestone_spec.rb
Even with this GROUP BY
fix https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6747, the following spec is failing on related error:
bundle exec rspec ./spec/features/milestones/user_deletes_milestone_spec.rb:14
Mysql2::Error: 'test.issues.title' isn't in GROUP BY: SELECT issues.*, (SELECT MIN(`label_priorities`.`priority`) FROM `labels` INNER JOIN `label_links` ON `label_links`.`label_id` = `labels`.`id` LEFT OUTER JOIN `label_priorities` ON `labels`.`id` = `label_priorities`.`label_id` WHERE (label_priorities.project_id = issues.project_id) AND (label_links.target_id = issues.id) AND `label_links`.`target_type` = 'Issue') AS highest_priority FROM `issues` WHERE `issues`.`project_id` = 1 AND `issues`.`milestone_id` = 1 AND (`issues`.`state` IN ('opened')) AND (NOT EXISTS (SELECT TRUE FROM issue_assignees WHERE issue_id = issues.id)) GROUP BY `issues`.`id` ORDER BY highest_priority IS NULL, highest_priority ASC, `issues`.`id` DESC
Probably caused by sorted_issues
method in app/models/concerns/milestoneish.rb
(specifically by calling .sort_by_attribute('label_priority')
which uses https://gitlab.com/gitlab-org/gitlab-ee/blob/v11.1.1-ee/app/models/concerns/issuable.rb#L180