Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 00:07:22 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 00:07:22 +0300
commite924e9e7cb9df21b3bc3d51d5f955da28ba3a225 (patch)
tree598ccb6f09e55ad06e628a90d27628f20ae693fe /lib/gitlab/danger
parent8e45d25f7dde6508839ffee719c0ddc2cf6b12d3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/danger')
-rw-r--r--lib/gitlab/danger/roulette.rb2
-rw-r--r--lib/gitlab/danger/teammate.rb12
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/gitlab/danger/roulette.rb b/lib/gitlab/danger/roulette.rb
index 0700a72c918..dbf42912882 100644
--- a/lib/gitlab/danger/roulette.rb
+++ b/lib/gitlab/danger/roulette.rb
@@ -50,7 +50,7 @@ module Gitlab
# @param [Teammate] person
# @return [Boolean]
def valid_person?(person)
- !mr_author?(person) && !person.out_of_office?
+ !mr_author?(person) && person.available?
end
# @param [Teammate] person
diff --git a/lib/gitlab/danger/teammate.rb b/lib/gitlab/danger/teammate.rb
index c0a2d909f69..5c2324836d7 100644
--- a/lib/gitlab/danger/teammate.rb
+++ b/lib/gitlab/danger/teammate.rb
@@ -44,11 +44,21 @@ module Gitlab
end
# @return [Boolean]
+ def available?
+ !out_of_office? && has_capacity?
+ end
+
+ private
+
+ # @return [Boolean]
def out_of_office?
status&.dig("message")&.match?(/OOO/i) || false
end
- private
+ # @return [Boolean]
+ def has_capacity?
+ status&.dig("emoji") != 'red_circle'
+ end
def has_capability?(project, category, kind, labels)
case category