gitlab-org--gitlab-foss/spec/finders
Yorick Peterse 237c8f66e6
Precalculate trending projects
This commit introduces a Sidekiq worker that precalculates the list of
trending projects on a daily basis. The resulting set is stored in a
database table that is then queried by Project.trending.

This setup means that Unicorn workers no longer _may_ have to calculate
the list of trending projects. Furthermore it supports filtering without
any complex caching mechanisms.

The data in the "trending_projects" table is inserted in the same order
as the project ranking. This means that getting the projects in the
correct order is simply a matter of:

    SELECT projects.*
    FROM projects
    INNER JOIN trending_projects ON trending_projects.project_id = projects.id
    ORDER BY trending_projects.id ASC;

Such a query will only take a few milliseconds at most (as measured on
GitLab.com), opposed to a few seconds for the query used for calculating
the project ranks.

The migration in this commit does not require downtime and takes care of
populating an initial list of trending projects.
2016-10-10 12:27:08 +02:00
..
access_requests_finder_spec.rb Enable Lint/StringConversionInInterpolation cop and autocorrect offenses 2016-10-03 16:09:57 +02:00
branches_finder_spec.rb Add failing test for #20462 2016-08-02 03:32:28 +02:00
contributed_projects_finder_spec.rb
group_projects_finder_spec.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
groups_finder_spec.rb Improve group visibility level feature 2016-03-18 16:58:04 -03:00
issues_finder_spec.rb fix issues mr counter 2016-09-20 14:39:15 +01:00
joined_groups_finder_spec.rb Allow Member.add_user to handle access requesters 2016-09-28 09:43:00 +02:00
merge_requests_finder_spec.rb fixes part1 of files to start using active tense 2016-08-09 15:06:23 +01:00
move_to_project_finder_spec.rb Move to project dropdown with infinite scroll for better performance 2016-08-18 15:31:51 +02:00
notes_finder_spec.rb fixes part1 of files to start using active tense 2016-08-09 15:06:23 +01:00
personal_projects_finder_spec.rb Improve group visibility level feature 2016-03-18 16:58:04 -03:00
pipelines_finder_spec.rb Improve PipelinesFinder spec so that it does not depend on hard-coded database IDs 2016-09-09 16:21:46 -04:00
projects_finder_spec.rb Allow Member.add_user to handle access requesters 2016-09-28 09:43:00 +02:00
snippets_finder_spec.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
tags_finder_spec.rb add specs for tags finder 2016-08-31 19:16:47 +01:00
todos_finder_spec.rb Todos sorting dropdown 2016-08-19 16:14:20 -03:00