diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /app/workers/incident_management | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'app/workers/incident_management')
-rw-r--r-- | app/workers/incident_management/process_alert_worker.rb | 56 | ||||
-rw-r--r-- | app/workers/incident_management/process_prometheus_alert_worker.rb | 23 |
2 files changed, 0 insertions, 79 deletions
diff --git a/app/workers/incident_management/process_alert_worker.rb b/app/workers/incident_management/process_alert_worker.rb deleted file mode 100644 index 3b90e296ad4..00000000000 --- a/app/workers/incident_management/process_alert_worker.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -module IncidentManagement - class ProcessAlertWorker # rubocop:disable Scalability/IdempotentWorker - include ApplicationWorker - - sidekiq_options retry: 3 - - queue_namespace :incident_management - feature_category :incident_management - - # `project_id` and `alert_payload` are deprecated and can be removed - # starting from 14.0 release - # https://gitlab.com/gitlab-org/gitlab/-/issues/224500 - # - # This worker is not scheduled anymore since - # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60285 - # and will be removed completely via - # https://gitlab.com/gitlab-org/gitlab/-/issues/224500 - # in 14.0. - def perform(_project_id = nil, _alert_payload = nil, alert_id = nil) - return unless alert_id - - alert = find_alert(alert_id) - return unless alert - - result = create_issue_for(alert) - return if result.success? - - log_warning(alert, result) - end - - private - - def find_alert(alert_id) - AlertManagement::Alert.find_by_id(alert_id) - end - - def create_issue_for(alert) - AlertManagement::CreateAlertIssueService - .new(alert, User.alert_bot) - .execute - end - - def log_warning(alert, result) - issue_id = result.payload[:issue]&.id - - Gitlab::AppLogger.warn( - message: 'Cannot process an Incident', - issue_id: issue_id, - alert_id: alert.id, - errors: result.message - ) - end - end -end diff --git a/app/workers/incident_management/process_prometheus_alert_worker.rb b/app/workers/incident_management/process_prometheus_alert_worker.rb deleted file mode 100644 index 7b5c6fd9001..00000000000 --- a/app/workers/incident_management/process_prometheus_alert_worker.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -module IncidentManagement - class ProcessPrometheusAlertWorker # rubocop:disable Scalability/IdempotentWorker - include ApplicationWorker - - sidekiq_options retry: 3 - - queue_namespace :incident_management - feature_category :incident_management - worker_resource_boundary :cpu - - def perform(project_id, alert_hash) - # no-op - # - # This worker is not scheduled anymore since - # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/35943 - # and will be removed completely via - # https://gitlab.com/gitlab-org/gitlab/-/issues/227146 - # in 14.0. - end - end -end |