2020-06-09 08:08:55 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Integrations
|
|
|
|
module Test
|
|
|
|
class ProjectService < Integrations::Test::BaseService
|
|
|
|
include Integrations::ProjectTestData
|
|
|
|
include Gitlab::Utils::StrongMemoize
|
|
|
|
|
|
|
|
def project
|
|
|
|
strong_memoize(:project) do
|
|
|
|
integration.project
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def data
|
|
|
|
strong_memoize(:data) do
|
2020-11-26 16:09:22 -05:00
|
|
|
case event || integration.default_test_event
|
2020-06-09 08:08:55 -04:00
|
|
|
when 'push', 'tag_push'
|
|
|
|
push_events_data
|
|
|
|
when 'note', 'confidential_note'
|
|
|
|
note_events_data
|
|
|
|
when 'issue', 'confidential_issue'
|
|
|
|
issues_events_data
|
|
|
|
when 'merge_request'
|
|
|
|
merge_requests_events_data
|
|
|
|
when 'job'
|
|
|
|
job_events_data
|
|
|
|
when 'pipeline'
|
|
|
|
pipeline_events_data
|
|
|
|
when 'wiki_page'
|
|
|
|
wiki_page_events_data
|
|
|
|
when 'deployment'
|
|
|
|
deployment_events_data
|
2020-11-06 19:08:58 -05:00
|
|
|
when 'release'
|
|
|
|
releases_events_data
|
2020-06-09 08:08:55 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-05-11 17:10:21 -04:00
|
|
|
Integrations::Test::ProjectService.prepend_mod_with('Integrations::Test::ProjectService')
|