diff options
Diffstat (limited to 'danger')
-rw-r--r-- | danger/changelog/Dangerfile | 13 | ||||
-rw-r--r-- | danger/only_documentation/Dangerfile | 2 |
2 files changed, 7 insertions, 8 deletions
diff --git a/danger/changelog/Dangerfile b/danger/changelog/Dangerfile index 63b2f6f5c5c..2d1ca64a9e8 100644 --- a/danger/changelog/Dangerfile +++ b/danger/changelog/Dangerfile @@ -1,19 +1,18 @@ +# frozen_string_literal: true # rubocop:disable Style/SignalException require 'yaml' -NO_CHANGELOG_LABELS = %w[backstage ci-build Documentation meta QA test].freeze -SEE_DOC = "See [the documentation](https://docs.gitlab.com/ce/development/changelog.html).".freeze -CREATE_CHANGELOG_MESSAGE = <<~MSG.freeze +NO_CHANGELOG_LABELS = %w[backstage ci-build meta].freeze +SEE_DOC = "See [the documentation](https://docs.gitlab.com/ce/development/changelog.html)." +CREATE_CHANGELOG_MESSAGE = <<~MSG You can create one with: ``` bin/changelog -m %<mr_iid>s "%<mr_title>s" ``` -If your merge request doesn't warrant a CHANGELOG entry, -consider adding any of the %<labels>s labels. -#{SEE_DOC} +Note: Merge requests with %<labels>s do not trigger this check. MSG def ee_changelog?(changelog_path) @@ -60,7 +59,7 @@ if changelog_needed if changelog_found check_changelog(changelog_found) 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) end end diff --git a/danger/only_documentation/Dangerfile b/danger/only_documentation/Dangerfile index ff65f8713d2..dad12c0d29c 100644 --- a/danger/only_documentation/Dangerfile +++ b/danger/only_documentation/Dangerfile @@ -1,7 +1,7 @@ # rubocop:disable Style/SignalException # frozen_string_literal: true -has_only_docs_changes = helper.all_changed_files.all? { |file| file.start_with?('doc/', '.gitlab/ci/docs.gitlab-ci.yml', '.mdlrc') } +has_only_docs_changes = helper.all_changed_files.all? { |file| file.start_with?('doc/', '.gitlab/ci/docs.gitlab-ci.yml', '.mdlrc') || file.end_with?('.md') } is_docs_only_branch = gitlab.branch_for_head =~ /(^docs[\/-].*|.*-docs$)/ if is_docs_only_branch && !has_only_docs_changes |