Skip to content
Snippets Groups Projects
Commit 79ec54c3 authored by Kyle Wiebers's avatar Kyle Wiebers
Browse files

Add Danger Roulette rules for pipeline files

parent be920a60
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -83,7 +83,8 @@ module Gitlab
docs: "~Documentation", # Docs are reviewed along DevOps stages, so don't need roulette for now.
none: "",
qa: "~QA",
test: "~test for `spec/features/*`"
test: "~test for `spec/features/*`",
engineering_productivity: "Engineering Productivity for CI config review"
}.freeze
CATEGORIES = {
%r{\Adoc/} => :none, # To reinstate roulette for documentation, set to `:docs`.
Loading
Loading
@@ -125,7 +126,8 @@ module Gitlab
%r{\A(ee/)?spec/(?!javascripts|frontend)[^/]+} => :backend,
%r{\A(ee/)?vendor/(?!assets)[^/]+} => :backend,
%r{\A(ee/)?vendor/(languages\.yml|licenses\.csv)\z} => :backend,
%r{\A(Dangerfile|Gemfile|Gemfile.lock|Procfile|Rakefile|\.gitlab-ci\.yml)\z} => :backend,
%r{\A(\.gitlab-ci\.yml\z|\.gitlab\/ci)} => :engineering_productivity,
%r{\A(Dangerfile|Gemfile|Gemfile.lock|Procfile|Rakefile)\z} => :backend,
%r{\A[A-Z_]+_VERSION\z} => :backend,
%r{\A\.rubocop(_todo)?\.yml\z} => :backend,
 
Loading
Loading
Loading
Loading
@@ -42,6 +42,8 @@ module Gitlab
area = role[/Test Automation Engineer(?:.*?, (\w+))/, 1]
 
area && labels.any?("devops::#{area.downcase}") if kind == :reviewer
when :engineering_productivity
role[/Engineering Productivity/] if kind == :reviewer
else
capabilities(project).include?("#{kind} #{category}")
end
Loading
Loading
Loading
Loading
@@ -168,9 +168,13 @@ describe Gitlab::Danger::Helper do
'Gemfile.lock' | :backend
'Procfile' | :backend
'Rakefile' | :backend
'.gitlab-ci.yml' | :backend
'FOO_VERSION' | :backend
 
'.gitlab-ci.yml' | :engineering_productivity
'.gitlab/ci/cng.gitlab-ci.yml' | :engineering_productivity
'.gitlab/ci/ee-specific-checks.gitlab-ci.yml' | :engineering_productivity
'lib/gitlab/ci/templates/Security/SAST.gitlab-ci.yml' | :backend
'ee/FOO_VERSION' | :unknown
 
'db/schema.rb' | :database
Loading
Loading
Loading
Loading
@@ -65,6 +65,18 @@ describe Gitlab::Danger::Teammate do
expect(subject.reviewer?(project, :test, labels)).to be_falsey
end
end
context 'when role is Backend Engineer, Engineering Productivity' do
let(:role) { 'Backend Engineer, Engineering Productivity' }
it '#reviewer? returns true' do
expect(subject.reviewer?(project, :engineering_productivity, labels)).to be_truthy
end
it '#maintainer? returns false' do
expect(subject.maintainer?(project, :engineering_productivity, labels)).to be_falsey
end
end
end
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment