debian-mirror-gitlab/app/services/merge_requests/mergeability/check_base_service.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
788 B
Ruby
Raw Normal View History

2021-11-18 22:05:49 +05:30
# frozen_string_literal: true
module MergeRequests
module Mergeability
class CheckBaseService
attr_reader :merge_request, :params
def initialize(merge_request:, params:)
@merge_request = merge_request
@params = params
end
def skip?
raise NotImplementedError
end
# When this method is true, we need to implement a cache_key
def cacheable?
raise NotImplementedError
end
def cache_key
raise NotImplementedError
end
private
2022-08-27 11:52:29 +05:30
def success(**args)
Gitlab::MergeRequests::Mergeability::CheckResult.success(payload: args)
2021-11-18 22:05:49 +05:30
end
2022-08-27 11:52:29 +05:30
def failure(**args)
Gitlab::MergeRequests::Mergeability::CheckResult.failed(payload: args)
2021-11-18 22:05:49 +05:30
end
end
end
end