Commit graph

22 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
Jarka Kadlecova
04ee970cc1 Don't create event in Merge Request Create Service 2017-08-16 09:41:52 +00:00
Jarka Kadlecova
947c09c2a6 Simplify checking if objects exist code in new issaubles workers 2017-08-08 12:43:55 +02:00
Sean McGivern
c94990820a Merge branch '32844-issuables-performance' into 'master'
Issuables: Move some code from create services to Sidekiq workers

See merge request !13326
2017-08-07 21:21:29 +00:00
Jarka Kadlecova
9ef3c431e4 Move some after_create parts to worker to improve performance 2017-08-07 15:57:56 +02:00
Shinya Maeda
1fcf3f3d94 essential 2017-08-04 14:11:23 +09:00
Sean McGivern
3ef8036883 Backport MR create service changes from EE
In EE, the `filter_params` method needs the MR to already have its
`target_project` assigned.
2017-07-12 09:45:40 +01:00
Douwe Maan
94be44c568 Fix race condition between pipeline creation and MR diff_head_sha update 2017-06-01 13:31:52 -05:00
Felipe Artur
fe790c7543 Set head pipeline when creating merge requests 2017-05-29 15:37:56 -03:00
Timothy Andrew
68e1b5bbc0 Use the IssuableBaseService lifecycle hooks to cache MergeRequestsClosingIssues
- Instead of overriding `create` and `update` in `MergeRequests::BaseService`
- Get all merge request service specs passing
2016-09-21 01:22:20 +05:30
Douwe Maan
8b8a4626c6 Fix specs and implement fixes based on failing specs 2016-08-17 17:54:24 -05:00
Rémy Coutable
0eea8c8857 Support slash commands in noteable description and notes
Some important things to note:

- commands are removed from noteable.description / note.note
- commands are translated to params so that they are treated as normal
  params in noteable Creation services
- the logic is not in the models but in the Creation services, which is
  the right place for advanced logic that has nothing to do with what
  models should be responsible of!
- UI/JS needs to be updated to handle notes which consist of commands
  only
- the `/merge` command is not handled yet

Other improvements:

- Don't process commands in commit notes and display a flash is note is only commands
- Add autocomplete for slash commands
- Add description and params to slash command DSL methods
- Ensure replying by email with a commands-only note works
- Use :subscription_event instead of calling noteable.subscribe
- Support :todo_event in IssuableBaseService

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:05:57 +02:00
Jeroen Jacobs
7880a300dc Allows MR authors to have the source branch removed when merging the MR 2016-05-20 11:30:03 +02:00
Douglas Barbosa Alexandre
3d52e139b1 Rename Tasks to Todos 2016-02-20 12:39:27 -02:00
Douglas Barbosa Alexandre
802bf6d012 Create a pending task when an MR is assigned to someone 2016-02-20 12:10:26 -02:00
Douwe Maan
b0164771ec Simplify code around (cross)-references 2015-10-12 11:54:46 +02:00
Douwe Maan
414533ca48 Check permissions on target project in merge request create service. 2015-08-21 09:47:39 -07:00
Dmitriy Zaporozhets
0bcfe9a0dc
Dont allow set assignee, milestone or labels if user is guest
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-25 16:17:48 +02:00
Dmitriy Zaporozhets
f0c26bcb64
Fix label set during issue/mr creation
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-30 22:48:21 +03:00
Dmitriy Zaporozhets
9b6224f99c
More test fixes
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-03 12:05:21 +03:00
Dmitriy Zaporozhets
9b598fa62d
Fix MR fork validation and services load
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-03 10:36:10 +03:00
Dmitriy Zaporozhets
3c867dfa8e
MergeRequest services for create, update, close and reopen
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-02 21:51:17 +03:00