Commit graph

11 commits

Author SHA1 Message Date
GitLab Bot
80f61b4035 Add latest changes from gitlab-org/gitlab@master 2019-09-18 14:02:45 +00:00
dineshpanda
ee1633e383 Avoid calling freeze on already frozen strings in app/services 2019-09-04 09:21:21 +05:30
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
gfyoung
fbde835404 Enable more frozen string in app/services/**/*.rb
Partially addresses #47424.
2018-07-17 15:19:40 -07:00
Felipe Artur
625957c2ad BatchOpenIssuesCount only updates public issues count 2018-06-25 11:54:11 -03:00
Felipe Artur
4ab1011d42 Fix refresh cache for open issues count service 2018-06-21 17:34:33 -03:00
Felipe Artur
aee2b23549 Fix sidebar issue count 2018-05-24 11:51:18 -03:00
Francisco Lopez
7f2b6b11bd Moving query to base count service 2017-12-04 11:20:20 +01:00
Francisco Lopez
194f7bca9a Comments from code review applied. Also switched forked_from_project and ForkedProjectLinks to ForkNetworkMember 2017-12-01 18:32:12 +01:00
Yorick Peterse
3e561736b2
Cache the number of user SSH keys
By caching the number of personal SSH keys we reduce the number of
queries necessary on pages such as ProjectsController#show (which can
end up querying this data multiple times).

The cache is refreshed/flushed whenever an SSH key is added, removed, or
when a user is removed.
2017-11-16 14:59:38 +01:00
Yorick Peterse
6ec53f5d48
Cache the number of open issues and merge requests
Every project page displays a navigation menu that in turn displays the
number of open issues and merge requests. This means that for every
project page we run two COUNT(*) queries, each taking up roughly 30
milliseconds on GitLab.com. By caching these numbers and refreshing them
whenever necessary we can reduce loading times of all these pages by up
to roughly 60 milliseconds.

The number of open issues does not include confidential issues. This is
a trade-off to keep the code simple and to ensure refreshing the data
only needs 2 COUNT(*) queries instead of 3. A downside is that if a
project only has 5 confidential issues the counter will be set to 0.

Because we now have 3 similar counting service classes the code
previously used in Projects::ForksCountService has mostly been moved to
Projects::CountService, which in turn is reused by the various service
classes.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36622
2017-08-23 13:42:29 +02:00