Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9afc4f9d
Commit
9afc4f9d
authored
Feb 14, 2019
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reviewer roulette ignores changelogs
parent
bbd0a2ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
danger/roulette/Dangerfile
danger/roulette/Dangerfile
+3
-0
lib/gitlab/danger/helper.rb
lib/gitlab/danger/helper.rb
+4
-0
spec/lib/gitlab/danger/helper_spec.rb
spec/lib/gitlab/danger/helper_spec.rb
+6
-1
No files found.
danger/roulette/Dangerfile
View file @
9afc4f9d
...
...
@@ -53,6 +53,9 @@ def build_list(items)
end
changes
=
helper
.
changes_by_category
# Ignore any files that are known but uncategoried. Prompt for any unknown files
changes
.
delete
(
:none
)
categories
=
changes
.
keys
-
[
:unknown
]
unless
changes
.
empty?
...
...
lib/gitlab/danger/helper.rb
View file @
9afc4f9d
...
...
@@ -95,6 +95,7 @@ module Gitlab
CATEGORY_LABELS
=
{
docs:
"~Documentation"
,
none:
""
,
qa:
"~QA"
}.
freeze
...
...
@@ -120,6 +121,9 @@ module Gitlab
%r{
\A
(ee/)?db/}
=>
:database
,
%r{
\A
(ee/)?qa/}
=>
:qa
,
# Files that don't fit into any category are marked with :none
%r{
\A
(ee/)?changelogs/}
=>
:none
,
# Fallbacks in case the above patterns miss anything
%r{
\.
rb
\z
}
=>
:backend
,
%r{
\.
(md|txt)
\z
}
=>
:docs
,
...
...
spec/lib/gitlab/danger/helper_spec.rb
View file @
9afc4f9d
...
...
@@ -184,7 +184,7 @@ describe Gitlab::Danger::Helper do
describe
'#changes_by_category'
do
it
'categorizes changed files'
do
expect
(
fake_git
).
to
receive
(
:added_files
)
{
%w[foo foo.md foo.rb foo.js db/foo qa/foo]
}
expect
(
fake_git
).
to
receive
(
:added_files
)
{
%w[foo foo.md foo.rb foo.js db/foo qa/foo
ee/changelogs/foo.yml
]
}
allow
(
fake_git
).
to
receive
(
:modified_files
)
{
[]
}
allow
(
fake_git
).
to
receive
(
:renamed_files
)
{
[]
}
...
...
@@ -193,6 +193,7 @@ describe Gitlab::Danger::Helper do
database:
%w[db/foo]
,
docs:
%w[foo.md]
,
frontend:
%w[foo.js]
,
none:
%w[ee/changelogs/foo.yml]
,
qa:
%w[qa/foo]
,
unknown:
%w[foo]
)
...
...
@@ -260,6 +261,9 @@ describe Gitlab::Danger::Helper do
'ee/db/foo'
|
:database
'ee/qa/foo'
|
:qa
'changelogs/foo'
|
:none
'ee/changelogs/foo'
|
:none
'FOO'
|
:unknown
'foo'
|
:unknown
...
...
@@ -283,6 +287,7 @@ describe Gitlab::Danger::Helper do
:docs
|
'~Documentation'
:foo
|
'~foo'
:frontend
|
'~frontend'
:none
|
''
:qa
|
'~QA'
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