Commit c1d315d4 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'improve-dnager-message-when-changelog-is-needed' into 'master'

Make it clear that it's ok to ignore Danger's 'no changelog' warning

See merge request gitlab-org/gitlab-ce!32088
parents d8521127 8ad3691b
# frozen_string_literal: true
# rubocop:disable Style/SignalException # rubocop:disable Style/SignalException
require 'yaml' require 'yaml'
NO_CHANGELOG_LABELS = %w[backstage ci-build Documentation meta QA test].freeze NO_CHANGELOG_LABELS = %w[backstage ci-build meta].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)."
CREATE_CHANGELOG_MESSAGE = <<~MSG.freeze CREATE_CHANGELOG_MESSAGE = <<~MSG
You can create one with: You can create one with:
``` ```
bin/changelog -m %<mr_iid>s "%<mr_title>s" bin/changelog -m %<mr_iid>s "%<mr_title>s"
``` ```
If your merge request doesn't warrant a CHANGELOG entry, Note: Merge requests with %<labels>s do not trigger this check.
consider adding any of the %<labels>s labels.
#{SEE_DOC}
MSG MSG
def ee_changelog?(changelog_path) def ee_changelog?(changelog_path)
...@@ -60,7 +59,7 @@ if changelog_needed ...@@ -60,7 +59,7 @@ if changelog_needed
if changelog_found if changelog_found
check_changelog(changelog_found) check_changelog(changelog_found)
else else
warn "**[CHANGELOG missing](https://docs.gitlab.com/ce/development/changelog.html).**\n\n" + message "**[CHANGELOG missing](https://docs.gitlab.com/ce/development/changelog.html)**: If this merge request [doesn't need a CHANGELOG entry](https://docs.gitlab.com/ee/development/changelog.html#what-warrants-a-changelog-entry), feel free to ignore this message.\n\n" +
format(CREATE_CHANGELOG_MESSAGE, mr_iid: gitlab.mr_json["iid"], mr_title: mr_title, labels: presented_no_changelog_labels) format(CREATE_CHANGELOG_MESSAGE, mr_iid: gitlab.mr_json["iid"], mr_title: mr_title, labels: presented_no_changelog_labels)
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment