Commit Graph

60 Commits

Author SHA1 Message Date
GitLab Bot f22f6efffe Add latest changes from gitlab-org/gitlab@master 2023-06-29 09:08:42 +00:00
GitLab Bot 7a544c9ef1 Add latest changes from gitlab-org/gitlab@master 2023-06-09 06:09:00 +00:00
GitLab Bot fc4faf47ac Add latest changes from gitlab-org/gitlab@master 2023-05-25 12:07:22 +00:00
GitLab Bot d4e0452ed9 Add latest changes from gitlab-org/gitlab@master 2023-04-05 15:14:09 +00:00
GitLab Bot eab22d334f Add latest changes from gitlab-org/gitlab@master 2022-04-22 18:09:22 +00:00
GitLab Bot 748ab12e20 Add latest changes from gitlab-org/gitlab@master 2022-04-22 09:09:00 +00:00
GitLab Bot 48e30ea32f Add latest changes from gitlab-org/gitlab@master 2022-04-21 15:10:09 +00:00
GitLab Bot 846dc476d8 Add latest changes from gitlab-org/gitlab@master 2022-04-19 15:08:32 +00:00
GitLab Bot ae6b82598f Add latest changes from gitlab-org/gitlab@master 2022-04-08 09:08:18 +00:00
GitLab Bot c5f4c801a6 Add latest changes from gitlab-org/gitlab@master 2022-01-28 03:15:57 +00:00
GitLab Bot 191020103b Add latest changes from gitlab-org/gitlab@master 2021-11-04 09:12:56 +00:00
GitLab Bot 23f57fb31f Add latest changes from gitlab-org/gitlab@master 2021-11-02 18:12:13 +00:00
GitLab Bot 3b85f5e4a1 Add latest changes from gitlab-org/gitlab@master 2021-09-16 09:09:11 +00:00
GitLab Bot a83fba70a6 Add latest changes from gitlab-org/gitlab@master 2021-09-16 00:11:46 +00:00
GitLab Bot 27d1ed4ddf Add latest changes from gitlab-org/gitlab@master 2021-09-15 18:11:29 +00:00
GitLab Bot 65688a5092 Add latest changes from gitlab-org/gitlab@master 2021-08-09 09:22:41 +00:00
GitLab Bot 0ae8428c8e Add latest changes from gitlab-org/gitlab@master 2021-05-11 21:10:21 +00:00
GitLab Bot 2d099cf5e6 Add latest changes from gitlab-org/gitlab@master 2021-02-26 00:11:20 +00:00
GitLab Bot f3b791d5d5 Add latest changes from gitlab-org/gitlab@master 2020-12-17 18:10:14 +00:00
GitLab Bot d15f01ae26 Add latest changes from gitlab-org/gitlab@master 2020-12-11 00:09:41 +00:00
GitLab Bot 3a966afb3e Add latest changes from gitlab-org/gitlab@master 2020-12-07 21:10:08 +00:00
GitLab Bot 6092dcc437 Add latest changes from gitlab-org/gitlab@master 2020-10-02 12:09:03 +00:00
GitLab Bot 283fb71e02 Add latest changes from gitlab-org/gitlab@master 2020-07-17 15:09:13 +00:00
GitLab Bot 4a14cfd195 Add latest changes from gitlab-org/gitlab@master 2020-07-09 15:08:59 +00:00
GitLab Bot e33f87ac0f Add latest changes from gitlab-org/gitlab@master 2020-04-21 15:21:10 +00:00
GitLab Bot 5ad0cf2655 Add latest changes from gitlab-org/gitlab@master 2020-01-23 12:08:38 +00:00
George Koltsov 8bcc47ac02 Add SortingPreference concern
Sorting preference functionality has been extracted
from `IssuableCollections` to a new `SortingPreference`
concern in order to reuse this functionality in projects
(and groups in the future).
2019-08-21 10:13:45 +00:00
Alejandro Rodríguez 585fcfb9e7 Fix undefined variable error on json project views
This mistake seems to have always been there, but it only resulted in
errors on the `/explore*.json` since they were the one that _actually_
relied on the local variables.
2019-03-18 21:27:28 -03:00
Riccardo Padovani bd7ba9c59b Fix `star` action in the `explore` subpages 2019-01-28 10:45:49 +00:00
George Tsiolis 23f0020be0 Move ProjectsFinder into the controller 2019-01-15 20:07:19 +02:00
Gabriel Mazetto d81c646014 Eager-load relations for Explore::ProjectsController
This removes remaining N+1 queries
2018-12-10 17:35:09 +01:00
gfyoung be42c05054 Enable more frozen string in app/controllers/
Enables frozen string for the following:

* app/controllers/dashboard/**/*.rb
* app/controllers/explore/**/*.rb
* app/controllers/google_api/**/*.rb
* app/controllers/groups/**/*.rb
* app/controllers/import/**/*.rb
* app/controllers/instance_statistics/**/*.rb
* app/controllers/ldap/**/*.rb
* app/controllers/oauth/**/*.rb
* app/controllers/profiles/**/*.rb

Partially addresses #47424.
2018-09-23 12:48:02 -07:00
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00
Mike Greiling 2c569be63b Resolve "Display member role per project" 2017-12-07 09:11:41 +00:00
Yorick Peterse c1f9403e45
Use Prev/Next pagination for exploring projects
This changes the pagination of the "Explore" pages so they use a simpler
pagination system that only shows "Prev" and "Next" buttons. This
removes the need for getting the total number of rows to display, a
process that can easily take up to 2 seconds when browsing through a
large list of projects.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/27390
2017-08-14 13:53:42 +02:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Jacopo b996a82ff4 ProjectsFinder should handle more options
Extended ProjectFinder in order to handle the following options:
 - current_user - which user use
 - project_ids_relation: int[] - project ids to use
 - params:
   -  trending: boolean
   -  non_public: boolean
   -  starred: boolean
   -  sort: string
   -  visibility_level: int
   -  tags: string[]
   -  personal: boolean
   -  search: string
   -  non_archived: boolean

GroupProjectsFinder now inherits from ProjectsFinder.
Changed the code in order to use the new available options.
2017-04-06 07:11:37 +02:00
Bob Van Landuyt 901e70fba1 Eager load route & namespace in `Explore::ProjectsController` 2017-03-16 12:31:27 +01:00
Eric Eastwood 6fbf24af27 Fix /explore sorting (trending)
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/27044
2017-01-26 12:01:06 -06:00
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
Yorick Peterse 154253cab5
Refactor TrendingProjectsFinder to support caching
== Public Projects

This finder class now _only_ returns public projects. Previously this
finder would also return private and internal projects. Including these
projects makes caching data much harder and less efficient. Meanwhile
including this data isn't very useful as very few users would be
interested in seeing projects they have access to as trending. That is,
the feature is more useful when you want to see what _other_ popular
projects there are.

== Caching

The data returned by TrendingProjectsFinder is now cached for a day
based on the number of months the data should be restricted to. The
cache is not flushed explicitly, instead it's rebuilt whenever it
expires.

== Timings

To measure the impact I changed the finder code to use the last 24
months instead of the last month. I then executed and measured 10
requests to the explore page. On the current "master" branch (commit
88fa5916ff) this would take an average of
2.43 seconds. Using the changes of this commit this was reduced to
around 1.7 seconds.

Fixes gitlab-org/gitlab-ce#22164
2016-10-05 16:39:03 +02:00
Robert Speicher 085538c2bd Use the configured Kaminari "per page" default 2016-03-19 17:37:54 -04:00
Josh Frye 449954ecc2 Allow filtered dashboard/explore results to be paged. Fixes #14104 2016-03-09 21:03:28 -05:00
Dmitriy Zaporozhets acb211215c Add option to show archived projects on dahsboard
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-04 19:25:28 +01:00
Josh Frye 120dca0f35 MR feedback 2016-02-09 10:10:41 -05:00
Josh Frye 8b4e9720d9 Extract events rendering to own action. 2016-02-09 10:10:41 -05:00
Josh Frye 30e022a2fe Starred, All, and Trending on explore are paged also group projects. Need ajax filter. 2016-02-09 10:10:41 -05:00
Josh Frye 3f1bd844f1 Implement changes from MR feedback 2016-02-04 14:02:19 -05:00
Josh Frye 2ad094132d Various filter fixes 2016-02-04 13:03:41 -05:00
Josh Frye 7522ac0b3c Paginate + ajax filter dashboard projects 2016-02-04 11:40:19 -05:00