Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/services')
-rw-r--r--app/services/alert_management/alerts/update_service.rb6
-rw-r--r--app/services/event_create_service.rb6
-rw-r--r--app/services/issues/update_service.rb2
-rw-r--r--app/services/merge_requests/update_service.rb2
-rw-r--r--app/services/resource_access_tokens/create_service.rb2
-rw-r--r--app/services/todo_service.rb14
6 files changed, 13 insertions, 19 deletions
diff --git a/app/services/alert_management/alerts/update_service.rb b/app/services/alert_management/alerts/update_service.rb
index 0b7216cd9f8..18d615aa7e7 100644
--- a/app/services/alert_management/alerts/update_service.rb
+++ b/app/services/alert_management/alerts/update_service.rb
@@ -96,12 +96,12 @@ module AlertManagement
end
def handle_assignement(old_assignees)
- assign_todo
+ assign_todo(old_assignees)
add_assignee_system_note(old_assignees)
end
- def assign_todo
- todo_service.assign_alert(alert, current_user)
+ def assign_todo(old_assignees)
+ todo_service.reassigned_assignable(alert, current_user, old_assignees)
end
def add_assignee_system_note(old_assignees)
diff --git a/app/services/event_create_service.rb b/app/services/event_create_service.rb
index abbb68aaf94..3921dbefd06 100644
--- a/app/services/event_create_service.rb
+++ b/app/services/event_create_service.rb
@@ -109,7 +109,7 @@ class EventCreateService
def wiki_event(wiki_page_meta, author, action, fingerprint)
raise IllegalActionError, action unless Event::WIKI_ACTIONS.include?(action)
- Gitlab::UsageDataCounters::TrackUniqueActions.track_action(event_action: action, event_target: wiki_page_meta.class, author_id: author.id)
+ Gitlab::UsageDataCounters::TrackUniqueActions.track_event(event_action: action, event_target: wiki_page_meta.class, author_id: author.id)
duplicate = Event.for_wiki_meta(wiki_page_meta).for_fingerprint(fingerprint).first
return duplicate if duplicate.present?
@@ -154,7 +154,7 @@ class EventCreateService
result = Event.insert_all(attribute_sets, returning: %w[id])
tuples.each do |record, status, _|
- Gitlab::UsageDataCounters::TrackUniqueActions.track_action(event_action: status, event_target: record.class, author_id: current_user.id)
+ Gitlab::UsageDataCounters::TrackUniqueActions.track_event(event_action: status, event_target: record.class, author_id: current_user.id)
end
result
@@ -172,7 +172,7 @@ class EventCreateService
new_event
end
- Gitlab::UsageDataCounters::TrackUniqueActions.track_action(event_action: :pushed, event_target: Project, author_id: current_user.id)
+ Gitlab::UsageDataCounters::TrackUniqueActions.track_event(event_action: :pushed, event_target: Project, author_id: current_user.id)
Users::LastPushEventService.new(current_user)
.cache_last_push_event(event)
diff --git a/app/services/issues/update_service.rb b/app/services/issues/update_service.rb
index 8835af3659d..ac7baba3b7c 100644
--- a/app/services/issues/update_service.rb
+++ b/app/services/issues/update_service.rb
@@ -43,7 +43,7 @@ module Issues
if issue.assignees != old_assignees
create_assignee_note(issue, old_assignees)
notification_service.async.reassigned_issue(issue, current_user, old_assignees)
- todo_service.reassigned_issuable(issue, current_user, old_assignees)
+ todo_service.reassigned_assignable(issue, current_user, old_assignees)
end
if issue.previous_changes.include?('confidential')
diff --git a/app/services/merge_requests/update_service.rb b/app/services/merge_requests/update_service.rb
index 29e0c22b155..cf02158b629 100644
--- a/app/services/merge_requests/update_service.rb
+++ b/app/services/merge_requests/update_service.rb
@@ -105,7 +105,7 @@ module MergeRequests
def handle_assignees_change(merge_request, old_assignees)
create_assignee_note(merge_request, old_assignees)
notification_service.async.reassigned_merge_request(merge_request, current_user, old_assignees)
- todo_service.reassigned_issuable(merge_request, current_user, old_assignees)
+ todo_service.reassigned_assignable(merge_request, current_user, old_assignees)
end
def create_branch_change_note(issuable, branch_type, old_branch, new_branch)
diff --git a/app/services/resource_access_tokens/create_service.rb b/app/services/resource_access_tokens/create_service.rb
index 3aa0e5650ee..c253154c1b7 100644
--- a/app/services/resource_access_tokens/create_service.rb
+++ b/app/services/resource_access_tokens/create_service.rb
@@ -32,6 +32,8 @@ module ResourceAccessTokens
attr_reader :resource_type, :resource
def feature_enabled?
+ return false if ::Gitlab.com?
+
::Feature.enabled?(:resource_access_token, resource, default_enabled: true)
end
diff --git a/app/services/todo_service.rb b/app/services/todo_service.rb
index ec15bdde8d7..a3db2ae7947 100644
--- a/app/services/todo_service.rb
+++ b/app/services/todo_service.rb
@@ -49,11 +49,11 @@ class TodoService
todo_users.each(&:update_todos_count_cache)
end
- # When we reassign an issuable we should:
+ # When we reassign an assignable object (issuable, alert) we should:
#
- # * create a pending todo for new assignee if issuable is assigned
+ # * create a pending todo for new assignee if object is assigned
#
- def reassigned_issuable(issuable, current_user, old_assignees = [])
+ def reassigned_assignable(issuable, current_user, old_assignees = [])
create_assignment_todo(issuable, current_user, old_assignees)
end
@@ -154,14 +154,6 @@ class TodoService
resolve_todos_for_target(awardable, current_user)
end
- # When assigning an alert we should:
- #
- # * create a pending todo for new assignee if alert is assigned
- #
- def assign_alert(alert, current_user)
- create_assignment_todo(alert, current_user, [])
- end
-
# When user marks a target as todo
def mark_todo(target, current_user)
attributes = attributes_for_todo(target.project, target, current_user, Todo::MARKED)