Commit graph

12 commits

Author SHA1 Message Date
Thong Kuah
85b29c1c2f Add frozen_string_literal to spec/services
Probably useful as we often move these files to "new" files.
2019-04-12 10:14:54 +12:00
Felipe Artur
fdb5f285f9 Retrieve merge request closing issues from database cache 2018-08-06 11:58:22 -03:00
Mark Chao
a63bce1a4b Resolve "Rename the Master role to Maintainer" Backend 2018-07-11 14:36:08 +00:00
blackst0ne
27c95364b5 Replace '.team << [user, role]' with 'add_role(user)' in specs 2017-12-22 19:18:28 +11: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
Robert Speicher
72a7b30c9f Change all :empty_project to :project 2017-08-02 17:47:31 -04:00
Rémy Coutable
ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Valery Sizov
33687db01d Fix counters cache invalidation for Issues and Merge Requests 2017-05-26 17:43:51 +03:00
Douglas Barbosa Alexandre
21f10af095 Scope hooks thal will run for confidential issues 2016-08-31 18:34:45 -03:00
Douglas Barbosa Alexandre
debb65b5c8 Update service specs to avoid instance variables 2016-08-31 18:33:14 -03:00
Douglas Barbosa Alexandre
44340fede2 Fix confidential issues should not be passed to Webhooks 2016-08-31 18:33:14 -03:00
Rémy Coutable
a54fdc384f Enforce permissions in {Issues,MergeRequests}::{Close,Reopen}Service
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:06:11 +02:00