Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
GitLab FOSS
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
Container Registry
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GitLab.org
GitLab FOSS
Commits
79ec54c3
Commit
79ec54c3
authored
Sep 03, 2019
by
Kyle Wiebers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Danger Roulette rules for pipeline files
parent
be920a60
Pipeline
#80495877
passed with stages
in 98 minutes and 28 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
3 deletions
+23
-3
lib/gitlab/danger/helper.rb
lib/gitlab/danger/helper.rb
+4
-2
lib/gitlab/danger/teammate.rb
lib/gitlab/danger/teammate.rb
+2
-0
spec/lib/gitlab/danger/helper_spec.rb
spec/lib/gitlab/danger/helper_spec.rb
+5
-1
spec/lib/gitlab/danger/teammate_spec.rb
spec/lib/gitlab/danger/teammate_spec.rb
+12
-0
No files found.
lib/gitlab/danger/helper.rb
View file @
79ec54c3
...
...
@@ -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{
\A
doc/}
=>
:none
,
# To reinstate roulette for documentation, set to `:docs`.
...
...
@@ -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
,
...
...
lib/gitlab/danger/teammate.rb
View file @
79ec54c3
...
...
@@ -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
...
...
spec/lib/gitlab/danger/helper_spec.rb
View file @
79ec54c3
...
...
@@ -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
...
...
spec/lib/gitlab/danger/teammate_spec.rb
View file @
79ec54c3
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment