Skip to content

Add sort by popularity to issues

Dmitry Gruzd requested to merge 263365-add-sort-by-popularity into master

What does this MR do?

This MR adds the ability to sort issues search results by popularity (upvotes) and displays the upvotes count on the search result page. This change is based on 2 MRs:

#263365

How to test this feature locally

Feature.enable(:search_sort_issues_by_popularity)

Migration

Execution time at #database-lab: The query has been executed. Duration: 17.769 min

migration output
❯ VERSION=20210706115312 bin/rake db:migrate:up
== 20210706115312 AddUpvotesCountIndexToIssues: migrating =====================
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:issues, [:project_id, :upvotes_count], {:name=>"index_issues_on_project_id_and_upvotes_count", :algorithm=>:concurrently})
   -> 0.0070s
== 20210706115312 AddUpvotesCountIndexToIssues: migrated (0.0073s) ============

❯ VERSION=20210706115312 bin/rake db:migrate:down
== 20210706115312 AddUpvotesCountIndexToIssues: reverting =====================
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:issues, [:project_id, :upvotes_count], {:name=>"index_issues_on_project_id_and_upvotes_count", :algorithm=>:concurrently})
   -> 0.0081s
-- execute("SET statement_timeout TO 0")
   -> 0.0003s
-- remove_index(:issues, {:name=>"index_issues_on_project_id_and_upvotes_count", :algorithm=>:concurrently, :column=>[:project_id, :upvotes_count]})
   -> 0.0092s
-- execute("RESET ALL")
   -> 0.0004s
== 20210706115312 AddUpvotesCountIndexToIssues: reverted (0.0186s) ============

Screenshots (strongly suggested)

Screenshot_2021-07-12_at_13.13.34

Additional screenshots taken from !65452 (comment 619787282)

Fixed Layout (w/ Popularity FF)
Desktop Mobile
Fixed_-_Desktop-_FF Fixed_-Mobile-_FF
Fluid Layout (w/ Popularity FF)
Desktop Mobile
Fluid_-Desktop-_FF Fluid_-Mobile-_FF
Fixed Layout (w/o Popularity FF)
Desktop Mobile
Fixed_-Desktop-_NO_FF Fixed_-Mobile-_NO_FF

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team

Related to #263365

Edited by Dmitry Gruzd

Merge request reports