]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Suggest adding release notes for customer issues
authorMichał Kępień <michal@isc.org>
Mon, 18 Jan 2021 13:57:47 +0000 (14:57 +0100)
committerMichał Kępień <michal@isc.org>
Mon, 18 Jan 2021 13:57:47 +0000 (14:57 +0100)
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.

dangerfile.py

index 7f072803027cbfdedfb3535ade6373613a983019..df1ae1a8e1d276c7b533f6ddc36fc0e3d4428fcb 100644 (file)
@@ -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.')