Commit Graph

26 Commits

Author SHA1 Message Date
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
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
Jarka Kadlecova 7bee7b848a Support both internal and external issue trackers 2017-07-24 08:13:43 +02:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Valery Sizov 33687db01d Fix counters cache invalidation for Issues and Merge Requests 2017-05-26 17:43:51 +03:00
Valery Sizov 268b1c79e9 [Spec optimization] Joining one-line 'it' blocks 2017-05-15 12:39:56 +03:00
Valery Sizov 387c4b2c21 Backport of multiple_assignees_feature [ci skip] 2017-05-04 17:11:53 +03:00
Douwe Maan 6df22f72c6 Rephrase some system notes to be compatible with new system note style 2016-11-24 18:26:29 +08:00
Yorick Peterse 509910b89f
Process commits in a separate worker
This moves the code used for processing commits from GitPushService to
its own Sidekiq worker: ProcessCommitWorker.

Using a Sidekiq worker allows us to process multiple commits in
parallel. This in turn will lead to issues being closed faster and cross
references being created faster. Furthermore by isolating this code into
a separate class it's easier to test and maintain the code.

The new worker also ensures it can efficiently check which issues can be
closed, without having to run numerous SQL queries for every issue.
2016-11-07 13:11:44 +01: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
tiagonbotelho 1d268a89de adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
Robert Speicher adc6ec4a9c Avoid `describe`-ing symbols in specs 2016-07-12 10:27:58 -05:00
Douglas Barbosa Alexandre 3d52e139b1 Rename Tasks to Todos 2016-02-20 12:39:27 -02:00
Douglas Barbosa Alexandre 3b98adcc75 Create a pending task when a user is mentioned when edit a issue/mr/note 2016-02-20 12:12:05 -02:00
Douglas Barbosa Alexandre a56ada0a1e Marks pending tasks for an user as done when he close the issue 2016-02-20 12:10:26 -02:00
Douwe Maan a2cfb44157 Tag service specs 2015-12-09 11:55:49 +01:00
Valery Sizov f1504e1ad5 test fix 2015-11-30 18:03:07 +02:00
Stan Hu d45112258e Fix post-receive errors on a push when an external issue tracker is configured
Closes #1700
Closes #1720
2015-06-12 06:59:27 -07:00
Douwe Maan 5210778d6e Fix specs. 2015-05-15 15:38:05 +02:00
Jeroen van Baarsen 0c4a70a306 Updated rspec to rspec 3.x syntax
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-02-12 19:17:35 +01:00
Jacob Vosmaer 780d868fec Revert "Merge branch 'fix-email-threading' into 'master'"
This reverts commit 97fd990ecd, reversing
changes made to f451a697e0.

Conflicts:
	app/mailers/emails/notes.rb
	app/mailers/emails/projects.rb
2014-06-18 13:41:12 +02:00
Pierre de La Morinerie 466b768bb3 Send notification emails to the "project", and put people in Cc
This fixes email threading in Mail.app, that doesn't like when a thread
doesn't have stable recipients.

For instance, here is a possible sender-recipient combinations before:

From: A
To: Me
New issue

From: B
To: Me
Reply on new issue

From: A
To: Me
Another reply

Mail.app doesn't see B as a participant to the original email thread,
and decides to break the thread: it will group all messages from A
together, and separately all messages from B.

This commit makes the thread look like this:

From: A
To: gitlab/project
Cc: Me
New issue

From: B
To: gitlab/project
Cc: Me
Reply on new issue

From: A
To: gitlab/project
Cc: Me
Another reply

Mail.app sees a common recipient, and group the thread correctly.
2014-06-10 17:09:15 +02:00
Dmitriy Zaporozhets 928fbeeec0
More tests for Isses services
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-02 16:33:07 +03:00