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
986116ae
Commit
986116ae
authored
Jul 15, 2020
by
Albert Salim
Committed by
Rémy Coutable
Jul 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove ~backstage in Danger
parent
37805a8d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
24 deletions
+25
-24
danger/metadata/Dangerfile
danger/metadata/Dangerfile
+0
-1
danger/specs/Dangerfile
danger/specs/Dangerfile
+0
-1
lib/gitlab/danger/changelog.rb
lib/gitlab/danger/changelog.rb
+5
-2
spec/lib/gitlab/danger/changelog_spec.rb
spec/lib/gitlab/danger/changelog_spec.rb
+20
-20
No files found.
danger/metadata/Dangerfile
View file @
986116ae
...
...
@@ -4,7 +4,6 @@ THROUGHPUT_LABELS = [
'Community contribution'
,
'security'
,
'bug'
,
'backstage'
,
# To be removed by https://gitlab.com/gitlab-org/gitlab/-/issues/222360.
'feature'
,
'feature::addition'
,
'feature::maintenance'
,
...
...
danger/specs/Dangerfile
View file @
986116ae
# frozen_string_literal: true
NO_SPECS_LABELS
=
[
'backstage'
,
# To be removed by https://gitlab.com/gitlab-org/gitlab/-/issues/222360.
'tooling'
,
'tooling::pipelines'
,
'tooling::workflow'
,
...
...
lib/gitlab/danger/changelog.rb
View file @
986116ae
...
...
@@ -4,7 +4,6 @@ module Gitlab
module
Danger
module
Changelog
NO_CHANGELOG_LABELS
=
[
'backstage'
,
# To be removed by https://gitlab.com/gitlab-org/gitlab/-/issues/222360.
'tooling'
,
'tooling::pipelines'
,
'tooling::workflow'
,
...
...
@@ -14,7 +13,7 @@ module Gitlab
NO_CHANGELOG_CATEGORIES
=
%i[docs none]
.
freeze
def
needed?
categories_need_changelog?
&&
(
gitlab
.
mr_labels
&
NO_CHANGELOG_LABELS
).
empty
?
categories_need_changelog?
&&
without_no_changelog_label
?
end
def
found
...
...
@@ -34,6 +33,10 @@ module Gitlab
def
categories_need_changelog?
(
helper
.
changes_by_category
.
keys
-
NO_CHANGELOG_CATEGORIES
).
any?
end
def
without_no_changelog_label?
(
gitlab
.
mr_labels
&
NO_CHANGELOG_LABELS
).
empty?
end
end
end
end
spec/lib/gitlab/danger/changelog_spec.rb
View file @
986116ae
# frozen_string_literal: true
require
'fast_spec_helper'
require
'rspec-parameterized'
require_relative
'danger_spec_helper'
require
'gitlab/danger/changelog'
RSpec
.
describe
Gitlab
::
Danger
::
Changelog
do
using
RSpec
::
Parameterized
::
TableSyntax
include
DangerSpecHelper
let
(
:added_files
)
{
nil
}
...
...
@@ -26,34 +24,36 @@ RSpec.describe Gitlab::Danger::Changelog do
subject
(
:changelog
)
{
fake_danger
.
new
(
git:
fake_git
,
gitlab:
fake_gitlab
,
helper:
fake_helper
)
}
describe
'#needed?'
do
subject
{
changelog
.
needed?
}
let
(
:category_with_changelog
)
{
:backend
}
let
(
:label_with_changelog
)
{
'frontend'
}
let
(
:category_without_changelog
)
{
Gitlab
::
Danger
::
Changelog
::
NO_CHANGELOG_CATEGORIES
.
first
}
let
(
:label_without_changelog
)
{
Gitlab
::
Danger
::
Changelog
::
NO_CHANGELOG_LABELS
.
first
}
where
(
:categories
,
:labels
)
do
{
backend:
nil
}
|
%w[backend backstage]
{
frontend:
nil
,
docs:
nil
}
|
[
'ci-build'
]
{
engineering_productivity:
nil
,
none:
nil
}
|
[
'meta'
]
end
subject
{
changelog
.
needed?
}
with_them
do
let
(
:changes_by_category
)
{
categories
}
let
(
:mr_labels
)
{
labels
}
context
'when MR contains only categories requiring no changelog'
do
let
(
:changes_by_category
)
{
{
category_without_changelog
=>
nil
}
}
let
(
:mr_labels
)
{
[]
}
it
"is falsy when categories and labels require no changelog"
do
it
'is falsey'
do
is_expected
.
to
be_falsy
end
end
where
(
:categories
,
:labels
)
do
{
frontend:
nil
,
docs:
nil
}
|
[
'database::review pending'
,
'feature'
]
{
backend:
nil
}
|
[
'backend'
,
'technical debt'
]
{
engineering_productivity:
nil
,
none:
nil
}
|
[
'frontend'
]
context
'when MR contains a label that require no changelog'
do
let
(
:changes_by_category
)
{
{
category_with_changelog
=>
nil
}
}
let
(
:mr_labels
)
{
[
label_with_changelog
,
label_without_changelog
]
}
it
'is falsey'
do
is_expected
.
to
be_falsy
end
end
with_them
do
let
(
:changes_by_category
)
{
categories
}
let
(
:mr_labels
)
{
labels
}
context
'when MR contains a category that require changelog and a category that require no changelog'
do
let
(
:changes_by_category
)
{
{
category_with_changelog
=>
nil
,
category_without_changelog
=>
nil
}
}
let
(
:mr_labels
)
{
[]
}
it
"is truthy when categories and labels require a changelog"
do
it
'is truthy'
do
is_expected
.
to
be_truthy
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