diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-02 18:09:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-02 18:09:10 +0300 |
commit | 9c33625b8e47c6aa96095018a0c1dd3f22c2ce1e (patch) | |
tree | a55395617870696370830e991e0b7cf7e4099bde /app/services/resource_events | |
parent | c658e2d29296721aa65d569a42b778485042795a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/resource_events')
-rw-r--r-- | app/services/resource_events/change_labels_service.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/services/resource_events/change_labels_service.rb b/app/services/resource_events/change_labels_service.rb index 03ac839c509..04f917ec8ef 100644 --- a/app/services/resource_events/change_labels_service.rb +++ b/app/services/resource_events/change_labels_service.rb @@ -24,6 +24,9 @@ module ResourceEvents end ApplicationRecord.legacy_bulk_insert(ResourceLabelEvent.table_name, labels) # rubocop:disable Gitlab/BulkInsert + + create_timeline_events_from(added_labels: added_labels, removed_labels: removed_labels) + resource.expire_note_etag_cache Gitlab::UsageDataCounters::IssueActivityUniqueCounter.track_issue_label_changed_action(author: user) if resource.is_a?(Issue) @@ -41,6 +44,17 @@ module ResourceEvents raise ArgumentError, "Unknown resource type #{resource.class.name}" end end + + def create_timeline_events_from(added_labels: [], removed_labels: []) + return unless resource.incident? + + IncidentManagement::TimelineEvents::CreateService.change_labels( + resource, + user, + added_labels: added_labels, + removed_labels: removed_labels + ) + end end end |