From: Michał Kępień Date: Mon, 18 Jan 2021 13:57:47 +0000 (+0100) Subject: Suggest adding release notes for customer issues X-Git-Tag: v9.17.10~33^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d81ad454cc6aef7f7cf3435847898ae17d362cab;p=thirdparty%2Fbind9.git Suggest adding release notes for customer issues Make Danger suggest adding a release note to a merge request if the latter is marked with the "Customer" label but not with the "Release Notes" label. --- diff --git a/dangerfile.py b/dangerfile.py index 7f072803027..df1ae1a8e1d 100644 --- a/dangerfile.py +++ b/dangerfile.py @@ -191,15 +191,26 @@ if changes_added_lines: # Notes" label set. (This ensures that merge requests updating release # notes can be easily found using the "Release Notes" label.) # -# - WARN if this merge request updates release notes, but no GitLab/RT issue/MR -# identifiers are found in the lines added to the release notes by this MR. +# - WARN if any of the following is true: +# +# * This merge request does not update release notes and has the "Customer" +# label set. (Except for trivial changes, all merge requests which may +# be of interest to customers should include a release note.) +# +# * This merge request updates release notes, but no GitLab/RT issue/MR +# identifiers are found in the lines added to the release notes by this +# MR. release_notes_regex = re.compile(r'doc/(arm|notes)/notes-.*\.(rst|xml)') release_notes_changed = list(filter(release_notes_regex.match, modified_files)) release_notes_label_set = 'Release Notes' in mr_labels -if not release_notes_changed and release_notes_label_set: - fail('This merge request has the *Release Notes* label set. ' - 'Add a release note or unset the *Release Notes* label.') +if not release_notes_changed: + if release_notes_label_set: + fail('This merge request has the *Release Notes* label set. ' + 'Add a release note or unset the *Release Notes* label.') + elif 'Customer' in mr_labels: + warn('This merge request has the *Customer* label set. ' + 'Add a release note unless the changes introduced are trivial.') if release_notes_changed and not release_notes_label_set: fail('This merge request modifies release notes. ' 'Revert release note modifications or set the *Release Notes* label.')