Class: Gitlab::Dangerfiles::Weightage::Reviewers Private
- Inherits:
-
Object
- Object
- Gitlab::Dangerfiles::Weightage::Reviewers
- Defined in:
- lib/gitlab/dangerfiles/weightage/reviewers.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Weights after (current multiplier of 2)
------------------------------
——————————–+ | reviewer type | weight(times in reviewer pool) | ------------------------------
——————————–+ | reduced capacity reviewer | 1 | | reviewer | 2 | | hungry reviewer | 4 | | reduced capacity traintainer | 1 | | traintainer | 2 | | hungry traintainer | 6 | ------------------------------
——————————–+
Constant Summary collapse
- DEFAULT_REVIEWER_WEIGHT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Gitlab::Dangerfiles::Weightage::CAPACITY_MULTIPLIER * Gitlab::Dangerfiles::Weightage::BASE_REVIEWER_WEIGHT
- TRAINTAINER_WEIGHT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
2
Instance Method Summary collapse
- #execute ⇒ Object private
-
#initialize(reviewers, traintainers) ⇒ Reviewers
constructor
private
A new instance of Reviewers.
Constructor Details
#initialize(reviewers, traintainers) ⇒ Reviewers
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Reviewers.
26 27 28 29 |
# File 'lib/gitlab/dangerfiles/weightage/reviewers.rb', line 26 def initialize(reviewers, traintainers) @reviewers = reviewers @traintainers = traintainers end |
Instance Method Details
#execute ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
31 32 33 34 35 36 37 38 39 |
# File 'lib/gitlab/dangerfiles/weightage/reviewers.rb', line 31 def execute # TODO: take CODEOWNERS into account? # https://gitlab.com/gitlab-org/gitlab/issues/26723 remove_traintainers_from_reviewers! remove_maintainer_only_from_reviewers! weighted_reviewers + weighted_traintainers end |