Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
aae855a1
Commit
aae855a1
authored
Jun 28, 2021
by
Sean Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename workers to fit naming scheme
- Use IncidentManagement::PendingEscalations prefix
parent
b37910ec
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
35 additions
and
43 deletions
+35
-43
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+1
-1
config/sidekiq_queues.yml
config/sidekiq_queues.yml
+2
-2
ee/app/services/incident_management/pending_escalations/create_service.rb
...incident_management/pending_escalations/create_service.rb
+1
-1
ee/app/workers/all_queues.yml
ee/app/workers/all_queues.yml
+18
-18
ee/app/workers/incident_management/pending_escalations/alert_check_worker.rb
...dent_management/pending_escalations/alert_check_worker.rb
+3
-11
ee/app/workers/incident_management/pending_escalations/schedule_check_cron_worker.rb
...agement/pending_escalations/schedule_check_cron_worker.rb
+3
-3
ee/spec/services/incident_management/pending_escalations/create_service_spec.rb
...ent_management/pending_escalations/create_service_spec.rb
+1
-1
ee/spec/support/shared_examples/services/alert_management/alert_processing/escalation_policies_shared_examples.rb
...t/alert_processing/escalation_policies_shared_examples.rb
+1
-1
ee/spec/workers/incident_management/pending_escalations/alert_check_worker_spec.rb
...management/pending_escalations/alert_check_worker_spec.rb
+3
-3
ee/spec/workers/incident_management/pending_escalations/schedule_check_cron_worker_spec.rb
...nt/pending_escalations/schedule_check_cron_worker_spec.rb
+2
-2
No files found.
config/initializers/1_settings.rb
View file @
aae855a1
...
@@ -647,7 +647,7 @@ Gitlab.ee do
...
@@ -647,7 +647,7 @@ Gitlab.ee do
Settings
.
cron_jobs
[
'incident_management_persist_oncall_rotation_worker'
][
'job_class'
]
=
'IncidentManagement::OncallRotations::PersistAllRotationsShiftsJob'
Settings
.
cron_jobs
[
'incident_management_persist_oncall_rotation_worker'
][
'job_class'
]
=
'IncidentManagement::OncallRotations::PersistAllRotationsShiftsJob'
Settings
.
cron_jobs
[
'incident_management_schedule_escalation_check_worker'
]
||=
Settingslogic
.
new
({})
Settings
.
cron_jobs
[
'incident_management_schedule_escalation_check_worker'
]
||=
Settingslogic
.
new
({})
Settings
.
cron_jobs
[
'incident_management_schedule_escalation_check_worker'
][
'cron'
]
||=
'*/1 * * * *'
Settings
.
cron_jobs
[
'incident_management_schedule_escalation_check_worker'
][
'cron'
]
||=
'*/1 * * * *'
Settings
.
cron_jobs
[
'incident_management_schedule_escalation_check_worker'
][
'job_class'
]
=
'IncidentManagement::
Escalations::ScheduleEscalation
CheckCronWorker'
Settings
.
cron_jobs
[
'incident_management_schedule_escalation_check_worker'
][
'job_class'
]
=
'IncidentManagement::
PendingEscalations::Schedule
CheckCronWorker'
Settings
.
cron_jobs
[
'import_software_licenses_worker'
]
||=
Settingslogic
.
new
({})
Settings
.
cron_jobs
[
'import_software_licenses_worker'
]
||=
Settingslogic
.
new
({})
Settings
.
cron_jobs
[
'import_software_licenses_worker'
][
'cron'
]
||=
'0 3 * * 0'
Settings
.
cron_jobs
[
'import_software_licenses_worker'
][
'cron'
]
||=
'0 3 * * 0'
Settings
.
cron_jobs
[
'import_software_licenses_worker'
][
'job_class'
]
=
'ImportSoftwareLicensesWorker'
Settings
.
cron_jobs
[
'import_software_licenses_worker'
][
'job_class'
]
=
'ImportSoftwareLicensesWorker'
...
...
config/sidekiq_queues.yml
View file @
aae855a1
...
@@ -180,10 +180,10 @@
...
@@ -180,10 +180,10 @@
-
2
-
2
-
-
incident_management_apply_incident_sla_exceeded_label
-
-
incident_management_apply_incident_sla_exceeded_label
-
1
-
1
-
-
incident_management_escalations_pending_alert_escalation_check
-
1
-
-
incident_management_oncall_rotations_persist_shifts_job
-
-
incident_management_oncall_rotations_persist_shifts_job
-
1
-
1
-
-
incident_management_pending_escalations_alert_check
-
1
-
-
invalid_gpg_signature_update
-
-
invalid_gpg_signature_update
-
2
-
2
-
-
irker
-
-
irker
...
...
ee/app/services/incident_management/pending_escalations/create_service.rb
View file @
aae855a1
...
@@ -52,7 +52,7 @@ module IncidentManagement
...
@@ -52,7 +52,7 @@ module IncidentManagement
def
process_escalations
(
escalation_ids
)
def
process_escalations
(
escalation_ids
)
args
=
escalation_ids
.
map
{
|
id
|
[
id
]
}
args
=
escalation_ids
.
map
{
|
id
|
[
id
]
}
::
IncidentManagement
::
Escalations
::
PendingAlertEscalation
CheckWorker
.
bulk_perform_async
(
args
)
# rubocop:disable Scalability/BulkPerformWithContext
::
IncidentManagement
::
PendingEscalations
::
Alert
CheckWorker
.
bulk_perform_async
(
args
)
# rubocop:disable Scalability/BulkPerformWithContext
end
end
end
end
end
end
...
...
ee/app/workers/all_queues.yml
View file @
aae855a1
...
@@ -294,15 +294,6 @@
...
@@ -294,15 +294,6 @@
:weight:
1
:weight:
1
:idempotent:
:idempotent:
:tags: []
:tags: []
-
:name: cronjob:incident_management_escalations_schedule_escalation_check_cron
:worker_name: IncidentManagement::Escalations::ScheduleEscalationCheckCronWorker
:feature_category: :incident_management
:has_external_dependencies:
:urgency: :low
:resource_boundary: :unknown
:weight:
1
:idempotent:
true
:tags: []
-
:name: cronjob:incident_management_incident_sla_exceeded_check
-
:name: cronjob:incident_management_incident_sla_exceeded_check
:worker_name: IncidentManagement::IncidentSlaExceededCheckWorker
:worker_name: IncidentManagement::IncidentSlaExceededCheckWorker
:feature_category: :incident_management
:feature_category: :incident_management
...
@@ -323,6 +314,15 @@
...
@@ -323,6 +314,15 @@
:idempotent:
true
:idempotent:
true
:tags:
:tags:
- :exclude_from_kubernetes
- :exclude_from_kubernetes
-
:name: cronjob:incident_management_pending_escalations_schedule_check_cron
:worker_name: IncidentManagement::PendingEscalations::ScheduleCheckCronWorker
:feature_category: :incident_management
:has_external_dependencies:
:urgency: :low
:resource_boundary: :unknown
:weight:
1
:idempotent:
true
:tags: []
-
:name: cronjob:iterations_cadences_create_iterations
-
:name: cronjob:iterations_cadences_create_iterations
:worker_name: Iterations::Cadences::CreateIterationsWorker
:worker_name: Iterations::Cadences::CreateIterationsWorker
:feature_category: :issue_tracking
:feature_category: :issue_tracking
...
@@ -1053,15 +1053,6 @@
...
@@ -1053,15 +1053,6 @@
:idempotent:
true
:idempotent:
true
:tags:
:tags:
- :exclude_from_kubernetes
- :exclude_from_kubernetes
-
:name: incident_management_escalations_pending_alert_escalation_check
:worker_name: IncidentManagement::Escalations::PendingAlertEscalationCheckWorker
:feature_category: :incident_management
:has_external_dependencies:
:urgency: :high
:resource_boundary: :unknown
:weight:
1
:idempotent:
true
:tags: []
-
:name: incident_management_oncall_rotations_persist_shifts_job
-
:name: incident_management_oncall_rotations_persist_shifts_job
:worker_name: IncidentManagement::OncallRotations::PersistShiftsJob
:worker_name: IncidentManagement::OncallRotations::PersistShiftsJob
:feature_category: :incident_management
:feature_category: :incident_management
...
@@ -1072,6 +1063,15 @@
...
@@ -1072,6 +1063,15 @@
:idempotent:
true
:idempotent:
true
:tags:
:tags:
- :exclude_from_kubernetes
- :exclude_from_kubernetes
-
:name: incident_management_pending_escalations_alert_check
:worker_name: IncidentManagement::PendingEscalations::AlertCheckWorker
:feature_category: :incident_management
:has_external_dependencies:
:urgency: :high
:resource_boundary: :unknown
:weight:
1
:idempotent:
true
:tags: []
-
:name: ldap_group_sync
-
:name: ldap_group_sync
:worker_name: LdapGroupSyncWorker
:worker_name: LdapGroupSyncWorker
:feature_category: :authentication_and_authorization
:feature_category: :authentication_and_authorization
...
...
ee/app/workers/incident_management/
escalations/pending_alert_escalation
_check_worker.rb
→
ee/app/workers/incident_management/
pending_escalations/alert
_check_worker.rb
View file @
aae855a1
# frozen_string_literal: true
# frozen_string_literal: true
module
IncidentManagement
module
IncidentManagement
module
Escalations
module
Pending
Escalations
class
PendingAlertEscalation
CheckWorker
class
Alert
CheckWorker
include
ApplicationWorker
include
ApplicationWorker
urgency
:high
urgency
:high
...
@@ -10,19 +10,11 @@ module IncidentManagement
...
@@ -10,19 +10,11 @@ module IncidentManagement
idempotent!
idempotent!
feature_category
:incident_management
feature_category
:incident_management
def
initialize
(
escalation_id
)
def
perform
(
escalation_id
)
@escalation_id
=
escalation_id
end
def
perform
escalation
=
IncidentManagement
::
PendingEscalations
::
Alert
.
find
(
escalation_id
)
escalation
=
IncidentManagement
::
PendingEscalations
::
Alert
.
find
(
escalation_id
)
IncidentManagement
::
PendingEscalations
::
ProcessService
.
new
(
escalation
).
execute
IncidentManagement
::
PendingEscalations
::
ProcessService
.
new
(
escalation
).
execute
end
end
private
attr_reader
:escalation_id
end
end
end
end
end
end
ee/app/workers/incident_management/
escalations/schedule_escalation
_check_cron_worker.rb
→
ee/app/workers/incident_management/
pending_escalations/schedule
_check_cron_worker.rb
View file @
aae855a1
# frozen_string_literal: true
# frozen_string_literal: true
module
IncidentManagement
module
IncidentManagement
module
Escalations
module
Pending
Escalations
class
Schedule
Escalation
CheckCronWorker
class
ScheduleCheckCronWorker
include
ApplicationWorker
include
ApplicationWorker
# This worker does not perform work scoped to a context
# This worker does not perform work scoped to a context
include
CronjobQueue
# rubocop:disable Scalability/CronWorkerContext
include
CronjobQueue
# rubocop:disable Scalability/CronWorkerContext
...
@@ -13,7 +13,7 @@ module IncidentManagement
...
@@ -13,7 +13,7 @@ module IncidentManagement
def
perform
def
perform
::
IncidentManagement
::
PendingEscalations
::
Alert
.
processable
.
each_batch
do
|
relation
|
::
IncidentManagement
::
PendingEscalations
::
Alert
.
processable
.
each_batch
do
|
relation
|
args
=
relation
.
pluck
(
:id
).
map
{
|
id
|
[
id
]
}
# rubocop:disable CodeReuse/ActiveRecord
args
=
relation
.
pluck
(
:id
).
map
{
|
id
|
[
id
]
}
# rubocop:disable CodeReuse/ActiveRecord
::
IncidentManagement
::
Escalations
::
PendingAlertEscalation
CheckWorker
.
bulk_perform_async
(
args
)
# rubocop:disable Scalability/BulkPerformWithContext
::
IncidentManagement
::
PendingEscalations
::
Alert
CheckWorker
.
bulk_perform_async
(
args
)
# rubocop:disable Scalability/BulkPerformWithContext
end
end
end
end
end
end
...
...
ee/spec/services/incident_management/pending_escalations/create_service_spec.rb
View file @
aae855a1
...
@@ -54,7 +54,7 @@ RSpec.describe IncidentManagement::PendingEscalations::CreateService do
...
@@ -54,7 +54,7 @@ RSpec.describe IncidentManagement::PendingEscalations::CreateService do
end
end
it
'creates the escalations and queues the escalation process check'
do
it
'creates the escalations and queues the escalation process check'
do
expect
(
IncidentManagement
::
Escalations
::
PendingAlertEscalation
CheckWorker
)
expect
(
IncidentManagement
::
PendingEscalations
::
Alert
CheckWorker
)
.
to
receive
(
:bulk_perform_async
)
.
to
receive
(
:bulk_perform_async
)
.
with
([[
a_kind_of
(
Integer
)],
[
a_kind_of
(
Integer
)]])
.
with
([[
a_kind_of
(
Integer
)],
[
a_kind_of
(
Integer
)]])
...
...
ee/spec/support/shared_examples/services/alert_management/alert_processing/escalation_policies_shared_examples.rb
View file @
aae855a1
...
@@ -11,7 +11,7 @@ RSpec.shared_examples 'creates an escalation' do |count|
...
@@ -11,7 +11,7 @@ RSpec.shared_examples 'creates an escalation' do |count|
expected_args
=
[]
expected_args
=
[]
count
.
times
{
expected_args
<<
[
a_kind_of
(
Integer
)]}
count
.
times
{
expected_args
<<
[
a_kind_of
(
Integer
)]}
expect
(
IncidentManagement
::
Escalations
::
PendingAlertEscalation
CheckWorker
)
expect
(
IncidentManagement
::
PendingEscalations
::
Alert
CheckWorker
)
.
to
receive
(
:bulk_perform_async
)
.
to
receive
(
:bulk_perform_async
)
.
with
(
expected_args
)
.
with
(
expected_args
)
...
...
ee/spec/workers/incident_management/
escalations/pending_alert_escalation
_check_worker_spec.rb
→
ee/spec/workers/incident_management/
pending_escalations/alert
_check_worker_spec.rb
View file @
aae855a1
...
@@ -2,13 +2,13 @@
...
@@ -2,13 +2,13 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
IncidentManagement
::
Escalations
::
PendingAlertEscalation
CheckWorker
do
RSpec
.
describe
IncidentManagement
::
PendingEscalations
::
Alert
CheckWorker
do
let
(
:worker
)
{
described_class
.
new
(
escalation
.
id
)
}
let
(
:worker
)
{
described_class
.
new
}
let_it_be
(
:escalation
)
{
create
(
:incident_management_pending_alert_escalation
)
}
let_it_be
(
:escalation
)
{
create
(
:incident_management_pending_alert_escalation
)
}
describe
'#perform'
do
describe
'#perform'
do
subject
{
worker
.
perform
}
subject
{
worker
.
perform
(
escalation
.
id
)
}
it
'processes the escalation'
do
it
'processes the escalation'
do
process_service
=
spy
(
IncidentManagement
::
PendingEscalations
::
ProcessService
)
process_service
=
spy
(
IncidentManagement
::
PendingEscalations
::
ProcessService
)
...
...
ee/spec/workers/incident_management/
escalations/schedule_escalation
_check_cron_worker_spec.rb
→
ee/spec/workers/incident_management/
pending_escalations/schedule
_check_cron_worker_spec.rb
View file @
aae855a1
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
IncidentManagement
::
Escalations
::
ScheduleEscalation
CheckCronWorker
do
RSpec
.
describe
IncidentManagement
::
PendingEscalations
::
Schedule
CheckCronWorker
do
let
(
:worker
)
{
described_class
.
new
}
let
(
:worker
)
{
described_class
.
new
}
let_it_be
(
:escalation_1
)
{
create
(
:incident_management_pending_alert_escalation
,
process_at:
5
.
minutes
.
ago
)
}
let_it_be
(
:escalation_1
)
{
create
(
:incident_management_pending_alert_escalation
,
process_at:
5
.
minutes
.
ago
)
}
...
@@ -13,7 +13,7 @@ RSpec.describe IncidentManagement::Escalations::ScheduleEscalationCheckCronWorke
...
@@ -13,7 +13,7 @@ RSpec.describe IncidentManagement::Escalations::ScheduleEscalationCheckCronWorke
subject
{
worker
.
perform
}
subject
{
worker
.
perform
}
it
'schedules a job for each processable escalation'
do
it
'schedules a job for each processable escalation'
do
expect
(
IncidentManagement
::
Escalations
::
PendingAlertEscalation
CheckWorker
).
to
receive
(
:bulk_perform_async
)
expect
(
IncidentManagement
::
PendingEscalations
::
Alert
CheckWorker
).
to
receive
(
:bulk_perform_async
)
.
with
(
array_including
([
escalation_2
.
id
],
[
escalation_1
.
id
]))
.
with
(
array_including
([
escalation_2
.
id
],
[
escalation_1
.
id
]))
subject
subject
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment