Commit 33795139 authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent c7e385e2
...@@ -110,14 +110,6 @@ export default { ...@@ -110,14 +110,6 @@ export default {
board.name.toLowerCase().includes(this.filterTerm.toLowerCase()), board.name.toLowerCase().includes(this.filterTerm.toLowerCase()),
); );
}, },
reload: {
get() {
return this.state.reload;
},
set(newValue) {
this.state.reload = newValue;
},
},
board() { board() {
return this.state.currentBoard; return this.state.currentBoard;
}, },
...@@ -142,16 +134,6 @@ export default { ...@@ -142,16 +134,6 @@ export default {
this.scrollFadeInitialized = false; this.scrollFadeInitialized = false;
this.$nextTick(this.setScrollFade); this.$nextTick(this.setScrollFade);
}, },
reload() {
if (this.reload) {
this.boards = [];
this.recentBoards = [];
this.loading = true;
this.reload = false;
this.loadBoards(false);
}
},
}, },
created() { created() {
boardsStore.setCurrentBoard(this.currentBoard); boardsStore.setCurrentBoard(this.currentBoard);
......
...@@ -30,7 +30,6 @@ const boardsStore = { ...@@ -30,7 +30,6 @@ const boardsStore = {
labels: [], labels: [],
}, },
currentPage: '', currentPage: '',
reload: false,
endpoints: {}, endpoints: {},
}, },
detail: { detail: {
...@@ -61,7 +60,6 @@ const boardsStore = { ...@@ -61,7 +60,6 @@ const boardsStore = {
}; };
}, },
showPage(page) { showPage(page) {
this.state.reload = false;
this.state.currentPage = page; this.state.currentPage = page;
}, },
addList(listObj, defaultAvatar) { addList(listObj, defaultAvatar) {
......
...@@ -371,8 +371,11 @@ ...@@ -371,8 +371,11 @@
} }
.btn-loading { .btn-loading {
&:not(.disabled) .fa { &:not(.disabled) {
display: none; .fa,
.spinner {
display: none;
}
} }
.fa { .fa {
......
# frozen_string_literal: true
module MilestoneEventable
extend ActiveSupport::Concern
included do
has_many :resource_milestone_events
end
end
# frozen_string_literal: true
module ResourceEventTools
extend ActiveSupport::Concern
included do
belongs_to :user
validates :user, presence: { unless: :importing? }, on: :create
validate :exactly_one_issuable
scope :created_after, ->(time) { where('created_at > ?', time) }
end
def exactly_one_issuable
issuable_count = self.class.issuable_attrs.count { |attr| self["#{attr}_id"] }
return true if issuable_count == 1
# if none of issuable IDs is set, check explicitly if nested issuable
# object is set, this is used during project import
if issuable_count == 0 && importing?
issuable_count = self.class.issuable_attrs.count { |attr| self.public_send(attr) } # rubocop:disable GitlabSecurity/PublicSend
return true if issuable_count == 1
end
errors.add(:base, "Exactly one of #{self.class.issuable_attrs.join(', ')} is required")
end
end
...@@ -15,6 +15,7 @@ class Issue < ApplicationRecord ...@@ -15,6 +15,7 @@ class Issue < ApplicationRecord
include ThrottledTouch include ThrottledTouch
include LabelEventable include LabelEventable
include IgnorableColumns include IgnorableColumns
include MilestoneEventable
DueDateStruct = Struct.new(:title, :name).freeze DueDateStruct = Struct.new(:title, :name).freeze
NoDueDate = DueDateStruct.new('No Due Date', '0').freeze NoDueDate = DueDateStruct.new('No Due Date', '0').freeze
......
...@@ -18,6 +18,7 @@ class MergeRequest < ApplicationRecord ...@@ -18,6 +18,7 @@ class MergeRequest < ApplicationRecord
include DeprecatedAssignee include DeprecatedAssignee
include ShaAttribute include ShaAttribute
include IgnorableColumns include IgnorableColumns
include MilestoneEventable
sha_attribute :squash_commit_sha sha_attribute :squash_commit_sha
......
# frozen_string_literal: true
class MilestoneNote < ::Note
attr_accessor :resource_parent, :event, :milestone
def self.from_event(event, resource: nil, resource_parent: nil)
resource ||= event.resource
attrs = {
system: true,
author: event.user,
created_at: event.created_at,
noteable: resource,
milestone: event.milestone,
event: event,
system_note_metadata: ::SystemNoteMetadata.new(action: 'milestone'),
resource_parent: resource_parent
}
if resource_parent.is_a?(Project)
attrs[:project_id] = resource_parent.id
end
MilestoneNote.new(attrs)
end
def note
@note ||= note_text
end
def note_html
@note_html ||= Banzai::Renderer.cacheless_render_field(self, :note, { group: group, project: project })
end
def project
resource_parent if resource_parent.is_a?(Project)
end
def group
resource_parent if resource_parent.is_a?(Group)
end
private
def note_text(html: false)
format = milestone&.group_milestone? ? :name : :iid
milestone.nil? ? 'removed milestone' : "changed milestone to #{milestone.to_reference(project, format: format)}"
end
end
...@@ -4,20 +4,17 @@ class ResourceLabelEvent < ApplicationRecord ...@@ -4,20 +4,17 @@ class ResourceLabelEvent < ApplicationRecord
include Importable include Importable
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
include CacheMarkdownField include CacheMarkdownField
include ResourceEventTools
cache_markdown_field :reference cache_markdown_field :reference
belongs_to :user
belongs_to :issue belongs_to :issue
belongs_to :merge_request belongs_to :merge_request
belongs_to :label belongs_to :label
scope :created_after, ->(time) { where('created_at > ?', time) }
scope :inc_relations, -> { includes(:label, :user) } scope :inc_relations, -> { includes(:label, :user) }
validates :user, presence: { unless: :importing? }, on: :create
validates :label, presence: { unless: :importing? }, on: :create validates :label, presence: { unless: :importing? }, on: :create
validate :exactly_one_issuable
after_save :expire_etag_cache after_save :expire_etag_cache
after_destroy :expire_etag_cache after_destroy :expire_etag_cache
...@@ -94,22 +91,6 @@ class ResourceLabelEvent < ApplicationRecord ...@@ -94,22 +91,6 @@ class ResourceLabelEvent < ApplicationRecord
end end
end end
def exactly_one_issuable
issuable_count = self.class.issuable_attrs.count { |attr| self["#{attr}_id"] }
return true if issuable_count == 1
# if none of issuable IDs is set, check explicitly if nested issuable
# object is set, this is used during project import
if issuable_count == 0 && importing?
issuable_count = self.class.issuable_attrs.count { |attr| self.public_send(attr) } # rubocop:disable GitlabSecurity/PublicSend
return true if issuable_count == 1
end
errors.add(:base, "Exactly one of #{self.class.issuable_attrs.join(', ')} is required")
end
def expire_etag_cache def expire_etag_cache
issuable.expire_note_etag_cache issuable.expire_note_etag_cache
end end
......
# frozen_string_literal: true
class ResourceMilestoneEvent < ApplicationRecord
include Gitlab::Utils::StrongMemoize
include Importable
include ResourceEventTools
belongs_to :issue
belongs_to :merge_request
belongs_to :milestone
scope :by_issue, ->(issue) { where(issue_id: issue.id) }
scope :by_merge_request, ->(merge_request) { where(merge_request_id: merge_request.id) }
enum action: {
add: 1,
remove: 2
}
# state is used for issue and merge request states.
enum state: Issue.available_states.merge(MergeRequest.available_states)
def self.issuable_attrs
%i(issue merge_request).freeze
end
def resource
issue || merge_request
end
end
...@@ -19,6 +19,7 @@ module Issuable ...@@ -19,6 +19,7 @@ module Issuable
copy_resource_label_events copy_resource_label_events
copy_resource_weight_events copy_resource_weight_events
copy_resource_milestone_events
end end
private private
...@@ -65,6 +66,23 @@ module Issuable ...@@ -65,6 +66,23 @@ module Issuable
end end
end end
def copy_resource_milestone_events
entity_key = new_entity.class.name.underscore.foreign_key
copy_events(ResourceMilestoneEvent.table_name, original_entity.resource_milestone_events) do |event|
matching_destination_milestone = matching_milestone(event.milestone.title)
if matching_destination_milestone.present?
event.attributes
.except('id', 'reference', 'reference_html')
.merge(entity_key => new_entity.id,
'milestone_id' => matching_destination_milestone.id,
'action' => ResourceMilestoneEvent.actions[event.action],
'state' => ResourceMilestoneEvent.states[event.state])
end
end
end
def copy_events(table_name, events_to_copy) def copy_events(table_name, events_to_copy)
events_to_copy.find_in_batches do |batch| events_to_copy.find_in_batches do |batch|
events = batch.map do |event| events = batch.map do |event|
......
...@@ -22,13 +22,17 @@ module Issuable ...@@ -22,13 +22,17 @@ module Issuable
end end
create_due_date_note if issuable.previous_changes.include?('due_date') create_due_date_note if issuable.previous_changes.include?('due_date')
create_milestone_note if issuable.previous_changes.include?('milestone_id') create_milestone_note if has_milestone_changes?
create_labels_note(old_labels) if old_labels && issuable.labels != old_labels create_labels_note(old_labels) if old_labels && issuable.labels != old_labels
end end
end end
private private
def has_milestone_changes?
issuable.previous_changes.include?('milestone_id')
end
def handle_time_tracking_note def handle_time_tracking_note
if issuable.previous_changes.include?('time_estimate') if issuable.previous_changes.include?('time_estimate')
create_time_estimate_note create_time_estimate_note
...@@ -95,7 +99,16 @@ module Issuable ...@@ -95,7 +99,16 @@ module Issuable
end end
def create_milestone_note def create_milestone_note
SystemNoteService.change_milestone(issuable, issuable.project, current_user, issuable.milestone) if milestone_changes_tracking_enabled?
# Creates a synthetic note
ResourceEvents::ChangeMilestoneService.new(resource: issuable, user: current_user).execute
else
SystemNoteService.change_milestone(issuable, issuable.project, current_user, issuable.milestone)
end
end
def milestone_changes_tracking_enabled?
::Feature.enabled?(:track_resource_milestone_change_events, issuable.project)
end end
def create_due_date_note def create_due_date_note
......
# frozen_string_literal: true
module ResourceEvents
class ChangeMilestoneService
attr_reader :resource, :user, :event_created_at, :resource_args
def initialize(resource:, user:, created_at: Time.now)
@resource = resource
@user = user
@event_created_at = created_at
@resource_args = {
user_id: user.id,
created_at: event_created_at
}
end
def execute
args = build_resource_args
action = if milestone.nil?
:remove
else
:add
end
record = args.merge(milestone_id: milestone&.id, action: ResourceMilestoneEvent.actions[action])
create_event(record)
end
private
def milestone
resource&.milestone
end
def create_event(record)
ResourceMilestoneEvent.create(record)
resource.expire_note_etag_cache
end
def build_resource_args
key = resource.class.name.underscore.foreign_key
resource_args.merge(key => resource.id, state: ResourceMilestoneEvent.states[resource.state])
end
end
end
...@@ -9,6 +9,11 @@ module ResourceEvents ...@@ -9,6 +9,11 @@ module ResourceEvents
class MergeIntoNotesService class MergeIntoNotesService
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
SYNTHETIC_NOTE_BUILDER_SERVICES = [
SyntheticLabelNotesBuilderService,
SyntheticMilestoneNotesBuilderService
].freeze
attr_reader :resource, :current_user, :params attr_reader :resource, :current_user, :params
def initialize(resource, current_user, params = {}) def initialize(resource, current_user, params = {})
...@@ -24,7 +29,9 @@ module ResourceEvents ...@@ -24,7 +29,9 @@ module ResourceEvents
private private
def synthetic_notes def synthetic_notes
SyntheticLabelNotesBuilderService.new(resource, current_user, params).execute SYNTHETIC_NOTE_BUILDER_SERVICES.flat_map do |service|
service.new(resource, current_user, params).execute
end
end end
end end
end end
......
# frozen_string_literal: true
# We store events about resource milestone changes in a separate table,
# but we still want to display notes about milestone changes
# as classic system notes in UI. This service generates "synthetic" notes for
# milestone event changes.
module ResourceEvents
class SyntheticMilestoneNotesBuilderService < BaseSyntheticNotesBuilderService
private
def synthetic_notes
return [] unless tracking_enabled?
milestone_change_events.map do |event|
MilestoneNote.from_event(event, resource: resource, resource_parent: resource_parent)
end
end
def milestone_change_events
return [] unless resource.respond_to?(:resource_milestone_events)
events = resource.resource_milestone_events.includes(user: :status) # rubocop: disable CodeReuse/ActiveRecord
since_fetch_at(events)
end
def tracking_enabled?
::Feature.enabled?(:track_resource_milestone_change_events, resource.project)
end
end
end
...@@ -48,14 +48,14 @@ ...@@ -48,14 +48,14 @@
- if todo.pending? - if todo.pending?
.todo-actions .todo-actions
= link_to dashboard_todo_path(todo), method: :delete, class: 'btn btn-loading js-done-todo', data: { href: dashboard_todo_path(todo) } do = link_to dashboard_todo_path(todo), method: :delete, class: 'btn btn-loading d-flex align-items-center js-done-todo', data: { href: dashboard_todo_path(todo) } do
Done Done
= icon('spinner spin') %span.spinner.ml-1
= link_to restore_dashboard_todo_path(todo), method: :patch, class: 'btn btn-loading js-undo-todo hidden', data: { href: restore_dashboard_todo_path(todo) } do = link_to restore_dashboard_todo_path(todo), method: :patch, class: 'btn btn-loading d-flex align-items-center js-undo-todo hidden', data: { href: restore_dashboard_todo_path(todo) } do
Undo Undo
= icon('spinner spin') %span.spinner.ml-1
- else - else
.todo-actions .todo-actions
= link_to restore_dashboard_todo_path(todo), method: :patch, class: 'btn btn-loading js-add-todo', data: { href: restore_dashboard_todo_path(todo) } do = link_to restore_dashboard_todo_path(todo), method: :patch, class: 'btn btn-loading d-flex align-items-center js-add-todo', data: { href: restore_dashboard_todo_path(todo) } do
Add a To Do Add a To Do
= icon('spinner spin') %span.spinner.ml-1
...@@ -26,12 +26,12 @@ ...@@ -26,12 +26,12 @@
.nav-controls .nav-controls
- if @todos.any?(&:pending?) - if @todos.any?(&:pending?)
.append-right-default .append-right-default
= link_to destroy_all_dashboard_todos_path(todos_filter_params), class: 'btn btn-loading js-todos-mark-all', method: :delete, data: { href: destroy_all_dashboard_todos_path(todos_filter_params) } do = link_to destroy_all_dashboard_todos_path(todos_filter_params), class: 'btn btn-loading d-flex align-items-center js-todos-mark-all', method: :delete, data: { href: destroy_all_dashboard_todos_path(todos_filter_params) } do
Mark all as done Mark all as done
= icon('spinner spin') %span.spinner.ml-1
= link_to bulk_restore_dashboard_todos_path, class: 'btn btn-loading js-todos-undo-all hidden', method: :patch , data: { href: bulk_restore_dashboard_todos_path(todos_filter_params) } do = link_to bulk_restore_dashboard_todos_path, class: 'btn btn-loading d-flex align-items-center js-todos-undo-all hidden', method: :patch , data: { href: bulk_restore_dashboard_todos_path(todos_filter_params) } do
Undo mark all as done Undo mark all as done
= icon('spinner spin') %span.spinner.ml-1
.todos-filters .todos-filters
.issues-details-filters.row-content-block.second-block .issues-details-filters.row-content-block.second-block
......
# frozen_string_literal: true # frozen_string_literal: true
class AdminEmailWorker class AdminEmailWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
# rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context # This worker does not perform work scoped to a context
......
...@@ -9,1077 +9,1257 @@ ...@@ -9,1077 +9,1257 @@
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: auto_merge:auto_merge_process - :name: auto_merge:auto_merge_process
:feature_category: :continuous_delivery :feature_category: :continuous_delivery
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 3 :weight: 3
:idempotent:
- :name: chaos:chaos_cpu_spin - :name: chaos:chaos_cpu_spin
:feature_category: :chaos_engineering :feature_category: :chaos_engineering
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: chaos:chaos_db_spin - :name: chaos:chaos_db_spin
:feature_category: :chaos_engineering :feature_category: :chaos_engineering
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: chaos:chaos_kill - :name: chaos:chaos_kill
:feature_category: :chaos_engineering :feature_category: :chaos_engineering
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: chaos:chaos_leak_mem - :name: chaos:chaos_leak_mem
:feature_category: :chaos_engineering :feature_category: :chaos_engineering
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: chaos:chaos_sleep - :name: chaos:chaos_sleep
:feature_category: :chaos_engineering :feature_category: :chaos_engineering
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: container_repository:cleanup_container_repository - :name: container_repository:cleanup_container_repository
:feature_category: :container_registry :feature_category: :container_registry
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: container_repository:delete_container_repository - :name: container_repository:delete_container_repository
:feature_category: :container_registry :feature_category: :container_registry
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:admin_email - :name: cronjob:admin_email
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:ci_archive_traces_cron - :name: cronjob:ci_archive_traces_cron
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:container_expiration_policy - :name: cronjob:container_expiration_policy
:feature_category: :container_registry :feature_category: :container_registry
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:environments_auto_stop_cron - :name: cronjob:environments_auto_stop_cron
:feature_category: :continuous_delivery :feature_category: :continuous_delivery
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:expire_build_artifacts - :name: cronjob:expire_build_artifacts
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:gitlab_usage_ping - :name: cronjob:gitlab_usage_ping
:feature_category: :collection :feature_category: :collection
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:import_export_project_cleanup - :name: cronjob:import_export_project_cleanup
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:issue_due_scheduler - :name: cronjob:issue_due_scheduler
:feature_category: :issue_tracking :feature_category: :issue_tracking
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:namespaces_prune_aggregation_schedules - :name: cronjob:namespaces_prune_aggregation_schedules
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:pages_domain_removal_cron - :name: cronjob:pages_domain_removal_cron
:feature_category: :pages :feature_category: :pages
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:pages_domain_ssl_renewal_cron - :name: cronjob:pages_domain_ssl_renewal_cron
:feature_category: :pages :feature_category: :pages
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:pages_domain_verification_cron - :name: cronjob:pages_domain_verification_cron
:feature_category: :pages :feature_category: :pages
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:personal_access_tokens_expiring - :name: cronjob:personal_access_tokens_expiring
:feature_category: :authentication_and_authorization :feature_category: :authentication_and_authorization
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:pipeline_schedule - :name: cronjob:pipeline_schedule
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:prune_old_events - :name: cronjob:prune_old_events
:feature_category: :users :feature_category: :users
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:prune_web_hook_logs - :name: cronjob:prune_web_hook_logs
:feature_category: :integrations :feature_category: :integrations
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:remove_expired_group_links - :name: cronjob:remove_expired_group_links
:feature_category: :authentication_and_authorization :feature_category: :authentication_and_authorization
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:remove_expired_members - :name: cronjob:remove_expired_members
:feature_category: :authentication_and_authorization :feature_category: :authentication_and_authorization
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:remove_unreferenced_lfs_objects - :name: cronjob:remove_unreferenced_lfs_objects
:feature_category: :git_lfs :feature_category: :git_lfs
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:repository_archive_cache - :name: cronjob:repository_archive_cache
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:repository_check_dispatch - :name: cronjob:repository_check_dispatch
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:requests_profiles - :name: cronjob:requests_profiles
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:schedule_migrate_external_diffs - :name: cronjob:schedule_migrate_external_diffs
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:stuck_ci_jobs - :name: cronjob:stuck_ci_jobs
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:stuck_import_jobs - :name: cronjob:stuck_import_jobs
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:stuck_merge_jobs - :name: cronjob:stuck_merge_jobs
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: cronjob:trending_projects - :name: cronjob:trending_projects
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: deployment:deployments_finished - :name: deployment:deployments_finished
:feature_category: :continuous_delivery :feature_category: :continuous_delivery
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 3 :weight: 3
:idempotent:
- :name: deployment:deployments_forward_deployment - :name: deployment:deployments_forward_deployment
:feature_category: :continuous_delivery :feature_category: :continuous_delivery
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 3 :weight: 3
:idempotent:
- :name: deployment:deployments_success - :name: deployment:deployments_success
:feature_category: :continuous_delivery :feature_category: :continuous_delivery
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 3 :weight: 3
:idempotent:
- :name: gcp_cluster:cluster_configure - :name: gcp_cluster:cluster_configure
:feature_category: :kubernetes_management :feature_category: :kubernetes_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: gcp_cluster:cluster_configure_istio - :name: gcp_cluster:cluster_configure_istio
:feature_category: :kubernetes_management :feature_category: :kubernetes_management
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: gcp_cluster:cluster_install_app - :name: gcp_cluster:cluster_install_app
:feature_category: :kubernetes_management :feature_category: :kubernetes_management
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: gcp_cluster:cluster_patch_app - :name: gcp_cluster:cluster_patch_app
:feature_category: :kubernetes_management :feature_category: :kubernetes_management
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: gcp_cluster:cluster_project_configure - :name: gcp_cluster:cluster_project_configure
:feature_category: :kubernetes_management :feature_category: :kubernetes_management
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: gcp_cluster:cluster_provision - :name: gcp_cluster:cluster_provision
:feature_category: :kubernetes_management :feature_category: :kubernetes_management
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: gcp_cluster:cluster_upgrade_app - :name: gcp_cluster:cluster_upgrade_app
:feature_category: :kubernetes_management :feature_category: :kubernetes_management
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: gcp_cluster:cluster_wait_for_app_installation - :name: gcp_cluster:cluster_wait_for_app_installation
:feature_category: :kubernetes_management :feature_category: :kubernetes_management
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 1 :weight: 1
:idempotent:
- :name: gcp_cluster:cluster_wait_for_ingress_ip_address - :name: gcp_cluster:cluster_wait_for_ingress_ip_address
:feature_category: :kubernetes_management :feature_category: :kubernetes_management
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: gcp_cluster:clusters_applications_activate_service - :name: gcp_cluster:clusters_applications_activate_service
:feature_category: :kubernetes_management :feature_category: :kubernetes_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: gcp_cluster:clusters_applications_deactivate_service - :name: gcp_cluster:clusters_applications_deactivate_service
:feature_category: :kubernetes_management :feature_category: :kubernetes_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: gcp_cluster:clusters_applications_uninstall - :name: gcp_cluster:clusters_applications_uninstall
:feature_category: :kubernetes_management :feature_category: :kubernetes_management
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: gcp_cluster:clusters_applications_wait_for_uninstall_app - :name: gcp_cluster:clusters_applications_wait_for_uninstall_app
:feature_category: :kubernetes_management :feature_category: :kubernetes_management
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 1 :weight: 1
:idempotent:
- :name: gcp_cluster:clusters_cleanup_app - :name: gcp_cluster:clusters_cleanup_app
:feature_category: :kubernetes_management :feature_category: :kubernetes_management
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: gcp_cluster:clusters_cleanup_project_namespace - :name: gcp_cluster:clusters_cleanup_project_namespace
:feature_category: :kubernetes_management :feature_category: :kubernetes_management
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: gcp_cluster:clusters_cleanup_service_account - :name: gcp_cluster:clusters_cleanup_service_account
:feature_category: :kubernetes_management :feature_category: :kubernetes_management
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: gcp_cluster:wait_for_cluster_creation - :name: gcp_cluster:wait_for_cluster_creation
:feature_category: :kubernetes_management :feature_category: :kubernetes_management
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: github_importer:github_import_import_diff_note - :name: github_importer:github_import_import_diff_note
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: github_importer:github_import_import_issue - :name: github_importer:github_import_import_issue
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: github_importer:github_import_import_lfs_object - :name: github_importer:github_import_import_lfs_object
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: github_importer:github_import_import_note - :name: github_importer:github_import_import_note
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: github_importer:github_import_import_pull_request - :name: github_importer:github_import_import_pull_request
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: github_importer:github_import_refresh_import_jid - :name: github_importer:github_import_refresh_import_jid
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: github_importer:github_import_stage_finish_import - :name: github_importer:github_import_stage_finish_import
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: github_importer:github_import_stage_import_base_data - :name: github_importer:github_import_stage_import_base_data
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: github_importer:github_import_stage_import_issues_and_diff_notes - :name: github_importer:github_import_stage_import_issues_and_diff_notes
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: github_importer:github_import_stage_import_lfs_objects - :name: github_importer:github_import_stage_import_lfs_objects
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: github_importer:github_import_stage_import_notes - :name: github_importer:github_import_stage_import_notes
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: github_importer:github_import_stage_import_pull_requests - :name: github_importer:github_import_stage_import_pull_requests
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: github_importer:github_import_stage_import_repository - :name: github_importer:github_import_stage_import_repository
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: hashed_storage:hashed_storage_migrator - :name: hashed_storage:hashed_storage_migrator
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: hashed_storage:hashed_storage_project_migrate - :name: hashed_storage:hashed_storage_project_migrate
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: hashed_storage:hashed_storage_project_rollback - :name: hashed_storage:hashed_storage_project_rollback
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: hashed_storage:hashed_storage_rollbacker - :name: hashed_storage:hashed_storage_rollbacker
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: incident_management:incident_management_process_alert - :name: incident_management:incident_management_process_alert
:feature_category: :incident_management :feature_category: :incident_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: mail_scheduler:mail_scheduler_issue_due - :name: mail_scheduler:mail_scheduler_issue_due
:feature_category: :issue_tracking :feature_category: :issue_tracking
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: mail_scheduler:mail_scheduler_notification_service - :name: mail_scheduler:mail_scheduler_notification_service
:feature_category: :issue_tracking :feature_category: :issue_tracking
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 2 :weight: 2
:idempotent:
- :name: notifications:new_release - :name: notifications:new_release
:feature_category: :release_orchestration :feature_category: :release_orchestration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: object_pool:object_pool_create - :name: object_pool:object_pool_create
:feature_category: :gitaly :feature_category: :gitaly
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: object_pool:object_pool_destroy - :name: object_pool:object_pool_destroy
:feature_category: :gitaly :feature_category: :gitaly
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: object_pool:object_pool_join - :name: object_pool:object_pool_join
:feature_category: :gitaly :feature_category: :gitaly
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 1 :weight: 1
:idempotent:
- :name: object_pool:object_pool_schedule_join - :name: object_pool:object_pool_schedule_join
:feature_category: :gitaly :feature_category: :gitaly
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: object_storage:object_storage_background_move - :name: object_storage:object_storage_background_move
:feature_category: :not_owned :feature_category: :not_owned
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: object_storage:object_storage_migrate_uploads - :name: object_storage:object_storage_migrate_uploads
:feature_category: :not_owned :feature_category: :not_owned
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: pipeline_background:archive_trace - :name: pipeline_background:archive_trace
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: pipeline_background:ci_build_trace_chunk_flush - :name: pipeline_background:ci_build_trace_chunk_flush
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: pipeline_cache:expire_job_cache - :name: pipeline_cache:expire_job_cache
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 3 :weight: 3
:idempotent: true
- :name: pipeline_cache:expire_pipeline_cache - :name: pipeline_cache:expire_pipeline_cache
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 3 :weight: 3
:idempotent:
- :name: pipeline_creation:create_pipeline - :name: pipeline_creation:create_pipeline
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 4 :weight: 4
:idempotent:
- :name: pipeline_creation:run_pipeline_schedule - :name: pipeline_creation:run_pipeline_schedule
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 4 :weight: 4
:idempotent:
- :name: pipeline_default:build_coverage - :name: pipeline_default:build_coverage
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 3 :weight: 3
:idempotent:
- :name: pipeline_default:build_trace_sections - :name: pipeline_default:build_trace_sections
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 3 :weight: 3
:idempotent:
- :name: pipeline_default:ci_create_cross_project_pipeline - :name: pipeline_default:ci_create_cross_project_pipeline
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 3 :weight: 3
:idempotent:
- :name: pipeline_default:ci_pipeline_bridge_status - :name: pipeline_default:ci_pipeline_bridge_status
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 3 :weight: 3
:idempotent:
- :name: pipeline_default:pipeline_metrics - :name: pipeline_default:pipeline_metrics
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 3 :weight: 3
:idempotent:
- :name: pipeline_default:pipeline_notification - :name: pipeline_default:pipeline_notification
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 3 :weight: 3
:idempotent:
- :name: pipeline_hooks:build_hooks - :name: pipeline_hooks:build_hooks
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: pipeline_hooks:pipeline_hooks - :name: pipeline_hooks:pipeline_hooks
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 2 :weight: 2
:idempotent:
- :name: pipeline_processing:build_finished - :name: pipeline_processing:build_finished
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 5 :weight: 5
:idempotent:
- :name: pipeline_processing:build_queue - :name: pipeline_processing:build_queue
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 5 :weight: 5
:idempotent:
- :name: pipeline_processing:build_success - :name: pipeline_processing:build_success
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 5 :weight: 5
:idempotent:
- :name: pipeline_processing:ci_build_prepare - :name: pipeline_processing:ci_build_prepare
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 5 :weight: 5
:idempotent:
- :name: pipeline_processing:ci_build_schedule - :name: pipeline_processing:ci_build_schedule
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 5 :weight: 5
:idempotent:
- :name: pipeline_processing:ci_resource_groups_assign_resource_from_resource_group - :name: pipeline_processing:ci_resource_groups_assign_resource_from_resource_group
:feature_category: :continuous_delivery :feature_category: :continuous_delivery
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 5 :weight: 5
:idempotent:
- :name: pipeline_processing:pipeline_process - :name: pipeline_processing:pipeline_process
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 5 :weight: 5
:idempotent:
- :name: pipeline_processing:pipeline_success - :name: pipeline_processing:pipeline_success
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 5 :weight: 5
:idempotent:
- :name: pipeline_processing:pipeline_update - :name: pipeline_processing:pipeline_update
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 5 :weight: 5
:idempotent:
- :name: pipeline_processing:stage_update - :name: pipeline_processing:stage_update
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 5 :weight: 5
:idempotent:
- :name: pipeline_processing:update_head_pipeline_for_merge_request - :name: pipeline_processing:update_head_pipeline_for_merge_request
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 5 :weight: 5
:idempotent:
- :name: repository_check:repository_check_batch - :name: repository_check:repository_check_batch
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: repository_check:repository_check_clear - :name: repository_check:repository_check_clear
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: repository_check:repository_check_single_repository - :name: repository_check:repository_check_single_repository
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: todos_destroyer:todos_destroyer_confidential_issue - :name: todos_destroyer:todos_destroyer_confidential_issue
:feature_category: :issue_tracking :feature_category: :issue_tracking
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: todos_destroyer:todos_destroyer_entity_leave - :name: todos_destroyer:todos_destroyer_entity_leave
:feature_category: :issue_tracking :feature_category: :issue_tracking
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: todos_destroyer:todos_destroyer_group_private - :name: todos_destroyer:todos_destroyer_group_private
:feature_category: :issue_tracking :feature_category: :issue_tracking
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: todos_destroyer:todos_destroyer_private_features - :name: todos_destroyer:todos_destroyer_private_features
:feature_category: :issue_tracking :feature_category: :issue_tracking
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: todos_destroyer:todos_destroyer_project_private - :name: todos_destroyer:todos_destroyer_project_private
:feature_category: :issue_tracking :feature_category: :issue_tracking
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: update_namespace_statistics:namespaces_root_statistics - :name: update_namespace_statistics:namespaces_root_statistics
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: update_namespace_statistics:namespaces_schedule_aggregation - :name: update_namespace_statistics:namespaces_schedule_aggregation
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: authorized_projects - :name: authorized_projects
:feature_category: :authentication_and_authorization :feature_category: :authentication_and_authorization
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: background_migration - :name: background_migration
:feature_category: :not_owned :feature_category: :not_owned
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: chat_notification - :name: chat_notification
:feature_category: :chatops :feature_category: :chatops
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: create_commit_signature - :name: create_commit_signature
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: create_evidence - :name: create_evidence
:feature_category: :release_governance :feature_category: :release_governance
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: create_note_diff_file - :name: create_note_diff_file
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: default - :name: default
:feature_category: :feature_category:
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :resource_boundary:
:weight: 1 :weight: 1
:idempotent:
- :name: delete_diff_files - :name: delete_diff_files
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: delete_merged_branches - :name: delete_merged_branches
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: delete_stored_files - :name: delete_stored_files
:feature_category: :not_owned :feature_category: :not_owned
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: delete_user - :name: delete_user
:feature_category: :authentication_and_authorization :feature_category: :authentication_and_authorization
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: detect_repository_languages - :name: detect_repository_languages
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: email_receiver - :name: email_receiver
:feature_category: :issue_tracking :feature_category: :issue_tracking
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: emails_on_push - :name: emails_on_push
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 2 :weight: 2
:idempotent:
- :name: error_tracking_issue_link - :name: error_tracking_issue_link
:feature_category: :error_tracking :feature_category: :error_tracking
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: expire_build_instance_artifacts - :name: expire_build_instance_artifacts
:feature_category: :continuous_integration :feature_category: :continuous_integration
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: file_hook - :name: file_hook
:feature_category: :integrations :feature_category: :integrations
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: git_garbage_collect - :name: git_garbage_collect
:feature_category: :gitaly :feature_category: :gitaly
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: github_import_advance_stage - :name: github_import_advance_stage
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: gitlab_shell - :name: gitlab_shell
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: group_destroy - :name: group_destroy
:feature_category: :subgroups :feature_category: :subgroups
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: group_export - :name: group_export
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: group_import - :name: group_import
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: import_issues_csv - :name: import_issues_csv
:feature_category: :issue_tracking :feature_category: :issue_tracking
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 2 :weight: 2
:idempotent:
- :name: invalid_gpg_signature_update - :name: invalid_gpg_signature_update
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: irker - :name: irker
:feature_category: :integrations :feature_category: :integrations
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: mailers - :name: mailers
:feature_category: :feature_category:
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :resource_boundary:
:weight: 2 :weight: 2
:idempotent:
- :name: merge - :name: merge
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 5 :weight: 5
:idempotent:
- :name: merge_request_mergeability_check - :name: merge_request_mergeability_check
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: migrate_external_diffs - :name: migrate_external_diffs
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: namespaceless_project_destroy - :name: namespaceless_project_destroy
:feature_category: :authentication_and_authorization :feature_category: :authentication_and_authorization
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: new_issue - :name: new_issue
:feature_category: :issue_tracking :feature_category: :issue_tracking
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 2 :weight: 2
:idempotent:
- :name: new_merge_request - :name: new_merge_request
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 2 :weight: 2
:idempotent:
- :name: new_note - :name: new_note
:feature_category: :issue_tracking :feature_category: :issue_tracking
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 2 :weight: 2
:idempotent:
- :name: pages - :name: pages
:feature_category: :pages :feature_category: :pages
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: pages_domain_ssl_renewal - :name: pages_domain_ssl_renewal
:feature_category: :pages :feature_category: :pages
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: pages_domain_verification - :name: pages_domain_verification
:feature_category: :pages :feature_category: :pages
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: phabricator_import_import_tasks - :name: phabricator_import_import_tasks
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: post_receive - :name: post_receive
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 5 :weight: 5
:idempotent:
- :name: process_commit - :name: process_commit
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 3 :weight: 3
:idempotent:
- :name: project_cache - :name: project_cache
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: project_daily_statistics - :name: project_daily_statistics
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: project_destroy - :name: project_destroy
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: project_export - :name: project_export
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :memory :resource_boundary: :memory
:weight: 1 :weight: 1
:idempotent:
- :name: project_service - :name: project_service
:feature_category: :integrations :feature_category: :integrations
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: propagate_service_template - :name: propagate_service_template
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: reactive_caching - :name: reactive_caching
:feature_category: :not_owned :feature_category: :not_owned
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 1 :weight: 1
:idempotent:
- :name: rebase - :name: rebase
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: remote_mirror_notification - :name: remote_mirror_notification
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: repository_cleanup - :name: repository_cleanup
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: repository_fork - :name: repository_fork
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: repository_import - :name: repository_import
:feature_category: :importers :feature_category: :importers
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: repository_remove_remote - :name: repository_remove_remote
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: repository_update_remote_mirror - :name: repository_update_remote_mirror
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: self_monitoring_project_create - :name: self_monitoring_project_create
:feature_category: :metrics :feature_category: :metrics
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: self_monitoring_project_delete - :name: self_monitoring_project_delete
:feature_category: :metrics :feature_category: :metrics
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 2 :weight: 2
:idempotent:
- :name: system_hook_push - :name: system_hook_push
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: update_external_pull_requests - :name: update_external_pull_requests
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 3 :weight: 3
:idempotent:
- :name: update_merge_requests - :name: update_merge_requests
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: true :latency_sensitive: true
:resource_boundary: :cpu :resource_boundary: :cpu
:weight: 3 :weight: 3
:idempotent:
- :name: update_project_statistics - :name: update_project_statistics
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: upload_checksum - :name: upload_checksum
:feature_category: :geo_replication :feature_category: :geo_replication
:has_external_dependencies: :has_external_dependencies:
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
- :name: web_hook - :name: web_hook
:feature_category: :integrations :feature_category: :integrations
:has_external_dependencies: true :has_external_dependencies: true
:latency_sensitive: :latency_sensitive:
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 1 :weight: 1
:idempotent:
# frozen_string_literal: true # frozen_string_literal: true
class ArchiveTraceWorker class ArchiveTraceWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineBackgroundQueue include PipelineBackgroundQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class AuthorizedProjectsWorker class AuthorizedProjectsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
prepend WaitableWorker prepend WaitableWorker
......
# frozen_string_literal: true # frozen_string_literal: true
module AutoDevops module AutoDevops
class DisableWorker class DisableWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include AutoDevopsQueue include AutoDevopsQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class AutoMergeProcessWorker class AutoMergeProcessWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
queue_namespace :auto_merge queue_namespace :auto_merge
......
# frozen_string_literal: true # frozen_string_literal: true
class BackgroundMigrationWorker class BackgroundMigrationWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category_not_owned! feature_category_not_owned!
...@@ -22,17 +22,19 @@ class BackgroundMigrationWorker ...@@ -22,17 +22,19 @@ class BackgroundMigrationWorker
# class_name - The class name of the background migration to run. # class_name - The class name of the background migration to run.
# arguments - The arguments to pass to the migration class. # arguments - The arguments to pass to the migration class.
def perform(class_name, arguments = []) def perform(class_name, arguments = [])
should_perform, ttl = perform_and_ttl(class_name) with_context(caller_id: class_name.to_s) do
should_perform, ttl = perform_and_ttl(class_name)
if should_perform if should_perform
Gitlab::BackgroundMigration.perform(class_name, arguments) Gitlab::BackgroundMigration.perform(class_name, arguments)
else else
# If the lease could not be obtained this means either another process is # If the lease could not be obtained this means either another process is
# running a migration of this class or we ran one recently. In this case # running a migration of this class or we ran one recently. In this case
# we'll reschedule the job in such a way that it is picked up again around # we'll reschedule the job in such a way that it is picked up again around
# the time the lease expires. # the time the lease expires.
self.class self.class
.perform_in(ttl || self.class.minimum_interval, class_name, arguments) .perform_in(ttl || self.class.minimum_interval, class_name, arguments)
end
end end
end end
......
# frozen_string_literal: true # frozen_string_literal: true
class BuildCoverageWorker class BuildCoverageWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class BuildFinishedWorker class BuildFinishedWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class BuildHooksWorker class BuildHooksWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class BuildQueueWorker class BuildQueueWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class BuildSuccessWorker class BuildSuccessWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class BuildTraceSectionsWorker class BuildTraceSectionsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module Chaos module Chaos
class CpuSpinWorker class CpuSpinWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ChaosQueue include ChaosQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module Chaos module Chaos
class DbSpinWorker class DbSpinWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ChaosQueue include ChaosQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module Chaos module Chaos
class KillWorker class KillWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ChaosQueue include ChaosQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module Chaos module Chaos
class LeakMemWorker class LeakMemWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ChaosQueue include ChaosQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module Chaos module Chaos
class SleepWorker class SleepWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ChaosQueue include ChaosQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class ChatNotificationWorker class ChatNotificationWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
TimeoutExceeded = Class.new(StandardError) TimeoutExceeded = Class.new(StandardError)
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class ArchiveTracesCronWorker class ArchiveTracesCronWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class BuildPrepareWorker class BuildPrepareWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class BuildScheduleWorker class BuildScheduleWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class BuildTraceChunkFlushWorker class BuildTraceChunkFlushWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineBackgroundQueue include PipelineBackgroundQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class CreateCrossProjectPipelineWorker class CreateCrossProjectPipelineWorker # rubocop:disable Scalability/IdempotentWorker
include ::ApplicationWorker include ::ApplicationWorker
include ::PipelineQueue include ::PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module Ci module Ci
class PipelineBridgeStatusWorker class PipelineBridgeStatusWorker # rubocop:disable Scalability/IdempotentWorker
include ::ApplicationWorker include ::ApplicationWorker
include ::PipelineQueue include ::PipelineQueue
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Ci module Ci
module ResourceGroups module ResourceGroups
class AssignResourceFromResourceGroupWorker class AssignResourceFromResourceGroupWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class CleanupContainerRepositoryWorker class CleanupContainerRepositoryWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
queue_namespace :container_repository queue_namespace :container_repository
......
# frozen_string_literal: true # frozen_string_literal: true
class ClusterConfigureIstioWorker class ClusterConfigureIstioWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ClusterQueue include ClusterQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class ClusterConfigureWorker class ClusterConfigureWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ClusterQueue include ClusterQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class ClusterInstallAppWorker class ClusterInstallAppWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ClusterQueue include ClusterQueue
include ClusterApplications include ClusterApplications
......
# frozen_string_literal: true # frozen_string_literal: true
class ClusterPatchAppWorker class ClusterPatchAppWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ClusterQueue include ClusterQueue
include ClusterApplications include ClusterApplications
......
# frozen_string_literal: true # frozen_string_literal: true
class ClusterProjectConfigureWorker class ClusterProjectConfigureWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ClusterQueue include ClusterQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class ClusterProvisionWorker class ClusterProvisionWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ClusterQueue include ClusterQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class ClusterUpgradeAppWorker class ClusterUpgradeAppWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ClusterQueue include ClusterQueue
include ClusterApplications include ClusterApplications
......
# frozen_string_literal: true # frozen_string_literal: true
class ClusterWaitForAppInstallationWorker class ClusterWaitForAppInstallationWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ClusterQueue include ClusterQueue
include ClusterApplications include ClusterApplications
......
# frozen_string_literal: true # frozen_string_literal: true
class ClusterWaitForIngressIpAddressWorker class ClusterWaitForIngressIpAddressWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ClusterQueue include ClusterQueue
include ClusterApplications include ClusterApplications
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Clusters module Clusters
module Applications module Applications
class ActivateServiceWorker class ActivateServiceWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ClusterQueue include ClusterQueue
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Clusters module Clusters
module Applications module Applications
class DeactivateServiceWorker class DeactivateServiceWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ClusterQueue include ClusterQueue
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Clusters module Clusters
module Applications module Applications
class UninstallWorker class UninstallWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ClusterQueue include ClusterQueue
include ClusterApplications include ClusterApplications
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Clusters module Clusters
module Applications module Applications
class WaitForUninstallAppWorker class WaitForUninstallAppWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ClusterQueue include ClusterQueue
include ClusterApplications include ClusterApplications
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Clusters module Clusters
module Cleanup module Cleanup
class AppWorker class AppWorker # rubocop:disable Scalability/IdempotentWorker
include ClusterCleanupMethods include ClusterCleanupMethods
def perform(cluster_id, execution_count = 0) def perform(cluster_id, execution_count = 0)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Clusters module Clusters
module Cleanup module Cleanup
class ProjectNamespaceWorker class ProjectNamespaceWorker # rubocop:disable Scalability/IdempotentWorker
include ClusterCleanupMethods include ClusterCleanupMethods
def perform(cluster_id, execution_count = 0) def perform(cluster_id, execution_count = 0)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Clusters module Clusters
module Cleanup module Cleanup
class ServiceAccountWorker class ServiceAccountWorker # rubocop:disable Scalability/IdempotentWorker
include ClusterCleanupMethods include ClusterCleanupMethods
def perform(cluster_id) def perform(cluster_id)
......
...@@ -89,6 +89,14 @@ module WorkerAttributes ...@@ -89,6 +89,14 @@ module WorkerAttributes
worker_attributes[:resource_boundary] || :unknown worker_attributes[:resource_boundary] || :unknown
end end
def idempotent!
worker_attributes[:idempotent] = true
end
def idempotent?
worker_attributes[:idempotent]
end
def weight(value) def weight(value)
worker_attributes[:weight] = value worker_attributes[:weight] = value
end end
......
# frozen_string_literal: true # frozen_string_literal: true
class ContainerExpirationPolicyWorker class ContainerExpirationPolicyWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue include CronjobQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class CreateCommitSignatureWorker class CreateCommitSignatureWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
# frozen_string_literal: true # frozen_string_literal: true
class CreateEvidenceWorker class CreateEvidenceWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :release_governance feature_category :release_governance
......
# frozen_string_literal: true # frozen_string_literal: true
class CreateNoteDiffFileWorker class CreateNoteDiffFileWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
# frozen_string_literal: true # frozen_string_literal: true
class CreatePipelineWorker class CreatePipelineWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class DeleteContainerRepositoryWorker class DeleteContainerRepositoryWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ExclusiveLeaseGuard include ExclusiveLeaseGuard
......
# frozen_string_literal: true # frozen_string_literal: true
class DeleteDiffFilesWorker class DeleteDiffFilesWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
# frozen_string_literal: true # frozen_string_literal: true
class DeleteMergedBranchesWorker class DeleteMergedBranchesWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
# frozen_string_literal: true # frozen_string_literal: true
class DeleteStoredFilesWorker class DeleteStoredFilesWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category_not_owned! feature_category_not_owned!
......
# frozen_string_literal: true # frozen_string_literal: true
class DeleteUserWorker class DeleteUserWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :authentication_and_authorization feature_category :authentication_and_authorization
......
# frozen_string_literal: true # frozen_string_literal: true
module Deployments module Deployments
class FinishedWorker class FinishedWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
queue_namespace :deployment queue_namespace :deployment
......
# frozen_string_literal: true # frozen_string_literal: true
module Deployments module Deployments
class ForwardDeploymentWorker class ForwardDeploymentWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
queue_namespace :deployment queue_namespace :deployment
......
# frozen_string_literal: true # frozen_string_literal: true
module Deployments module Deployments
class SuccessWorker class SuccessWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
queue_namespace :deployment queue_namespace :deployment
......
# frozen_string_literal: true # frozen_string_literal: true
class DetectRepositoryLanguagesWorker class DetectRepositoryLanguagesWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ExceptionBacktrace include ExceptionBacktrace
include ExclusiveLeaseGuard include ExclusiveLeaseGuard
......
# frozen_string_literal: true # frozen_string_literal: true
class EmailReceiverWorker class EmailReceiverWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :issue_tracking feature_category :issue_tracking
......
# frozen_string_literal: true # frozen_string_literal: true
class EmailsOnPushWorker class EmailsOnPushWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
attr_reader :email, :skip_premailer attr_reader :email, :skip_premailer
......
# frozen_string_literal: true # frozen_string_literal: true
module Environments module Environments
class AutoStopCronWorker class AutoStopCronWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# If a link to a different GitLab issue exists, a new link # If a link to a different GitLab issue exists, a new link
# will still be created, but will not be visible in Sentry # will still be created, but will not be visible in Sentry
# until the prior link is deleted. # until the prior link is deleted.
class ErrorTrackingIssueLinkWorker class ErrorTrackingIssueLinkWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ExclusiveLeaseGuard include ExclusiveLeaseGuard
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
......
# frozen_string_literal: true # frozen_string_literal: true
class ExpireBuildArtifactsWorker class ExpireBuildArtifactsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
# rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context # This worker does not perform work scoped to a context
......
# frozen_string_literal: true # frozen_string_literal: true
class ExpireBuildInstanceArtifactsWorker class ExpireBuildInstanceArtifactsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :continuous_integration feature_category :continuous_integration
......
...@@ -6,6 +6,7 @@ class ExpireJobCacheWorker ...@@ -6,6 +6,7 @@ class ExpireJobCacheWorker
queue_namespace :pipeline_cache queue_namespace :pipeline_cache
latency_sensitive_worker! latency_sensitive_worker!
idempotent!
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def perform(job_id) def perform(job_id)
......
# frozen_string_literal: true # frozen_string_literal: true
class ExpirePipelineCacheWorker class ExpirePipelineCacheWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class FileHookWorker class FileHookWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
sidekiq_options retry: false sidekiq_options retry: false
......
# frozen_string_literal: true # frozen_string_literal: true
class GitGarbageCollectWorker class GitGarbageCollectWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
sidekiq_options retry: false sidekiq_options retry: false
......
...@@ -6,7 +6,7 @@ module Gitlab ...@@ -6,7 +6,7 @@ module Gitlab
# number of jobs to complete, without blocking a thread. Once all jobs have # number of jobs to complete, without blocking a thread. Once all jobs have
# been completed this worker will advance the import process to the next # been completed this worker will advance the import process to the next
# stage. # stage.
class AdvanceStageWorker class AdvanceStageWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
sidekiq_options dead: false sidekiq_options dead: false
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Gitlab module Gitlab
module GithubImport module GithubImport
class ImportDiffNoteWorker class ImportDiffNoteWorker # rubocop:disable Scalability/IdempotentWorker
include ObjectImporter include ObjectImporter
def representation_class def representation_class
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Gitlab module Gitlab
module GithubImport module GithubImport
class ImportIssueWorker class ImportIssueWorker # rubocop:disable Scalability/IdempotentWorker
include ObjectImporter include ObjectImporter
def representation_class def representation_class
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Gitlab module Gitlab
module GithubImport module GithubImport
class ImportLfsObjectWorker class ImportLfsObjectWorker # rubocop:disable Scalability/IdempotentWorker
include ObjectImporter include ObjectImporter
def representation_class def representation_class
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Gitlab module Gitlab
module GithubImport module GithubImport
class ImportNoteWorker class ImportNoteWorker # rubocop:disable Scalability/IdempotentWorker
include ObjectImporter include ObjectImporter
def representation_class def representation_class
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Gitlab module Gitlab
module GithubImport module GithubImport
class ImportPullRequestWorker class ImportPullRequestWorker # rubocop:disable Scalability/IdempotentWorker
include ObjectImporter include ObjectImporter
def representation_class def representation_class
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Gitlab module Gitlab
module GithubImport module GithubImport
class RefreshImportJidWorker class RefreshImportJidWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include GithubImport::Queue include GithubImport::Queue
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Gitlab module Gitlab
module GithubImport module GithubImport
module Stage module Stage
class FinishImportWorker class FinishImportWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include GithubImport::Queue include GithubImport::Queue
include StageMethods include StageMethods
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Gitlab module Gitlab
module GithubImport module GithubImport
module Stage module Stage
class ImportBaseDataWorker class ImportBaseDataWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include GithubImport::Queue include GithubImport::Queue
include StageMethods include StageMethods
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Gitlab module Gitlab
module GithubImport module GithubImport
module Stage module Stage
class ImportIssuesAndDiffNotesWorker class ImportIssuesAndDiffNotesWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include GithubImport::Queue include GithubImport::Queue
include StageMethods include StageMethods
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Gitlab module Gitlab
module GithubImport module GithubImport
module Stage module Stage
class ImportLfsObjectsWorker class ImportLfsObjectsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include GithubImport::Queue include GithubImport::Queue
include StageMethods include StageMethods
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Gitlab module Gitlab
module GithubImport module GithubImport
module Stage module Stage
class ImportNotesWorker class ImportNotesWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include GithubImport::Queue include GithubImport::Queue
include StageMethods include StageMethods
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Gitlab module Gitlab
module GithubImport module GithubImport
module Stage module Stage
class ImportPullRequestsWorker class ImportPullRequestsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include GithubImport::Queue include GithubImport::Queue
include StageMethods include StageMethods
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Gitlab module Gitlab
module GithubImport module GithubImport
module Stage module Stage
class ImportRepositoryWorker class ImportRepositoryWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include GithubImport::Queue include GithubImport::Queue
include StageMethods include StageMethods
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
# - It marks the import as finished when all remaining jobs are done # - It marks the import as finished when all remaining jobs are done
module Gitlab module Gitlab
module PhabricatorImport module PhabricatorImport
class BaseWorker class BaseWorker # rubocop:disable Scalability/IdempotentWorker
include WorkerAttributes include WorkerAttributes
include Gitlab::ExclusiveLeaseHelpers include Gitlab::ExclusiveLeaseHelpers
......
# frozen_string_literal: true # frozen_string_literal: true
module Gitlab module Gitlab
module PhabricatorImport module PhabricatorImport
class ImportTasksWorker < BaseWorker class ImportTasksWorker < BaseWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ProjectImportOptions # This marks the project as failed after too many tries include ProjectImportOptions # This marks the project as failed after too many tries
......
# frozen_string_literal: true # frozen_string_literal: true
class GitlabShellWorker class GitlabShellWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include Gitlab::ShellAdapter include Gitlab::ShellAdapter
......
# frozen_string_literal: true # frozen_string_literal: true
class GitlabUsagePingWorker class GitlabUsagePingWorker # rubocop:disable Scalability/IdempotentWorker
LEASE_TIMEOUT = 86400 LEASE_TIMEOUT = 86400
include ApplicationWorker include ApplicationWorker
......
# frozen_string_literal: true # frozen_string_literal: true
class GroupDestroyWorker class GroupDestroyWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ExceptionBacktrace include ExceptionBacktrace
......
# frozen_string_literal: true # frozen_string_literal: true
class GroupExportWorker class GroupExportWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ExceptionBacktrace include ExceptionBacktrace
......
# frozen_string_literal: true # frozen_string_literal: true
class GroupImportWorker class GroupImportWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ExceptionBacktrace include ExceptionBacktrace
......
# frozen_string_literal: true # frozen_string_literal: true
module HashedStorage module HashedStorage
class BaseWorker class BaseWorker # rubocop:disable Scalability/IdempotentWorker
include ExclusiveLeaseGuard include ExclusiveLeaseGuard
include WorkerAttributes include WorkerAttributes
......
# frozen_string_literal: true # frozen_string_literal: true
module HashedStorage module HashedStorage
class MigratorWorker class MigratorWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
queue_namespace :hashed_storage queue_namespace :hashed_storage
......
# frozen_string_literal: true # frozen_string_literal: true
module HashedStorage module HashedStorage
class ProjectMigrateWorker < BaseWorker class ProjectMigrateWorker < BaseWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
queue_namespace :hashed_storage queue_namespace :hashed_storage
......
# frozen_string_literal: true # frozen_string_literal: true
module HashedStorage module HashedStorage
class ProjectRollbackWorker < BaseWorker class ProjectRollbackWorker < BaseWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
queue_namespace :hashed_storage queue_namespace :hashed_storage
......
# frozen_string_literal: true # frozen_string_literal: true
module HashedStorage module HashedStorage
class RollbackerWorker class RollbackerWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
queue_namespace :hashed_storage queue_namespace :hashed_storage
......
# frozen_string_literal: true # frozen_string_literal: true
class ImportExportProjectCleanupWorker class ImportExportProjectCleanupWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
# rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context # This worker does not perform work scoped to a context
......
# frozen_string_literal: true # frozen_string_literal: true
class ImportIssuesCsvWorker class ImportIssuesCsvWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :issue_tracking feature_category :issue_tracking
......
# frozen_string_literal: true # frozen_string_literal: true
module IncidentManagement module IncidentManagement
class ProcessAlertWorker class ProcessAlertWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
queue_namespace :incident_management queue_namespace :incident_management
......
# frozen_string_literal: true # frozen_string_literal: true
class InvalidGpgSignatureUpdateWorker class InvalidGpgSignatureUpdateWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'json' require 'json'
require 'socket' require 'socket'
class IrkerWorker class IrkerWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :integrations feature_category :integrations
......
# frozen_string_literal: true # frozen_string_literal: true
class IssueDueSchedulerWorker class IssueDueSchedulerWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
......
# frozen_string_literal: true # frozen_string_literal: true
module MailScheduler module MailScheduler
class IssueDueWorker class IssueDueWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include MailSchedulerQueue include MailSchedulerQueue
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'active_job/arguments' require 'active_job/arguments'
module MailScheduler module MailScheduler
class NotificationServiceWorker class NotificationServiceWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include MailSchedulerQueue include MailSchedulerQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class MergeRequestMergeabilityCheckWorker class MergeRequestMergeabilityCheckWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
# frozen_string_literal: true # frozen_string_literal: true
class MergeWorker class MergeWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
# frozen_string_literal: true # frozen_string_literal: true
class MigrateExternalDiffsWorker class MigrateExternalDiffsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# used to belong to. Projects in this state should be rare. # used to belong to. Projects in this state should be rare.
# The worker will reject doing anything for projects that *do* have a # The worker will reject doing anything for projects that *do* have a
# namespace. For those use ProjectDestroyWorker instead. # namespace. For those use ProjectDestroyWorker instead.
class NamespacelessProjectDestroyWorker class NamespacelessProjectDestroyWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ExceptionBacktrace include ExceptionBacktrace
......
# frozen_string_literal: true # frozen_string_literal: true
module Namespaces module Namespaces
class PruneAggregationSchedulesWorker class PruneAggregationSchedulesWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
......
# frozen_string_literal: true # frozen_string_literal: true
module Namespaces module Namespaces
class RootStatisticsWorker class RootStatisticsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
queue_namespace :update_namespace_statistics queue_namespace :update_namespace_statistics
......
# frozen_string_literal: true # frozen_string_literal: true
module Namespaces module Namespaces
class ScheduleAggregationWorker class ScheduleAggregationWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
queue_namespace :update_namespace_statistics queue_namespace :update_namespace_statistics
......
# frozen_string_literal: true # frozen_string_literal: true
class NewIssueWorker class NewIssueWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include NewIssuable include NewIssuable
......
# frozen_string_literal: true # frozen_string_literal: true
class NewMergeRequestWorker class NewMergeRequestWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include NewIssuable include NewIssuable
......
# frozen_string_literal: true # frozen_string_literal: true
class NewNoteWorker class NewNoteWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :issue_tracking feature_category :issue_tracking
......
# frozen_string_literal: true # frozen_string_literal: true
class NewReleaseWorker class NewReleaseWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
queue_namespace :notifications queue_namespace :notifications
......
# frozen_string_literal: true # frozen_string_literal: true
module ObjectPool module ObjectPool
class CreateWorker class CreateWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ObjectPoolQueue include ObjectPoolQueue
include ExclusiveLeaseGuard include ExclusiveLeaseGuard
......
# frozen_string_literal: true # frozen_string_literal: true
module ObjectPool module ObjectPool
class DestroyWorker class DestroyWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ObjectPoolQueue include ObjectPoolQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module ObjectPool module ObjectPool
class JoinWorker class JoinWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ObjectPoolQueue include ObjectPoolQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module ObjectPool module ObjectPool
class ScheduleJoinWorker class ScheduleJoinWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ObjectPoolQueue include ObjectPoolQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module ObjectStorage module ObjectStorage
class BackgroundMoveWorker class BackgroundMoveWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ObjectStorageQueue include ObjectStorageQueue
......
# frozen_string_literal: true # frozen_string_literal: true
# rubocop:disable Scalability/IdempotentWorker
module ObjectStorage module ObjectStorage
class MigrateUploadsWorker class MigrateUploadsWorker
include ApplicationWorker include ApplicationWorker
...@@ -137,3 +138,4 @@ module ObjectStorage ...@@ -137,3 +138,4 @@ module ObjectStorage
end end
end end
end end
# rubocop:enable Scalability/IdempotentWorker
# frozen_string_literal: true # frozen_string_literal: true
class PagesDomainRemovalCronWorker class PagesDomainRemovalCronWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue include CronjobQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class PagesDomainSslRenewalCronWorker class PagesDomainSslRenewalCronWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue include CronjobQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class PagesDomainSslRenewalWorker class PagesDomainSslRenewalWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :pages feature_category :pages
......
# frozen_string_literal: true # frozen_string_literal: true
class PagesDomainVerificationCronWorker class PagesDomainVerificationCronWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue include CronjobQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class PagesDomainVerificationWorker class PagesDomainVerificationWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :pages feature_category :pages
......
# frozen_string_literal: true # frozen_string_literal: true
class PagesWorker class PagesWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
sidekiq_options retry: 3 sidekiq_options retry: 3
......
# frozen_string_literal: true # frozen_string_literal: true
module PersonalAccessTokens module PersonalAccessTokens
class ExpiringWorker class ExpiringWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue include CronjobQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class PipelineHooksWorker class PipelineHooksWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class PipelineMetricsWorker class PipelineMetricsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class PipelineNotificationWorker class PipelineNotificationWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class PipelineProcessWorker class PipelineProcessWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class PipelineScheduleWorker class PipelineScheduleWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue include CronjobQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class PipelineSuccessWorker class PipelineSuccessWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class PipelineUpdateWorker class PipelineUpdateWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class PostReceive class PostReceive # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# result of this the workload of this worker should be kept to a bare minimum. # result of this the workload of this worker should be kept to a bare minimum.
# Consider using an extra worker if you need to add any extra (and potentially # Consider using an extra worker if you need to add any extra (and potentially
# slow) processing of commits. # slow) processing of commits.
class ProcessCommitWorker class ProcessCommitWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
# frozen_string_literal: true # frozen_string_literal: true
# Worker for updating any project specific caches. # Worker for updating any project specific caches.
class ProjectCacheWorker class ProjectCacheWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
latency_sensitive_worker! latency_sensitive_worker!
......
# frozen_string_literal: true # frozen_string_literal: true
class ProjectDailyStatisticsWorker class ProjectDailyStatisticsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
# frozen_string_literal: true # frozen_string_literal: true
class ProjectDestroyWorker class ProjectDestroyWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ExceptionBacktrace include ExceptionBacktrace
......
# frozen_string_literal: true # frozen_string_literal: true
class ProjectExportWorker class ProjectExportWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ExceptionBacktrace include ExceptionBacktrace
......
# frozen_string_literal: true # frozen_string_literal: true
class ProjectServiceWorker class ProjectServiceWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
sidekiq_options dead: false sidekiq_options dead: false
......
# frozen_string_literal: true # frozen_string_literal: true
# Worker for updating any project specific caches. # Worker for updating any project specific caches.
class PropagateServiceTemplateWorker class PropagateServiceTemplateWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
# frozen_string_literal: true # frozen_string_literal: true
class PruneOldEventsWorker class PruneOldEventsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
# rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context # This worker does not perform work scoped to a context
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Worker that deletes a fixed number of outdated rows from the "web_hook_logs" # Worker that deletes a fixed number of outdated rows from the "web_hook_logs"
# table. # table.
class PruneWebHookLogsWorker class PruneWebHookLogsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
# rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context # This worker does not perform work scoped to a context
......
# frozen_string_literal: true # frozen_string_literal: true
class ReactiveCachingWorker class ReactiveCachingWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category_not_owned! feature_category_not_owned!
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# The RebaseWorker must be wrapped in important concurrency code, so should only # The RebaseWorker must be wrapped in important concurrency code, so should only
# be scheduled via MergeRequest#rebase_async # be scheduled via MergeRequest#rebase_async
class RebaseWorker class RebaseWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
# frozen_string_literal: true # frozen_string_literal: true
class RemoteMirrorNotificationWorker class RemoteMirrorNotificationWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
# frozen_string_literal: true # frozen_string_literal: true
class RemoveExpiredGroupLinksWorker class RemoveExpiredGroupLinksWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
......
# frozen_string_literal: true # frozen_string_literal: true
class RemoveExpiredMembersWorker class RemoveExpiredMembersWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
......
# frozen_string_literal: true # frozen_string_literal: true
class RemoveUnreferencedLfsObjectsWorker class RemoveUnreferencedLfsObjectsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
# rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context # This worker does not perform work scoped to a context
......
# frozen_string_literal: true # frozen_string_literal: true
class RepositoryArchiveCacheWorker class RepositoryArchiveCacheWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
# rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context # This worker does not perform work scoped to a context
......
# frozen_string_literal: true # frozen_string_literal: true
module RepositoryCheck module RepositoryCheck
class BatchWorker class BatchWorker # rubocop:disable Scalability/IdempotentWorker
prepend_if_ee('::EE::RepositoryCheck::BatchWorker') # rubocop: disable Cop/InjectEnterpriseEditionModule prepend_if_ee('::EE::RepositoryCheck::BatchWorker') # rubocop: disable Cop/InjectEnterpriseEditionModule
include ApplicationWorker include ApplicationWorker
......
# frozen_string_literal: true # frozen_string_literal: true
module RepositoryCheck module RepositoryCheck
class ClearWorker class ClearWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include RepositoryCheckQueue include RepositoryCheckQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module RepositoryCheck module RepositoryCheck
class DispatchWorker class DispatchWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
# rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context # This worker does not perform work scoped to a context
......
# frozen_string_literal: true # frozen_string_literal: true
module RepositoryCheck module RepositoryCheck
class SingleRepositoryWorker class SingleRepositoryWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include RepositoryCheckQueue include RepositoryCheckQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class RepositoryCleanupWorker class RepositoryCleanupWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
sidekiq_options retry: 3 sidekiq_options retry: 3
......
# frozen_string_literal: true # frozen_string_literal: true
class RepositoryForkWorker class RepositoryForkWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include Gitlab::ShellAdapter include Gitlab::ShellAdapter
include ProjectStartImport include ProjectStartImport
......
# frozen_string_literal: true # frozen_string_literal: true
class RepositoryImportWorker class RepositoryImportWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ExceptionBacktrace include ExceptionBacktrace
include ProjectStartImport include ProjectStartImport
......
# frozen_string_literal: true # frozen_string_literal: true
class RepositoryRemoveRemoteWorker class RepositoryRemoveRemoteWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ExclusiveLeaseGuard include ExclusiveLeaseGuard
......
# frozen_string_literal: true # frozen_string_literal: true
class RepositoryUpdateRemoteMirrorWorker class RepositoryUpdateRemoteMirrorWorker # rubocop:disable Scalability/IdempotentWorker
UpdateError = Class.new(StandardError) UpdateError = Class.new(StandardError)
include ApplicationWorker include ApplicationWorker
......
# frozen_string_literal: true # frozen_string_literal: true
class RequestsProfilesWorker class RequestsProfilesWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
# rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context # This worker does not perform work scoped to a context
......
# frozen_string_literal: true # frozen_string_literal: true
class RunPipelineScheduleWorker class RunPipelineScheduleWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class ScheduleMigrateExternalDiffsWorker class ScheduleMigrateExternalDiffsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
# rubocop:disable Scalability/CronWorkerContext: # rubocop:disable Scalability/CronWorkerContext:
# This schedules the `MigrateExternalDiffsWorker` # This schedules the `MigrateExternalDiffsWorker`
......
# frozen_string_literal: true # frozen_string_literal: true
class SelfMonitoringProjectCreateWorker class SelfMonitoringProjectCreateWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ExclusiveLeaseGuard include ExclusiveLeaseGuard
include SelfMonitoringProjectWorker include SelfMonitoringProjectWorker
......
# frozen_string_literal: true # frozen_string_literal: true
class SelfMonitoringProjectDeleteWorker class SelfMonitoringProjectDeleteWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ExclusiveLeaseGuard include ExclusiveLeaseGuard
include SelfMonitoringProjectWorker include SelfMonitoringProjectWorker
......
# frozen_string_literal: true # frozen_string_literal: true
class StageUpdateWorker class StageUpdateWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class StuckCiJobsWorker class StuckCiJobsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue include CronjobQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class StuckImportJobsWorker class StuckImportJobsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
# rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker updates several import states inline and does not schedule # This worker updates several import states inline and does not schedule
......
# frozen_string_literal: true # frozen_string_literal: true
class StuckMergeJobsWorker class StuckMergeJobsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext include CronjobQueue # rubocop:disable Scalability/CronWorkerContext
......
# frozen_string_literal: true # frozen_string_literal: true
class SystemHookPushWorker class SystemHookPushWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
# frozen_string_literal: true # frozen_string_literal: true
module TodosDestroyer module TodosDestroyer
class ConfidentialIssueWorker class ConfidentialIssueWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include TodosDestroyerQueue include TodosDestroyerQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module TodosDestroyer module TodosDestroyer
class EntityLeaveWorker class EntityLeaveWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include TodosDestroyerQueue include TodosDestroyerQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module TodosDestroyer module TodosDestroyer
class GroupPrivateWorker class GroupPrivateWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include TodosDestroyerQueue include TodosDestroyerQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module TodosDestroyer module TodosDestroyer
class PrivateFeaturesWorker class PrivateFeaturesWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include TodosDestroyerQueue include TodosDestroyerQueue
......
# frozen_string_literal: true # frozen_string_literal: true
module TodosDestroyer module TodosDestroyer
class ProjectPrivateWorker class ProjectPrivateWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include TodosDestroyerQueue include TodosDestroyerQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class TrendingProjectsWorker class TrendingProjectsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
# rubocop:disable Scalability/CronWorkerContext # rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context # This worker does not perform work scoped to a context
......
# frozen_string_literal: true # frozen_string_literal: true
class UpdateExternalPullRequestsWorker class UpdateExternalPullRequestsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
# frozen_string_literal: true # frozen_string_literal: true
class UpdateHeadPipelineForMergeRequestWorker class UpdateHeadPipelineForMergeRequestWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class UpdateMergeRequestsWorker class UpdateMergeRequestsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
# frozen_string_literal: true # frozen_string_literal: true
# Worker for updating project statistics. # Worker for updating project statistics.
class UpdateProjectStatisticsWorker class UpdateProjectStatisticsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :source_code_management feature_category :source_code_management
......
# frozen_string_literal: true # frozen_string_literal: true
class UploadChecksumWorker class UploadChecksumWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :geo_replication feature_category :geo_replication
......
# frozen_string_literal: true # frozen_string_literal: true
class WaitForClusterCreationWorker class WaitForClusterCreationWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
include ClusterQueue include ClusterQueue
......
# frozen_string_literal: true # frozen_string_literal: true
class WebHookWorker class WebHookWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker include ApplicationWorker
feature_category :integrations feature_category :integrations
......
---
title: Add possibility to track milestone changes on issues and merge requests
merge_request: 24780
author:
type: added
---
title: Rescue elasticsearch server error in pod logs
merge_request: 25367
author:
type: fixed
---
title: Use new loading spinner in Todos dashboard buttons
merge_request: 25142
author: Tsegaselassie Tadesse
type: other
...@@ -72,20 +72,21 @@ migration classes must be defined in the namespace ...@@ -72,20 +72,21 @@ migration classes must be defined in the namespace
## Scheduling ## Scheduling
Scheduling a background migration should be done in a post-deployment migration. Scheduling a background migration should be done in a post-deployment
migration that includes `Gitlab::Database::MigrationHelpers`
To do so, simply use the following code while To do so, simply use the following code while
replacing the class name and arguments with whatever values are necessary for replacing the class name and arguments with whatever values are necessary for
your migration: your migration:
```ruby ```ruby
BackgroundMigrationWorker.perform_async('BackgroundMigrationClassName', [arg1, arg2, ...]) migrate_async('BackgroundMigrationClassName', [arg1, arg2, ...])
``` ```
Usually it's better to enqueue jobs in bulk, for this you can use Usually it's better to enqueue jobs in bulk, for this you can use
`BackgroundMigrationWorker.bulk_perform_async`: `bulk_migrate_async`:
```ruby ```ruby
BackgroundMigrationWorker.bulk_perform_async( bulk_migrate_async(
[['BackgroundMigrationClassName', [1]], [['BackgroundMigrationClassName', [1]],
['BackgroundMigrationClassName', [2]]] ['BackgroundMigrationClassName', [2]]]
) )
...@@ -105,7 +106,7 @@ If you would like to schedule jobs in bulk with a delay, you can use ...@@ -105,7 +106,7 @@ If you would like to schedule jobs in bulk with a delay, you can use
jobs = [['BackgroundMigrationClassName', [1]], jobs = [['BackgroundMigrationClassName', [1]],
['BackgroundMigrationClassName', [2]]] ['BackgroundMigrationClassName', [2]]]
BackgroundMigrationWorker.bulk_perform_in(5.minutes, jobs) bulk_migrate_in(5.minutes, jobs)
``` ```
### Rescheduling background migrations ### Rescheduling background migrations
......
...@@ -688,7 +688,7 @@ module Gitlab ...@@ -688,7 +688,7 @@ module Gitlab
start_id, end_id = batch.pluck('MIN(id), MAX(id)').first start_id, end_id = batch.pluck('MIN(id), MAX(id)').first
max_index = index max_index = index
BackgroundMigrationWorker.perform_in( migrate_in(
index * interval, index * interval,
'CopyColumn', 'CopyColumn',
[table, column, temp_column, start_id, end_id] [table, column, temp_column, start_id, end_id]
...@@ -697,7 +697,7 @@ module Gitlab ...@@ -697,7 +697,7 @@ module Gitlab
# Schedule the renaming of the column to happen (initially) 1 hour after # Schedule the renaming of the column to happen (initially) 1 hour after
# the last batch finished. # the last batch finished.
BackgroundMigrationWorker.perform_in( migrate_in(
(max_index * interval) + 1.hour, (max_index * interval) + 1.hour,
'CleanupConcurrentTypeChange', 'CleanupConcurrentTypeChange',
[table, column, temp_column] [table, column, temp_column]
...@@ -779,7 +779,7 @@ module Gitlab ...@@ -779,7 +779,7 @@ module Gitlab
start_id, end_id = batch.pluck('MIN(id), MAX(id)').first start_id, end_id = batch.pluck('MIN(id), MAX(id)').first
max_index = index max_index = index
BackgroundMigrationWorker.perform_in( migrate_in(
index * interval, index * interval,
'CopyColumn', 'CopyColumn',
[table, old_column, new_column, start_id, end_id] [table, old_column, new_column, start_id, end_id]
...@@ -788,7 +788,7 @@ module Gitlab ...@@ -788,7 +788,7 @@ module Gitlab
# Schedule the renaming of the column to happen (initially) 1 hour after # Schedule the renaming of the column to happen (initially) 1 hour after
# the last batch finished. # the last batch finished.
BackgroundMigrationWorker.perform_in( migrate_in(
(max_index * interval) + 1.hour, (max_index * interval) + 1.hour,
'CleanupConcurrentRename', 'CleanupConcurrentRename',
[table, old_column, new_column] [table, old_column, new_column]
...@@ -1024,14 +1024,14 @@ into similar problems in the future (e.g. when new tables are created). ...@@ -1024,14 +1024,14 @@ into similar problems in the future (e.g. when new tables are created).
# We push multiple jobs at a time to reduce the time spent in # We push multiple jobs at a time to reduce the time spent in
# Sidekiq/Redis operations. We're using this buffer based approach so we # Sidekiq/Redis operations. We're using this buffer based approach so we
# don't need to run additional queries for every range. # don't need to run additional queries for every range.
BackgroundMigrationWorker.bulk_perform_async(jobs) bulk_migrate_async(jobs)
jobs.clear jobs.clear
end end
jobs << [job_class_name, [start_id, end_id]] jobs << [job_class_name, [start_id, end_id]]
end end
BackgroundMigrationWorker.bulk_perform_async(jobs) unless jobs.empty? bulk_migrate_async(jobs) unless jobs.empty?
end end
# Queues background migration jobs for an entire table, batched by ID range. # Queues background migration jobs for an entire table, batched by ID range.
...@@ -1074,7 +1074,7 @@ into similar problems in the future (e.g. when new tables are created). ...@@ -1074,7 +1074,7 @@ into similar problems in the future (e.g. when new tables are created).
# `BackgroundMigrationWorker.bulk_perform_in` schedules all jobs for # `BackgroundMigrationWorker.bulk_perform_in` schedules all jobs for
# the same time, which is not helpful in most cases where we wish to # the same time, which is not helpful in most cases where we wish to
# spread the work over time. # spread the work over time.
BackgroundMigrationWorker.perform_in(delay_interval * index, job_class_name, [start_id, end_id]) migrate_in(delay_interval * index, job_class_name, [start_id, end_id])
end end
end end
...@@ -1133,6 +1133,30 @@ into similar problems in the future (e.g. when new tables are created). ...@@ -1133,6 +1133,30 @@ into similar problems in the future (e.g. when new tables are created).
execute(sql) execute(sql)
end end
def migrate_async(*args)
with_migration_context do
BackgroundMigrationWorker.perform_async(*args)
end
end
def migrate_in(*args)
with_migration_context do
BackgroundMigrationWorker.perform_in(*args)
end
end
def bulk_migrate_in(*args)
with_migration_context do
BackgroundMigrationWorker.bulk_perform_in(*args)
end
end
def bulk_migrate_async(*args)
with_migration_context do
BackgroundMigrationWorker.bulk_perform_async(*args)
end
end
private private
def tables_match?(target_table, foreign_key_table) def tables_match?(target_table, foreign_key_table)
...@@ -1191,6 +1215,10 @@ into similar problems in the future (e.g. when new tables are created). ...@@ -1191,6 +1215,10 @@ into similar problems in the future (e.g. when new tables are created).
your migration class your migration class
ERROR ERROR
end end
def with_migration_context(&block)
Gitlab::ApplicationContext.with_context(caller_id: self.class.to_s, &block)
end
end end
end end
end end
...@@ -11,6 +11,7 @@ module Gitlab ...@@ -11,6 +11,7 @@ module Gitlab
has_external_dependencies: :worker_has_external_dependencies?, has_external_dependencies: :worker_has_external_dependencies?,
latency_sensitive: :latency_sensitive_worker?, latency_sensitive: :latency_sensitive_worker?,
resource_boundary: :get_worker_resource_boundary, resource_boundary: :get_worker_resource_boundary,
idempotent: :idempotent?,
weight: :get_weight weight: :get_weight
}.freeze }.freeze
......
...@@ -7,7 +7,7 @@ module Gitlab ...@@ -7,7 +7,7 @@ module Gitlab
attr_reader :klass attr_reader :klass
delegate :feature_category_not_owned?, :get_feature_category, delegate :feature_category_not_owned?, :get_feature_category,
:get_weight, :get_worker_resource_boundary, :get_weight, :get_worker_resource_boundary, :idempotent?,
:latency_sensitive_worker?, :queue, :queue_namespace, :latency_sensitive_worker?, :queue, :queue_namespace,
:worker_has_external_dependencies?, :worker_has_external_dependencies?,
to: :klass to: :klass
...@@ -51,7 +51,8 @@ module Gitlab ...@@ -51,7 +51,8 @@ module Gitlab
has_external_dependencies: worker_has_external_dependencies?, has_external_dependencies: worker_has_external_dependencies?,
latency_sensitive: latency_sensitive_worker?, latency_sensitive: latency_sensitive_worker?,
resource_boundary: get_worker_resource_boundary, resource_boundary: get_worker_resource_boundary,
weight: get_weight weight: get_weight,
idempotent: idempotent?
} }
end end
......
...@@ -7044,6 +7044,9 @@ msgstr "" ...@@ -7044,6 +7044,9 @@ msgstr ""
msgid "Elasticsearch integration. Elasticsearch AWS IAM." msgid "Elasticsearch integration. Elasticsearch AWS IAM."
msgstr "" msgstr ""
msgid "Elasticsearch returned status code: %{status_code}"
msgstr ""
msgid "Elastic|None. Select namespaces to index." msgid "Elastic|None. Select namespaces to index."
msgstr "" msgstr ""
......
# frozen_string_literal: true
require_relative '../../migration_helpers'
module RuboCop
module Cop
module Migration
class ScheduleAsync < RuboCop::Cop::Cop
include MigrationHelpers
ENFORCED_SINCE = 2020_02_12_00_00_00
MSG = <<~MSG
Don't call the background migration worker directly, use the `#migrate_async`,
`#migrate_in`, `#bulk_migrate_async` or `#bulk_migrate_in` migration helpers
instead.
MSG
def_node_matcher :calls_background_migration_worker?, <<~PATTERN
(send (const nil? :BackgroundMigrationWorker) {:perform_async :perform_in :bulk_perform_async :bulk_perform_in} ... )
PATTERN
def on_send(node)
return unless in_migration?(node)
return if version(node) < ENFORCED_SINCE
add_offense(node, location: :expression) if calls_background_migration_worker?(node)
end
def autocorrect(node)
# This gets rid of the receiver `BackgroundMigrationWorker` and
# replaces `perform` with `schedule`
schedule_method = method_name(node).to_s.sub('perform', 'migrate')
arguments = arguments(node).map(&:source).join(', ')
replacement = "#{schedule_method}(#{arguments})"
lambda do |corrector|
corrector.replace(node.source_range, replacement)
end
end
private
def method_name(node)
node.children.second
end
def arguments(node)
node.children[2..-1]
end
end
end
end
end
# frozen_string_literal: true
require_relative '../../code_reuse_helpers.rb'
module RuboCop
module Cop
module Scalability
# This cop checks for the `idempotent!` call in the worker scope.
#
# @example
#
# # bad
# class TroubleMakerWorker
# def perform
# end
# end
#
# # good
# class NiceWorker
# idempotent!
#
# def perform
# end
# end
#
class IdempotentWorker < RuboCop::Cop::Cop
include CodeReuseHelpers
HELP_LINK = 'https://github.com/mperham/sidekiq/wiki/Best-Practices#2-make-your-job-idempotent-and-transactional'
MSG = <<~MSG
Avoid adding not idempotent workers.
A worker is considered idempotent if:
1. It can safely run multiple times with the same arguments
2. The application side-effects are expected to happen once (or side-effects of a second run are not impactful)
3. It can safely be skipped if another job with the same arguments is already in the queue
If all the above is true, make sure to mark it as so by calling the `idempotent!`
method in the worker scope.
See #{HELP_LINK}
MSG
def_node_search :idempotent?, <<~PATTERN
(send nil? :idempotent!)
PATTERN
def on_class(node)
return unless in_worker?(node)
return if idempotent?(node)
add_offense(node, location: :expression)
end
end
end
end
end
...@@ -10,6 +10,10 @@ module RuboCop ...@@ -10,6 +10,10 @@ module RuboCop
dirname(node).end_with?('db/post_migrate', 'db/geo/post_migrate') dirname(node).end_with?('db/post_migrate', 'db/geo/post_migrate')
end end
def version(node)
File.basename(node.location.expression.source_buffer.name).split('_').first.to_i
end
private private
def dirname(node) def dirname(node)
......
...@@ -135,6 +135,10 @@ describe Projects::MilestonesController do ...@@ -135,6 +135,10 @@ describe Projects::MilestonesController do
end end
describe "#destroy" do describe "#destroy" do
before do
stub_feature_flags(track_resource_milestone_change_events: false)
end
it "removes milestone" do it "removes milestone" do
expect(issue.milestone_id).to eq(milestone.id) expect(issue.milestone_id).to eq(milestone.id)
......
# frozen_string_literal: true
FactoryBot.define do
factory :resource_milestone_event do
issue { merge_request.nil? ? create(:issue) : nil }
merge_request { nil }
milestone
action { :add }
state { :opened }
user { issue&.author || merge_request&.author || create(:user) }
end
end
...@@ -1893,4 +1893,60 @@ describe Gitlab::Database::MigrationHelpers do ...@@ -1893,4 +1893,60 @@ describe Gitlab::Database::MigrationHelpers do
end end
end end
end end
describe '#migrate_async' do
it 'calls BackgroundMigrationWorker.perform_async' do
expect(BackgroundMigrationWorker).to receive(:perform_async).with("Class", "hello", "world")
model.migrate_async("Class", "hello", "world")
end
it 'pushes a context with the current class name as caller_id' do
expect(Gitlab::ApplicationContext).to receive(:with_context).with(caller_id: model.class.to_s)
model.migrate_async('Class', 'hello', 'world')
end
end
describe '#migrate_in' do
it 'calls BackgroundMigrationWorker.perform_in' do
expect(BackgroundMigrationWorker).to receive(:perform_in).with(10.minutes, 'Class', 'Hello', 'World')
model.migrate_in(10.minutes, 'Class', 'Hello', 'World')
end
it 'pushes a context with the current class name as caller_id' do
expect(Gitlab::ApplicationContext).to receive(:with_context).with(caller_id: model.class.to_s)
model.migrate_in(10.minutes, 'Class', 'Hello', 'World')
end
end
describe '#bulk_migrate_async' do
it 'calls BackgroundMigrationWorker.bulk_perform_async' do
expect(BackgroundMigrationWorker).to receive(:bulk_perform_async).with([%w(Class hello world)])
model.bulk_migrate_async([%w(Class hello world)])
end
it 'pushes a context with the current class name as caller_id' do
expect(Gitlab::ApplicationContext).to receive(:with_context).with(caller_id: model.class.to_s)
model.bulk_migrate_async([%w(Class hello world)])
end
end
describe '#bulk_migrate_in' do
it 'calls BackgroundMigrationWorker.bulk_perform_in_' do
expect(BackgroundMigrationWorker).to receive(:bulk_perform_in).with(10.minutes, [%w(Class hello world)])
model.bulk_migrate_in(10.minutes, [%w(Class hello world)])
end
it 'pushes a context with the current class name as caller_id' do
expect(Gitlab::ApplicationContext).to receive(:with_context).with(caller_id: model.class.to_s)
model.bulk_migrate_in(10.minutes, [%w(Class hello world)])
end
end
end end
...@@ -9,6 +9,7 @@ issues: ...@@ -9,6 +9,7 @@ issues:
- notes - notes
- resource_label_events - resource_label_events
- resource_weight_events - resource_weight_events
- resource_milestone_events
- sentry_issue - sentry_issue
- label_links - label_links
- labels - labels
...@@ -109,6 +110,7 @@ merge_requests: ...@@ -109,6 +110,7 @@ merge_requests:
- milestone - milestone
- notes - notes
- resource_label_events - resource_label_events
- resource_milestone_events
- label_links - label_links
- labels - labels
- last_edited_by - last_edited_by
......
...@@ -12,7 +12,8 @@ describe Gitlab::SidekiqConfig::Worker do ...@@ -12,7 +12,8 @@ describe Gitlab::SidekiqConfig::Worker do
get_weight: attributes[:weight], get_weight: attributes[:weight],
get_worker_resource_boundary: attributes[:resource_boundary], get_worker_resource_boundary: attributes[:resource_boundary],
latency_sensitive_worker?: attributes[:latency_sensitive], latency_sensitive_worker?: attributes[:latency_sensitive],
worker_has_external_dependencies?: attributes[:has_external_dependencies] worker_has_external_dependencies?: attributes[:has_external_dependencies],
idempotent?: attributes[:idempotent]
) )
described_class.new(inner_worker, ee: false) described_class.new(inner_worker, ee: false)
...@@ -89,7 +90,8 @@ describe Gitlab::SidekiqConfig::Worker do ...@@ -89,7 +90,8 @@ describe Gitlab::SidekiqConfig::Worker do
has_external_dependencies: false, has_external_dependencies: false,
latency_sensitive: false, latency_sensitive: false,
resource_boundary: :memory, resource_boundary: :memory,
weight: 2 weight: 2,
idempotent: true
} }
attributes_b = { attributes_b = {
...@@ -97,7 +99,8 @@ describe Gitlab::SidekiqConfig::Worker do ...@@ -97,7 +99,8 @@ describe Gitlab::SidekiqConfig::Worker do
has_external_dependencies: true, has_external_dependencies: true,
latency_sensitive: true, latency_sensitive: true,
resource_boundary: :unknown, resource_boundary: :unknown,
weight: 1 weight: 3,
idempotent: false
} }
worker_a = create_worker(queue: 'a', **attributes_a) worker_a = create_worker(queue: 'a', **attributes_a)
......
# frozen_string_literal: true
require 'spec_helper'
describe MilestoneNote do
describe '.from_event' do
let(:author) { create(:user) }
let(:project) { create(:project, :repository) }
let(:noteable) { create(:issue, author: author, project: project) }
let(:event) { create(:resource_milestone_event, issue: noteable) }
subject { described_class.from_event(event, resource: noteable, resource_parent: project) }
it_behaves_like 'a system note', exclude_project: true do
let(:action) { 'milestone' }
end
end
end
# frozen_string_literal: true
require 'spec_helper'
describe ResourceMilestoneEvent, type: :model do
it_behaves_like 'a resource event'
it_behaves_like 'a resource event for issues'
it_behaves_like 'a resource event for merge requests'
it_behaves_like 'having unique enum values'
describe 'associations' do
it { is_expected.to belong_to(:milestone) }
end
describe 'validations' do
context 'when issue and merge_request are both nil' do
subject { build(described_class.name.underscore.to_sym, issue: nil, merge_request: nil) }
it { is_expected.not_to be_valid }
end
context 'when issue and merge_request are both set' do
subject { build(described_class.name.underscore.to_sym, issue: build(:issue), merge_request: build(:merge_request)) }
it { is_expected.not_to be_valid }
end
context 'when issue is set' do
subject { create(described_class.name.underscore.to_sym, issue: create(:issue), merge_request: nil) }
it { is_expected.to be_valid }
end
context 'when merge_request is set' do
subject { create(described_class.name.underscore.to_sym, issue: nil, merge_request: create(:merge_request)) }
it { is_expected.to be_valid }
end
end
describe 'states' do
[Issue, MergeRequest].each do |klass|
klass.available_states.each do |state|
it "supports state #{state.first} for #{klass.name.underscore}" do
model = create(klass.name.underscore, state: state[0])
key = model.class.name.underscore
event = build(described_class.name.underscore.to_sym, key => model, state: model.state)
expect(event.state).to eq(state[0])
end
end
end
end
end
# frozen_string_literal: true
require 'fast_spec_helper'
require 'rubocop'
require 'rubocop/rspec/support'
require_relative '../../../../rubocop/cop/migration/schedule_async'
describe RuboCop::Cop::Migration::ScheduleAsync do
include CopHelper
let(:cop) { described_class.new }
let(:source) do
<<~SOURCE
def up
BackgroundMigrationWorker.perform_async(ClazzName, "Bar", "Baz")
end
SOURCE
end
shared_examples 'a disabled cop' do
it 'does not register any offenses' do
inspect_source(source)
expect(cop.offenses).to be_empty
end
end
context 'outside of a migration' do
it_behaves_like 'a disabled cop'
end
context 'in a migration' do
before do
allow(cop).to receive(:in_migration?).and_return(true)
end
context 'in an old migration' do
before do
allow(cop).to receive(:version).and_return(described_class::ENFORCED_SINCE - 5)
end
it_behaves_like 'a disabled cop'
end
context 'that is recent' do
before do
allow(cop).to receive(:version).and_return(described_class::ENFORCED_SINCE + 5)
end
context 'BackgroundMigrationWorker.perform_async' do
it 'adds an offence when calling `BackgroundMigrationWorker.peform_async`' do
inspect_source(source)
expect(cop.offenses.size).to eq(1)
end
it 'autocorrects to the right version' do
correct_source = <<~CORRECT
def up
migrate_async(ClazzName, "Bar", "Baz")
end
CORRECT
expect(autocorrect_source(source)).to eq(correct_source)
end
end
context 'BackgroundMigrationWorker.perform_in' do
let(:source) do
<<~SOURCE
def up
BackgroundMigrationWorker
.perform_in(delay, ClazzName, "Bar", "Baz")
end
SOURCE
end
it 'adds an offence' do
inspect_source(source)
expect(cop.offenses.size).to eq(1)
end
it 'autocorrects to the right version' do
correct_source = <<~CORRECT
def up
migrate_in(delay, ClazzName, "Bar", "Baz")
end
CORRECT
expect(autocorrect_source(source)).to eq(correct_source)
end
end
context 'BackgroundMigrationWorker.bulk_perform_async' do
let(:source) do
<<~SOURCE
def up
BackgroundMigrationWorker
.bulk_perform_async(jobs)
end
SOURCE
end
it 'adds an offence' do
inspect_source(source)
expect(cop.offenses.size).to eq(1)
end
it 'autocorrects to the right version' do
correct_source = <<~CORRECT
def up
bulk_migrate_async(jobs)
end
CORRECT
expect(autocorrect_source(source)).to eq(correct_source)
end
end
context 'BackgroundMigrationWorker.bulk_perform_in' do
let(:source) do
<<~SOURCE
def up
BackgroundMigrationWorker
.bulk_perform_in(5.minutes, jobs)
end
SOURCE
end
it 'adds an offence' do
inspect_source(source)
expect(cop.offenses.size).to eq(1)
end
it 'autocorrects to the right version' do
correct_source = <<~CORRECT
def up
bulk_migrate_in(5.minutes, jobs)
end
CORRECT
expect(autocorrect_source(source)).to eq(correct_source)
end
end
end
end
end
# frozen_string_literal: true
require 'fast_spec_helper'
require 'rubocop'
require_relative '../../../support/helpers/expect_offense'
require_relative '../../../../rubocop/cop/scalability/idempotent_worker'
describe RuboCop::Cop::Scalability::IdempotentWorker do
include CopHelper
include ExpectOffense
subject(:cop) { described_class.new }
before do
allow(cop)
.to receive(:in_worker?)
.and_return(true)
end
it 'adds an offense when not defining idempotent method' do
inspect_source(<<~CODE.strip_indent)
class SomeWorker
end
CODE
expect(cop.offenses.size).to eq(1)
end
it 'adds an offense when not defining idempotent method' do
inspect_source(<<~CODE.strip_indent)
class SomeWorker
idempotent!
end
CODE
expect(cop.offenses.size).to be_zero
end
end
# frozen_string_literal: true
require 'fast_spec_helper'
require 'rubocop'
require 'rspec-parameterized'
require_relative '../../rubocop/migration_helpers'
describe RuboCop::MigrationHelpers do
using RSpec::Parameterized::TableSyntax
subject(:fake_cop) { Class.new { include RuboCop::MigrationHelpers }.new }
let(:node) { double(:node) }
before do
allow(node).to receive_message_chain('location.expression.source_buffer.name')
.and_return(name)
end
describe '#in_migration?' do
where(:name, :expected) do
'/gitlab/db/migrate/20200210184420_create_operations_scopes_table.rb' | true
'/gitlab/db/post_migrate/20200210184420_create_operations_scopes_table.rb' | true
'/gitlab/db/geo/migrate/20200210184420_create_operations_scopes_table.rb' | true
'/gitlab/db/geo/post_migrate/20200210184420_create_operations_scopes_table.rb' | true
'/gitlab/db/elsewhere/20200210184420_create_operations_scopes_table.rb' | false
end
with_them do
it { expect(fake_cop.in_migration?(node)).to eq(expected) }
end
end
describe '#in_post_deployment_migration?' do
where(:name, :expected) do
'/gitlab/db/migrate/20200210184420_create_operations_scopes_table.rb' | false
'/gitlab/db/post_migrate/20200210184420_create_operations_scopes_table.rb' | true
'/gitlab/db/geo/migrate/20200210184420_create_operations_scopes_table.rb' | false
'/gitlab/db/geo/post_migrate/20200210184420_create_operations_scopes_table.rb' | true
'/gitlab/db/elsewhere/20200210184420_create_operations_scopes_table.rb' | false
end
with_them do
it { expect(fake_cop.in_post_deployment_migration?(node)).to eq(expected) }
end
end
describe "#version" do
let(:name) do
'/path/to/gitlab/db/migrate/20200210184420_create_operations_scopes_table.rb'
end
it { expect(fake_cop.version(node)).to eq(20200210184420) }
end
end
...@@ -75,5 +75,47 @@ describe Issuable::Clone::AttributesRewriter do ...@@ -75,5 +75,47 @@ describe Issuable::Clone::AttributesRewriter do
expect(new_issue.reload.milestone).to eq(milestone) expect(new_issue.reload.milestone).to eq(milestone)
end end
context 'with existing milestone events' do
let!(:milestone1_project1) { create(:milestone, title: 'milestone1', project: project1) }
let!(:milestone2_project1) { create(:milestone, title: 'milestone2', project: project1) }
let!(:milestone3_project1) { create(:milestone, title: 'milestone3', project: project1) }
let!(:milestone1_project2) { create(:milestone, title: 'milestone1', project: project2) }
let!(:milestone2_project2) { create(:milestone, title: 'milestone2', project: project2) }
before do
original_issue.update(milestone: milestone2_project1)
create_event(milestone1_project1)
create_event(milestone2_project1)
create_event(milestone1_project1, 'remove')
create_event(milestone3_project1)
end
it 'copies existing resource milestone events' do
subject.execute
new_issue_milestone_events = new_issue.reload.resource_milestone_events
expect(new_issue_milestone_events.count).to eq(3)
expect_milestone_event(new_issue_milestone_events.first, milestone: milestone1_project2, action: 'add', state: 'opened')
expect_milestone_event(new_issue_milestone_events.second, milestone: milestone2_project2, action: 'add', state: 'opened')
expect_milestone_event(new_issue_milestone_events.third, milestone: milestone1_project2, action: 'remove', state: 'opened')
end
def create_event(milestone, action = 'add')
create(:resource_milestone_event, issue: original_issue, milestone: milestone, action: action)
end
def expect_milestone_event(event, expected_attrs)
expect(event.milestone_id).to eq(expected_attrs[:milestone].id)
expect(event.action).to eq(expected_attrs[:action])
expect(event.state).to eq(expected_attrs[:state])
expect(event.reference).to be_nil
expect(event.reference_html).to be_nil
end
end
end end
end end
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
require 'spec_helper' require 'spec_helper'
describe Issuable::CommonSystemNotesService do describe Issuable::CommonSystemNotesService do
let(:user) { create(:user) } let_it_be(:project) { create(:project) }
let(:project) { create(:project) } let_it_be(:user) { create(:user) }
let(:issuable) { create(:issue, project: project) } let(:issuable) { create(:issue, project: project) }
context 'on issuable update' do context 'on issuable update' do
...@@ -35,6 +36,8 @@ describe Issuable::CommonSystemNotesService do ...@@ -35,6 +36,8 @@ describe Issuable::CommonSystemNotesService do
before do before do
milestone = create(:milestone, project: project) milestone = create(:milestone, project: project)
issuable.milestone_id = milestone.id issuable.milestone_id = milestone.id
stub_feature_flags(track_resource_milestone_change_events: false)
end end
it_behaves_like 'system note creation', {}, 'changed milestone' it_behaves_like 'system note creation', {}, 'changed milestone'
...@@ -97,12 +100,39 @@ describe Issuable::CommonSystemNotesService do ...@@ -97,12 +100,39 @@ describe Issuable::CommonSystemNotesService do
expect(event.user_id).to eq user.id expect(event.user_id).to eq user.id
end end
it 'creates a system note for milestone set' do context 'when milestone change event tracking is disabled' do
issuable.milestone = create(:milestone, project: project) before do
issuable.save stub_feature_flags(track_resource_milestone_change_events: false)
expect { subject }.to change { issuable.notes.count }.from(0).to(1) issuable.milestone = create(:milestone, project: project)
expect(issuable.notes.last.note).to match('changed milestone') issuable.save
end
it 'creates a system note for milestone set' do
expect { subject }.to change { issuable.notes.count }.from(0).to(1)
expect(issuable.notes.last.note).to match('changed milestone')
end
it 'does not create a milestone change event' do
expect { subject }.not_to change { ResourceMilestoneEvent.count }
end
end
context 'when milestone change event tracking is enabled' do
let_it_be(:milestone) { create(:milestone, project: project) }
let_it_be(:issuable) { create(:issue, project: project, milestone: milestone) }
before do
stub_feature_flags(track_resource_milestone_change_events: true)
end
it 'does not create a system note for milestone set' do
expect { subject }.not_to change { issuable.notes.count }
end
it 'creates a milestone change event' do
expect { subject }.to change { ResourceMilestoneEvent.count }.from(0).to(1)
end
end end
it 'creates a system note for due_date set' do it 'creates a system note for due_date set' do
......
...@@ -385,6 +385,10 @@ describe Issues::UpdateService, :mailer do ...@@ -385,6 +385,10 @@ describe Issues::UpdateService, :mailer do
end end
context 'when the milestone is removed' do context 'when the milestone is removed' do
before do
stub_feature_flags(track_resource_milestone_change_events: false)
end
let!(:non_subscriber) { create(:user) } let!(:non_subscriber) { create(:user) }
let!(:subscriber) do let!(:subscriber) do
...@@ -411,6 +415,10 @@ describe Issues::UpdateService, :mailer do ...@@ -411,6 +415,10 @@ describe Issues::UpdateService, :mailer do
end end
context 'when the milestone is changed' do context 'when the milestone is changed' do
before do
stub_feature_flags(track_resource_milestone_change_events: false)
end
let!(:non_subscriber) { create(:user) } let!(:non_subscriber) { create(:user) }
let!(:subscriber) do let!(:subscriber) do
......
...@@ -367,6 +367,10 @@ describe MergeRequests::UpdateService, :mailer do ...@@ -367,6 +367,10 @@ describe MergeRequests::UpdateService, :mailer do
end end
context 'when the milestone is removed' do context 'when the milestone is removed' do
before do
stub_feature_flags(track_resource_milestone_change_events: false)
end
let!(:non_subscriber) { create(:user) } let!(:non_subscriber) { create(:user) }
let!(:subscriber) do let!(:subscriber) do
...@@ -393,6 +397,10 @@ describe MergeRequests::UpdateService, :mailer do ...@@ -393,6 +397,10 @@ describe MergeRequests::UpdateService, :mailer do
end end
context 'when the milestone is changed' do context 'when the milestone is changed' do
before do
stub_feature_flags(track_resource_milestone_change_events: false)
end
let!(:non_subscriber) { create(:user) } let!(:non_subscriber) { create(:user) }
let!(:subscriber) do let!(:subscriber) do
......
# frozen_string_literal: true
require 'spec_helper'
describe ResourceEvents::ChangeMilestoneService do
shared_examples 'milestone events creator' do
let_it_be(:user) { create(:user) }
let_it_be(:milestone) { create(:milestone) }
context 'when milestone is present' do
before do
resource.milestone = milestone
end
let(:service) { described_class.new(resource: resource, user: user, created_at: created_at_time) }
it 'creates the expected event record' do
expect { service.execute }.to change { ResourceMilestoneEvent.count }.from(0).to(1)
events = ResourceMilestoneEvent.all
expect(events.size).to eq(1)
expect_event_record(events.first, action: 'add', milestone: milestone, state: 'opened')
end
end
context 'when milestones is not present' do
before do
resource.milestone = nil
end
let(:service) { described_class.new(resource: resource, user: user, created_at: created_at_time) }
it 'creates the expected event records' do
expect { service.execute }.to change { ResourceMilestoneEvent.count }.from(0).to(1)
expect_event_record(ResourceMilestoneEvent.first, action: 'remove', milestone: nil, state: 'opened')
end
end
def expect_event_record(event, expected_attrs)
expect(event.action).to eq(expected_attrs[:action])
expect(event.state).to eq(expected_attrs[:state])
expect(event.user).to eq(user)
expect(event.issue).to eq(resource) if resource.is_a?(Issue)
expect(event.issue).to be_nil unless resource.is_a?(Issue)
expect(event.merge_request).to eq(resource) if resource.is_a?(MergeRequest)
expect(event.merge_request).to be_nil unless resource.is_a?(MergeRequest)
expect(event.milestone).to eq(expected_attrs[:milestone])
expect(event.created_at).to eq(created_at_time)
end
end
let_it_be(:merge_request) { create(:merge_request) }
let_it_be(:issue) { create(:issue) }
let!(:created_at_time) { Time.utc(2019, 12, 30) }
it_behaves_like 'milestone events creator' do
let(:resource) { issue }
end
it_behaves_like 'milestone events creator' do
let(:resource) { merge_request }
end
end
...@@ -119,6 +119,7 @@ RSpec.configure do |config| ...@@ -119,6 +119,7 @@ RSpec.configure do |config|
config.include PolicyHelpers, type: :policy config.include PolicyHelpers, type: :policy
config.include MemoryUsageHelper config.include MemoryUsageHelper
config.include ExpectRequestWithStatus, type: :request config.include ExpectRequestWithStatus, type: :request
config.include IdempotentWorkerHelper, type: :worker
config.include RailsHelpers config.include RailsHelpers
if ENV['CI'] || ENV['RETRIES'] if ENV['CI'] || ENV['RETRIES']
......
# frozen_string_literal: true
module IdempotentWorkerHelper
WORKER_EXEC_TIMES = 2
def perform_multiple(args = [], worker: described_class.new, exec_times: WORKER_EXEC_TIMES)
Sidekiq::Testing.inline! do
job_args = args.nil? ? [nil] : Array.wrap(args)
expect(worker).to receive(:perform).exactly(exec_times).and_call_original
exec_times.times { worker.perform(*job_args) }
end
end
end
...@@ -50,6 +50,8 @@ RSpec.shared_examples 'move quick action' do ...@@ -50,6 +50,8 @@ RSpec.shared_examples 'move quick action' do
let(:bug) { create(:label, project: project, title: 'bug') } let(:bug) { create(:label, project: project, title: 'bug') }
let(:wontfix) { create(:label, project: project, title: 'wontfix') } let(:wontfix) { create(:label, project: project, title: 'wontfix') }
let!(:target_milestone) { create(:milestone, title: '1.0', project: target_project) }
before do before do
target_project.add_maintainer(user) target_project.add_maintainer(user)
end end
......
# frozen_string_literal: true
require 'spec_helper'
shared_examples 'a resource event' do
let_it_be(:user1) { create(:user) }
let_it_be(:user2) { create(:user) }
let_it_be(:issue1) { create(:issue, author: user1) }
let_it_be(:issue2) { create(:issue, author: user1) }
let_it_be(:issue3) { create(:issue, author: user2) }
describe 'validations' do
it { is_expected.not_to allow_value(nil).for(:user) }
end
describe 'associations' do
it { is_expected.to belong_to(:user) }
end
describe '.created_after' do
let!(:created_at1) { 1.day.ago }
let!(:created_at2) { 2.days.ago }
let!(:created_at3) { 3.days.ago }
let!(:event1) { create(described_class.name.underscore.to_sym, issue: issue1, created_at: created_at1) }
let!(:event2) { create(described_class.name.underscore.to_sym, issue: issue2, created_at: created_at2) }
let!(:event3) { create(described_class.name.underscore.to_sym, issue: issue2, created_at: created_at3) }
it 'returns the expected events' do
events = described_class.created_after(created_at3)
expect(events).to contain_exactly(event1, event2)
end
it 'returns no events if time is after last record time' do
events = described_class.created_after(1.minute.ago)
expect(events).to be_empty
end
end
end
shared_examples 'a resource event for issues' do
let_it_be(:user1) { create(:user) }
let_it_be(:user2) { create(:user) }
let_it_be(:issue1) { create(:issue, author: user1) }
let_it_be(:issue2) { create(:issue, author: user1) }
let_it_be(:issue3) { create(:issue, author: user2) }
describe 'associations' do
it { is_expected.to belong_to(:issue) }
end
describe '.by_issue' do
let_it_be(:event1) { create(described_class.name.underscore.to_sym, issue: issue1) }
let_it_be(:event2) { create(described_class.name.underscore.to_sym, issue: issue2) }
let_it_be(:event3) { create(described_class.name.underscore.to_sym, issue: issue1) }
it 'returns the expected records for an issue with events' do
events = described_class.by_issue(issue1)
expect(events).to contain_exactly(event1, event3)
end
it 'returns the expected records for an issue with no events' do
events = described_class.by_issue(issue3)
expect(events).to be_empty
end
end
end
shared_examples 'a resource event for merge requests' do
let_it_be(:user1) { create(:user) }
let_it_be(:user2) { create(:user) }
let_it_be(:merge_request1) { create(:merge_request, author: user1) }
let_it_be(:merge_request2) { create(:merge_request, author: user1) }
let_it_be(:merge_request3) { create(:merge_request, author: user2) }
describe 'associations' do
it { is_expected.to belong_to(:merge_request) }
end
describe '.by_merge_request' do
let_it_be(:event1) { create(described_class.name.underscore.to_sym, merge_request: merge_request1) }
let_it_be(:event2) { create(described_class.name.underscore.to_sym, merge_request: merge_request2) }
let_it_be(:event3) { create(described_class.name.underscore.to_sym, merge_request: merge_request1) }
it 'returns the expected records for an issue with events' do
events = described_class.by_merge_request(merge_request1)
expect(events).to contain_exactly(event1, event3)
end
it 'returns the expected records for an issue with no events' do
events = described_class.by_merge_request(merge_request3)
expect(events).to be_empty
end
end
end
# frozen_string_literal: true
# This shared_example requires the following variables:
# - job_args (if not given, will fallback to call perform without arguments)
#
# Usage:
#
# include_examples 'an idempotent worker' do
# it 'checks the side-effects for multiple calls' do
# # it'll call the job's perform method 3 times
# # by default.
# subject
#
# expect(model.state).to eq('state')
# end
# end
#
RSpec.shared_examples 'an idempotent worker' do
# Avoid stubbing calls for a more accurate run.
subject do
defined?(job_args) ? perform_multiple(job_args) : perform_multiple
end
it 'is labeled as idempotent' do
expect(described_class).to be_idempotent
end
it 'performs multiple times sequentially without raising an exception' do
expect { subject }.not_to raise_error
end
end
...@@ -11,7 +11,7 @@ describe BackgroundMigrationWorker, :clean_gitlab_redis_shared_state do ...@@ -11,7 +11,7 @@ describe BackgroundMigrationWorker, :clean_gitlab_redis_shared_state do
end end
end end
describe '.perform' do describe '#perform' do
it 'performs a background migration' do it 'performs a background migration' do
expect(Gitlab::BackgroundMigration) expect(Gitlab::BackgroundMigration)
.to receive(:perform) .to receive(:perform)
...@@ -52,6 +52,14 @@ describe BackgroundMigrationWorker, :clean_gitlab_redis_shared_state do ...@@ -52,6 +52,14 @@ describe BackgroundMigrationWorker, :clean_gitlab_redis_shared_state do
worker.perform('Foo', [10, 20]) worker.perform('Foo', [10, 20])
end end
it 'sets the class that will be executed as the caller_id' do
expect(Gitlab::BackgroundMigration).to receive(:perform) do
expect(Labkit::Context.current.to_h).to include('meta.caller_id' => 'Foo')
end
worker.perform('Foo', [10, 20])
end
end end
describe '#healthy_database?' do describe '#healthy_database?' do
......
...@@ -6,20 +6,32 @@ describe ExpireJobCacheWorker do ...@@ -6,20 +6,32 @@ describe ExpireJobCacheWorker do
set(:pipeline) { create(:ci_empty_pipeline) } set(:pipeline) { create(:ci_empty_pipeline) }
let(:project) { pipeline.project } let(:project) { pipeline.project }
subject { described_class.new }
describe '#perform' do describe '#perform' do
context 'with a job in the pipeline' do context 'with a job in the pipeline' do
let(:job) { create(:ci_build, pipeline: pipeline) } let(:job) { create(:ci_build, pipeline: pipeline) }
let(:job_args) { job.id }
include_examples 'an idempotent worker' do
it 'invalidates Etag caching for the job path' do
pipeline_path = "/#{project.full_path}/pipelines/#{pipeline.id}.json"
job_path = "/#{project.full_path}/builds/#{job.id}.json"
spy_store = Gitlab::EtagCaching::Store.new
allow(Gitlab::EtagCaching::Store).to receive(:new) { spy_store }
it 'invalidates Etag caching for the job path' do expect(spy_store).to receive(:touch)
pipeline_path = "/#{project.full_path}/pipelines/#{pipeline.id}.json" .exactly(IdempotentWorkerHelper::WORKER_EXEC_TIMES).times
job_path = "/#{project.full_path}/builds/#{job.id}.json" .with(pipeline_path)
.and_call_original
expect_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch).with(pipeline_path) expect(spy_store).to receive(:touch)
expect_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch).with(job_path) .exactly(IdempotentWorkerHelper::WORKER_EXEC_TIMES).times
.with(job_path)
.and_call_original
subject.perform(job.id) subject
end
end end
end end
...@@ -27,7 +39,7 @@ describe ExpireJobCacheWorker do ...@@ -27,7 +39,7 @@ describe ExpireJobCacheWorker do
it 'does not change the etag store' do it 'does not change the etag store' do
expect(Gitlab::EtagCaching::Store).not_to receive(:new) expect(Gitlab::EtagCaching::Store).not_to receive(:new)
subject.perform(9999) perform_multiple(9999)
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment