From 2e067480a9824228542c229a09aa4b6f006dc6f3 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin <godfat@godfat.org> Date: Mon, 17 Oct 2016 18:12:07 +0800 Subject: [PATCH] Rename for a more consistent pipeline worker name, feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6342/diffs#note_17039533 --- app/models/ci/pipeline.rb | 2 +- app/models/project_services/pipelines_email_service.rb | 2 +- ...e_notification_worker.rb => pipeline_notification_worker.rb} | 2 +- ...tion_worker_spec.rb => pipeline_notification_worker_spec.rb} | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename app/workers/{send_pipeline_notification_worker.rb => pipeline_notification_worker.rb} (84%) rename spec/workers/{send_pipeline_notification_worker_spec.rb => pipeline_notification_worker_spec.rb} (98%) diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 2a0865abd4b..5604296cba5 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -85,7 +85,7 @@ module Ci after_transition any => [:success, :failed] do |pipeline| pipeline.run_after_commit do - SendPipelineNotificationWorker.perform_async(pipeline.id) + PipelineNotificationWorker.perform_async(pipeline.id) end end end diff --git a/app/models/project_services/pipelines_email_service.rb b/app/models/project_services/pipelines_email_service.rb index e2cb1df81b5..745f9bd1b43 100644 --- a/app/models/project_services/pipelines_email_service.rb +++ b/app/models/project_services/pipelines_email_service.rb @@ -32,7 +32,7 @@ class PipelinesEmailService < Service return unless all_recipients.any? pipeline_id = data[:object_attributes][:id] - SendPipelineNotificationWorker.new.perform(pipeline_id, all_recipients) + PipelineNotificationWorker.new.perform(pipeline_id, all_recipients) end def can_test? diff --git a/app/workers/send_pipeline_notification_worker.rb b/app/workers/pipeline_notification_worker.rb similarity index 84% rename from app/workers/send_pipeline_notification_worker.rb rename to app/workers/pipeline_notification_worker.rb index d4837d815a5..f4e9a4cf245 100644 --- a/app/workers/send_pipeline_notification_worker.rb +++ b/app/workers/pipeline_notification_worker.rb @@ -1,4 +1,4 @@ -class SendPipelineNotificationWorker +class PipelineNotificationWorker include Sidekiq::Worker def perform(pipeline_id, recipients = nil) diff --git a/spec/workers/send_pipeline_notification_worker_spec.rb b/spec/workers/pipeline_notification_worker_spec.rb similarity index 98% rename from spec/workers/send_pipeline_notification_worker_spec.rb rename to spec/workers/pipeline_notification_worker_spec.rb index 8d358992c7c..c641d7a7801 100644 --- a/spec/workers/send_pipeline_notification_worker_spec.rb +++ b/spec/workers/pipeline_notification_worker_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe SendPipelineNotificationWorker do +describe PipelineNotificationWorker do let(:pipeline) do create(:ci_pipeline, project: project, -- GitLab