Commit de0b84a8 authored by Peter Leitzen's avatar Peter Leitzen

Rename PublishIncidentService to PublishService

Also rename PublishIncidentWorker to PublishService
for consistency.
parent 57a36570
......@@ -234,7 +234,7 @@
- 2
- - service_desk_email_receiver
- 1
- - status_page_publish_incident
- - status_page_publish
- 1
- - sync_seat_link_request
- 1
......
......@@ -4,9 +4,9 @@ module StatusPage
# Render an issue as incident details and publish them to CDN.
#
# This is an internal service which is part of
# +StatusPage::PublishIncidentService+ and is not meant to be called directly.
# +StatusPage::PublishService+ and is not meant to be called directly.
#
# Consider calling +StatusPage::PublishIncidentService+ instead.
# Consider calling +StatusPage::PublishService+ instead.
class PublishDetailsService < PublishBaseService
private
......
......@@ -4,9 +4,9 @@ module StatusPage
# Render a list of issues as incidents and publish them to CDN.
#
# This is an internal service which is part of
# +StatusPage::PublishIncidentService+ and is not meant to be called directly.
# +StatusPage::PublishService+ and is not meant to be called directly.
#
# Consider calling +StatusPage::PublishIncidentService+ instead.
# Consider calling +StatusPage::PublishService+ instead.
class PublishListService < PublishBaseService
private
......
......@@ -11,7 +11,7 @@ module StatusPage
# * StatusPage::PublishDetailsService
# * StatusPage::UnpublishDetailsService
# * StatusPage::PublishListService
class PublishIncidentService
class PublishService
include Gitlab::Utils::StrongMemoize
def initialize(user:, project:, issue_id:)
......
......@@ -15,8 +15,7 @@ module StatusPage
return unless can_publish?
return unless status_page_enabled?
StatusPage::PublishIncidentWorker
.perform_async(user.id, project.id, issue_id)
StatusPage::PublishWorker.perform_async(user.id, project.id, issue_id)
end
private
......
......@@ -6,9 +6,9 @@ module StatusPage
# Example: An issue becomes confidential so it must be removed from CDN.
#
# This is an internal service which is part of
# +StatusPage::PublishIncidentService+ and is not meant to be called directly.
# +StatusPage::PublishService+ and is not meant to be called directly.
#
# Consider calling +StatusPage::PublishIncidentService+ instead.
# Consider calling +StatusPage::PublishService+ instead.
class UnpublishDetailsService < PublishBaseService
private
......
......@@ -33,7 +33,7 @@
:idempotent: true
- :name: cronjob:elastic_metrics_update
:feature_category: :global_search
:has_external_dependencies:
:has_external_dependencies:
:urgency: :low
:resource_boundary: :unknown
:weight: 1
......@@ -577,7 +577,7 @@
:resource_boundary: :unknown
:weight: 1
:idempotent:
- :name: status_page_publish_incident
- :name: status_page_publish
:feature_category: :status_page
:has_external_dependencies: true
:urgency: :low
......
# frozen_string_literal: true
module StatusPage
class PublishIncidentWorker
class PublishWorker
include ApplicationWorker
include Gitlab::Utils::StrongMemoize
......@@ -26,7 +26,7 @@ module StatusPage
attr_reader :user_id, :project_id, :issue_id
def publish
result = PublishIncidentService
result = PublishService
.new(user: user, project: project, issue_id: issue_id)
.execute
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe StatusPage::PublishIncidentService do
describe StatusPage::PublishService do
let_it_be(:user) { create(:user) }
let_it_be(:project, refind: true) { create(:project) }
let_it_be(:issue) { create(:issue, project: project) }
......
......@@ -7,7 +7,7 @@ describe StatusPage::TriggerPublishService do
let_it_be(:project, refind: true) { create(:project) }
let_it_be(:issue) { create(:issue, project: project) }
let(:service) { described_class.new(user: user, project: project) }
let(:worker) { StatusPage::PublishIncidentWorker }
let(:worker) { StatusPage::PublishWorker }
let_it_be(:status_page_setting) do
create(:status_page_setting, :enabled, project: project)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe StatusPage::PublishIncidentWorker do
describe StatusPage::PublishWorker do
include ExclusiveLeaseHelpers
let_it_be(:user) { create(:user) }
......@@ -11,11 +11,11 @@ describe StatusPage::PublishIncidentWorker do
let(:worker) { described_class.new }
let(:logger) { worker.send(:logger) }
let(:service) { instance_double(StatusPage::PublishIncidentService) }
let(:service) { instance_double(StatusPage::PublishService) }
let(:service_result) { ServiceResponse.success }
before do
allow(StatusPage::PublishIncidentService)
allow(StatusPage::PublishService)
.to receive(:new).with(user: user, project: project, issue_id: issue.id)
.and_return(service)
allow(service).to receive(:execute)
......@@ -40,7 +40,7 @@ describe StatusPage::PublishIncidentWorker do
let(:project) { build(:project) }
it 'does not execute the service' do
expect(StatusPage::PublishIncidentService).not_to receive(:execute)
expect(StatusPage::PublishService).not_to receive(:execute)
subject
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