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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
3e573142
Commit
3e573142
authored
Jul 16, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve danger/changelog/Dangerfile to include the title in the bin/changelog command
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
0c1accd5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
danger/changelog/Dangerfile
danger/changelog/Dangerfile
+7
-7
No files found.
danger/changelog/Dangerfile
View file @
3e573142
...
@@ -2,15 +2,13 @@
...
@@ -2,15 +2,13 @@
require
'yaml'
require
'yaml'
NO_CHANGELOG_LABELS
=
%w[backstage QA test]
.
freeze
NO_CHANGELOG_LABELS
=
%w[backstage
Documentation
QA test]
.
freeze
SEE_DOC
=
"See [the documentation](https://docs.gitlab.com/ce/development/changelog.html)."
.
freeze
SEE_DOC
=
"See [the documentation](https://docs.gitlab.com/ce/development/changelog.html)."
.
freeze
MISSING_CHANGELOG_MESSAGE
=
<<~
MSG
.
freeze
CREATE_CHANGELOG_MESSAGE
=
<<~
MSG
.
freeze
**[CHANGELOG missing](https://docs.gitlab.com/ce/development/changelog.html).**
You can create one with:
You can create one with:
```
```
bin/changelog -m %<mr_iid>s
bin/changelog -m %<mr_iid>s
"%<mr_title>s"
```
```
If your merge request doesn't warrant a CHANGELOG entry,
If your merge request doesn't warrant a CHANGELOG entry,
...
@@ -56,13 +54,15 @@ changelog_needed = (gitlab.mr_labels & NO_CHANGELOG_LABELS).empty?
...
@@ -56,13 +54,15 @@ changelog_needed = (gitlab.mr_labels & NO_CHANGELOG_LABELS).empty?
changelog_found
=
git
.
added_files
.
find
{
|
path
|
path
=~
%r{
\A
(ee/)?(changelogs/unreleased)(-ee)?/}
}
changelog_found
=
git
.
added_files
.
find
{
|
path
|
path
=~
%r{
\A
(ee/)?(changelogs/unreleased)(-ee)?/}
}
if
git
.
modified_files
.
include?
(
"CHANGELOG.md"
)
if
git
.
modified_files
.
include?
(
"CHANGELOG.md"
)
fail
"CHANGELOG.md was edited. Please remove the additions and create an entry with `bin/changelog -m
#{
gitlab
.
mr_json
[
"iid"
]
}
` instead."
fail
"**CHANGELOG.md was edited.** Please remove the additions and create a CHANGELOG entry.
\n\n
"
+
format
(
CREATE_CHANGELOG_MESSAGE
,
mr_iid:
gitlab
.
mr_json
[
"iid"
],
mr_title:
gitlab
.
mr_json
[
"title"
],
labels:
presented_no_changelog_labels
)
end
end
if
changelog_needed
if
changelog_needed
if
changelog_found
if
changelog_found
check_changelog
(
changelog_found
)
check_changelog
(
changelog_found
)
else
else
warn
format
(
MISSING_CHANGELOG_MESSAGE
,
mr_iid:
gitlab
.
mr_json
[
"iid"
],
labels:
presented_no_changelog_labels
)
warn
"**[CHANGELOG missing](https://docs.gitlab.com/ce/development/changelog.html).**
\n\n
"
+
format
(
CREATE_CHANGELOG_MESSAGE
,
mr_iid:
gitlab
.
mr_json
[
"iid"
],
mr_title:
gitlab
.
mr_json
[
"title"
],
labels:
presented_no_changelog_labels
)
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