From 3e573142b7f048b454755ece0f3a66850ef063a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Mon, 16 Jul 2018 19:21:50 +0200 Subject: Improve danger/changelog/Dangerfile to include the title in the bin/changelog command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- danger/changelog/Dangerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'danger/changelog') 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 %s +bin/changelog -m %s "%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 -- cgit v1.2.3