Remove unnecessary SQL queries for group/project issues list refactor
The group and project issues list pages are being refactored from Haml to Vue (#322755 (closed)), behind the feature flag vue_issues_list
.
When the vue_issues_list
feature flag is enabled, the backend makes SQL queries for issues when loading the issues list pages. However, these SQL queries are unnecessary because the Vue refactor makes GraphQL queries to fetch issues.
Unnecessary DB calls
For group issues lists, it looks like issues are being queried in app/controllers/groups_controller.rb
.
-
app/controllers/groups_controller.rb
containsbefore_action :group_projects, only: [:projects, :activity, :issues, :merge_requests]
, which calls -
app/controllers/concerns/issuable_collections_action.rb#index
, which sets@issues
and@issuable_meta_data
instance variables by querying the DB.@issuable_meta_data
isn't used in the Vue refactor so it can be removed.@issues
is used inapp/views/groups/issues.html.haml:9
but could perhaps be refactored not to.@sort
is also not used by the issues refactor so could also be removed.
For project issues lists, it looks like issues are being queried in app/controllers/projects/issues_controller.rb
.
-
app/controllers/projects/issues_controller.rb
containsbefore_action :set_issuables_index, if: ->(c) { SET_ISSUEABLES_INDEX_ONLY_ACTIONS.include?(c.action_name.to_sym) }
, which calls -
app/controllers/concerns/issuable_collections.rb#set_issuables_index
, which sets@issuables
,@issuable_meta_data
,@total_pages
,@labels
, and@users
instance variables by querying the DB, but these aren't required because the Vue refactor doesn't use these instance variables.@sort
is also not used by the issues refactor so could also be removed.
Acceptance criteria
- Unnecessary issues and issuable_meta_data etc. DB calls should not be made on the group and issues list pages behind the feature flag
vue_issues_list
Edited by Coung Ngo