Commit Graph

17 Commits

Author SHA1 Message Date
GitLab Bot 5ec9ab0e8c Add latest changes from gitlab-org/gitlab@master 2020-09-10 21:08:28 +00:00
GitLab Bot 77237c5a6b Add latest changes from gitlab-org/gitlab@master 2020-03-05 00:07:49 +00:00
Jarka Kadlecová d729ea19da Restrict reopening locked issues for issue authors 2018-09-04 12:25:18 +02:00
gfyoung 265478ad74 Enable frozen string in apps/services/**/*.rb
For directories application_settings --> labels.

Partially addresses #47424.
2018-07-16 12:36:41 -07:00
Sean McGivern b5042e5301 Move NotificationService calls to Sidekiq
The NotificationService has to do quite a lot of work to calculate the
recipients for an email. Where possible, we should try to avoid doing this in an
HTTP request, because the mail are sent by Sidekiq anyway, so there's no need to
schedule those emails immediately.

This commit creates a generic Sidekiq worker that uses Global ID to serialise
and deserialise its arguments, then forwards them to the NotificationService.
The NotificationService gains an `#async` method, so you can replace:

    notification_service.new_issue(issue, current_user)

With:

    notification_service.async.new_issue(issue, current_user)

And have everything else work as normal, except that calculating the recipients
will be done by Sidekiq, which will then schedule further Sidekiq jobs to send
each email.
2018-04-25 12:48:14 +01:00
Rob Ede e80f056712 Refresh open Issue and Merge Request project counter caches when re-opening 2017-10-30 16:20:29 +00:00
Yorick Peterse 6ef87a2083
Merge issuable "reopened" state into "opened"
Having two states that essentially mean the same thing is very much like
having a boolean "true" and boolean "mostly-true": it's rather silly.
This commit merges the "reopened" state into the "opened" state while
taking care of system notes still showing messages along the lines of
"Alice reopened this issue".

A big benefit from having only two states (opened and closed) is that
indexing and querying becomes simpler and more performant. For example,
to get all the opened queries we no longer have to query both states:

    SELECT *
    FROM issues
    WHERE project_id = 2
    AND state IN ('opened', 'reopened');

Instead we can query a single state directly, which can be much faster:

    SELECT *
    FROM issues
    WHERE project_id = 2
    AND state = 'opened';

Further, only having two states makes indexing easier as we will only
ever filter (and thus scan an index) using a single value. Partial
indexes could help but aren't supported on MySQL, complicating the
development process and not being helpful for MySQL.
2017-07-28 13:31:51 +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
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
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
Marin Jankovski 1208c6caa8 Notification for reopened issue. 2014-07-03 12:51:24 +02: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 ed67ba9663
Add support for close/reopen actions in update service
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-02 15:50:50 +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