2018-07-18 12:03:33 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-07-20 11:12:06 -04:00
|
|
|
module TestHooks
|
|
|
|
class ProjectService < TestHooks::BaseService
|
2020-06-09 08:08:55 -04:00
|
|
|
include Integrations::ProjectTestData
|
|
|
|
include Gitlab::Utils::StrongMemoize
|
|
|
|
|
2018-05-21 22:24:37 -04:00
|
|
|
attr_writer :project
|
2017-07-20 11:12:06 -04:00
|
|
|
|
|
|
|
def project
|
|
|
|
@project ||= hook.project
|
|
|
|
end
|
|
|
|
|
2018-05-21 22:24:37 -04:00
|
|
|
private
|
|
|
|
|
2020-06-09 08:08:55 -04:00
|
|
|
def data
|
|
|
|
strong_memoize(:data) do
|
|
|
|
case trigger
|
|
|
|
when 'push_events', 'tag_push_events'
|
|
|
|
push_events_data
|
|
|
|
when 'note_events'
|
|
|
|
note_events_data
|
|
|
|
when 'issues_events', 'confidential_issues_events'
|
|
|
|
issues_events_data
|
|
|
|
when 'merge_requests_events'
|
|
|
|
merge_requests_events_data
|
|
|
|
when 'job_events'
|
|
|
|
job_events_data
|
|
|
|
when 'pipeline_events'
|
|
|
|
pipeline_events_data
|
|
|
|
when 'wiki_page_events'
|
|
|
|
wiki_page_events_data
|
2020-11-06 19:08:58 -05:00
|
|
|
when 'releases_events'
|
|
|
|
releases_events_data
|
2020-06-09 08:08:55 -04:00
|
|
|
end
|
2017-07-20 11:12:06 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|