Commit 7671c592 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch...

Merge branch '65312-use-group-labels-instead-of-legacy-team-labels-for-danger-picking-test-reviewers' into 'master'

Detect the new stage labels in `Gitlab::Danger::Teammate`

Closes #65312

See merge request gitlab-org/gitlab-ce!32261
parents 4ad96a4e cfef583e
...@@ -39,9 +39,9 @@ module Gitlab ...@@ -39,9 +39,9 @@ module Gitlab
def has_capability?(project, category, kind, labels) def has_capability?(project, category, kind, labels)
case category case category
when :test 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 else
capabilities(project).include?("#{kind} #{category}") capabilities(project).include?("#{kind} #{category}")
end end
......
...@@ -28,7 +28,7 @@ describe Gitlab::Danger::Teammate do ...@@ -28,7 +28,7 @@ describe Gitlab::Danger::Teammate do
end end
context 'when labels contain Create and the category is test' do 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 context 'when role is Test Automation Engineer, Create' do
let(:role) { 'Test Automation Engineer, Create' } let(:role) { 'Test Automation Engineer, Create' }
......
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