diff options
author | Rémy Coutable <remy@rymai.me> | 2019-08-27 12:16:44 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-08-27 12:16:44 +0200 |
commit | cfef583e943620b8f78a804b484f843e6776cf91 (patch) | |
tree | d97bec25a7298a6513b5572b0f7f09d184624245 | |
parent | 0839fb0c2f6dd6da76a4b4dbdee7c96e3fb2efe1 (diff) | |
download | gitlab-ce-cfef583e943620b8f78a804b484f843e6776cf91.tar.gz |
Detect the new stage labels in Gitlab::Danger::Teammate65312-use-group-labels-instead-of-legacy-team-labels-for-danger-picking-test-reviewers
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r-- | lib/gitlab/danger/teammate.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/danger/teammate_spec.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/danger/teammate.rb b/lib/gitlab/danger/teammate.rb index 74cbcc11255..8ae4ffdadb0 100644 --- a/lib/gitlab/danger/teammate.rb +++ b/lib/gitlab/danger/teammate.rb @@ -39,9 +39,9 @@ module Gitlab def has_capability?(project, category, kind, labels) case category when :test - area = role[/Test Automation Engineer(?:.*?, (\w+))/, 1] + area = role[/Test Automation Engineer(?:.*?, (\w+))/, 1].downcase - area && labels.any?(area) if kind == :reviewer + area && labels.any?("devops::#{area}") if kind == :reviewer else capabilities(project).include?("#{kind} #{category}") end diff --git a/spec/lib/gitlab/danger/teammate_spec.rb b/spec/lib/gitlab/danger/teammate_spec.rb index 171f2344e82..61b43e343c1 100644 --- a/spec/lib/gitlab/danger/teammate_spec.rb +++ b/spec/lib/gitlab/danger/teammate_spec.rb @@ -28,7 +28,7 @@ describe Gitlab::Danger::Teammate do end context 'when labels contain Create and the category is test' do - let(:labels) { ['Create'] } + let(:labels) { ['devops::create'] } context 'when role is Test Automation Engineer, Create' do let(:role) { 'Test Automation Engineer, Create' } |