diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /danger/changelog/Dangerfile | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'danger/changelog/Dangerfile')
-rw-r--r-- | danger/changelog/Dangerfile | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/danger/changelog/Dangerfile b/danger/changelog/Dangerfile index aa7a81555a3..f9e65bbf4c7 100644 --- a/danger/changelog/Dangerfile +++ b/danger/changelog/Dangerfile @@ -35,7 +35,11 @@ def check_changelog_yaml(path) fail "`title` should be set, in #{gitlab.html_link(path)}! #{SEE_DOC}" if yaml["title"].nil? fail "`type` should be set, in #{gitlab.html_link(path)}! #{SEE_DOC}" if yaml["type"].nil? - if yaml["merge_request"].nil? && !helper.security_mr? + return if helper.security_mr? + + cherry_pick_against_stable_branch = helper.cherry_pick_mr? && helper.stable_branch? + + if yaml["merge_request"].nil? mr_line = raw_file.lines.find_index("merge_request:\n") if mr_line @@ -43,14 +47,14 @@ def check_changelog_yaml(path) else message "Consider setting `merge_request` to #{gitlab.mr_json["iid"]} in #{gitlab.html_link(path)}. #{SEE_DOC}" end - elsif yaml["merge_request"] != gitlab.mr_json["iid"] && !helper.security_mr? + elsif yaml["merge_request"] != gitlab.mr_json["iid"] && !cherry_pick_against_stable_branch fail "Merge request ID was not set to #{gitlab.mr_json["iid"]}! #{SEE_DOC}" end rescue Psych::SyntaxError, Psych::DisallowedClass, Psych::BadAlias # YAML could not be parsed, fail the build. fail "#{gitlab.html_link(path)} isn't valid YAML! #{SEE_DOC}" rescue StandardError => e - warn "There was a problem trying to check the Changelog. Exception: #{e.name} - #{e.message}" + warn "There was a problem trying to check the Changelog. Exception: #{e.class.name} - #{e.message}" end def check_changelog_path(path) |