Commit ecfc5247 authored by Igor Drozdov's avatar Igor Drozdov

Merge branch 'pb-add-approval-wrapped-rules-explanation' into 'master'

Add explanation about ApprovalWrappedRule

See merge request gitlab-org/gitlab!34822
parents e874bbb9 0bd10e9c
# frozen_string_literal: true
# A common state computation interface to wrap around ApprovalRuleLike models
# A common state computation interface to wrap around ApprovalRuleLike models.
#
# There are 2 types of approval rules (`ApprovalProjectRule` and
# `ApprovalMergeRequestRule`), we want to get the data we need for the approval
# state of each rule via a common interface. That depends on the approvals data
# of a merge request.
#
# `ApprovalProjectRule` doesn't have access to the merge request unlike
# `ApprovalMergeRequestRule`. Given that, instead of having different checks and
# methods when dealing with a `ApprovalProjectRule`, having a comon interface
# is easier and simpler to interact with.
#
# Different types of `ApprovalWrappedRule` also helps since we have different
# `rule_type`s that can behave differently.
class ApprovalWrappedRule
extend Forwardable
include Gitlab::Utils::StrongMemoize
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment