Commit graph

19 commits

Author SHA1 Message Date
Yorick Peterse
57b96eb6db
Fix refreshing of issues/MR count caches
This ensures the open issues/MR count caches are refreshed properly when
creating new issues or MRs. This MR also includes a change to the cache
keys to ensure all caches are rebuilt on the fly.

This particular problem was not caught in the test suite due to a null
cache being used, resulting in all calls that would use a cache using
the underlying data directly. In production the code would fail because
a newly saved record returns an empty hash in #changes meaning checks
such as `state_changed? || confidential_changed?` would return false for
new rows, thus never updating the counters.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/38061
2017-09-19 17:16:45 +02:00
Jarka Kadlecova
7bee7b848a Support both internal and external issue trackers 2017-07-24 08:13:43 +02:00
Sean McGivern
0e488ef70a Clear issuable counter caches on update
When an issuable's state changes, or one is created, we should clear the cache
counts for a user's assigned issuables, and also the project-wide caches for
this user type.
2017-07-19 10:21:20 +01:00
Valery Sizov
33687db01d Fix counters cache invalidation for Issues and Merge Requests 2017-05-26 17:43:51 +03:00
Adam Niedzielski
1105597303 Refactor JiraService by moving code out of JiraService#execute method
The implicit interface of project services states that the "execute"
method is meant to be called when project hooks are executed.
Currently JiraService does not support any project events even though
JiraService#supported_events says that "commit" and "merge_request"
are supported. They are only used to render correct options in
JIRA configuration screen, but they are not supported.
Because of that, this commit makes "execute" method a no-op.
2016-12-01 09:45:06 +01: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
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
Grzegorz Bizon
5e405bfea9 Update methods that use issue close service
`Issues::CloseService#execute` signature has changed, because of using
keyword parameter for commmit.
2016-03-17 09:54:16 +01:00
Grzegorz Bizon
a23f0e8c9e Reuse existing issue services when moving issue 2016-03-17 07:39:16 +01:00
Douglas Barbosa Alexandre
3d52e139b1 Rename Tasks to Todos 2016-02-20 12:39:27 -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
Drew Blessing
f177aaa5fa Backport JIRA service 2015-12-18 14:19:48 -06: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
Robert Speicher
686f6855c2 Update SystemNoteService method naming conventions
Now the verb comes first, and there is no restriction on
singular/plural.
2015-05-11 00:01:15 -04:00
Robert Speicher
48e6fb532a Add a SystemNoteService class
There's a lot of code in the Note model that only deals with creating
system notes, so we're going to split that into its own class.
2015-05-11 00:01:01 -04:00
Dmitriy Zaporozhets
9d85ea3acf Organize event order execution when update issue or mr 2015-01-25 22:49:05 -08:00
Jeroen van Baarsen
45e1941fb3 Return a little more information in Issue webhook
When a webhook for issues is triggered, it should also return the
resource URL, and the action that was performed (ie: Was it reopened,
updated, opened or closed)
2014-06-13 12:14:43 +02:00
Dmitriy Zaporozhets
49f977d675
Fix tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-02 19:55:23 +03:00
Dmitriy Zaporozhets
cc77365488
Create services for issue close and reopen
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-02 15:38:24 +03:00