diff options
author | Rémy Coutable <remy@rymai.me> | 2018-07-16 19:21:50 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-07-17 09:43:46 +0200 |
commit | 3e573142b7f048b454755ece0f3a66850ef063a4 (patch) | |
tree | 3e503885a2c2bbb8af76a47468dadb9711e87c07 /danger | |
parent | 0c1accd5042ff36520e6bac2c66edfd50b7043bc (diff) | |
download | gitlab-ce-3e573142b7f048b454755ece0f3a66850ef063a4.tar.gz |
Improve danger/changelog/Dangerfile to include the title in the bin/changelog command
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'danger')
-rw-r--r-- | danger/changelog/Dangerfile | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/danger/changelog/Dangerfile b/danger/changelog/Dangerfile index 0374de24520..a1f94dc6004 100644 --- a/danger/changelog/Dangerfile +++ b/danger/changelog/Dangerfile @@ -2,15 +2,13 @@ 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 -MISSING_CHANGELOG_MESSAGE = <<~MSG.freeze -**[CHANGELOG missing](https://docs.gitlab.com/ce/development/changelog.html).** - +CREATE_CHANGELOG_MESSAGE = <<~MSG.freeze 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, @@ -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)?/} } 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 if changelog_needed if changelog_found check_changelog(changelog_found) 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 |