debian-mirror-gitlab/app/models/project_services/hipchat_service.rb

33 lines
948 B
Ruby
Raw Normal View History

2018-11-20 20:47:30 +05:30
# frozen_string_literal: true
2021-06-08 01:23:25 +05:30
# This service is scheduled for removal. All records must
# be deleted before the class can be removed.
# https://gitlab.com/gitlab-org/gitlab/-/issues/27954
class HipchatService < Integration
before_save :prevent_save
2014-09-02 18:07:02 +05:30
2017-08-17 22:00:37 +05:30
def self.to_param
2014-09-02 18:07:02 +05:30
'hipchat'
end
2017-08-17 22:00:37 +05:30
def self.supported_events
2021-06-08 01:23:25 +05:30
[]
2015-04-26 12:48:37 +05:30
end
def execute(data)
2021-04-01 16:36:13 +05:30
# We removed the hipchat gem due to https://gitlab.com/gitlab-org/gitlab/-/issues/325851#note_537143149
# HipChat is unusable anyway, so do nothing in this method
2015-09-11 14:41:01 +05:30
end
2014-09-02 18:07:02 +05:30
private
2021-06-08 01:23:25 +05:30
def prevent_save
errors.add(:base, _('HipChat endpoint is deprecated and should not be created or modified.'))
2015-12-23 02:04:40 +05:30
2021-06-08 01:23:25 +05:30
# Stops execution of callbacks and database operation while
# preserving expectations of #save (will not raise) & #save! (raises)
# https://guides.rubyonrails.org/active_record_callbacks.html#halting-execution
throw :abort # rubocop:disable Cop/BanCatchThrow
2015-12-23 02:04:40 +05:30
end
2014-09-02 18:07:02 +05:30
end