]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fail for merge requests with "Affects v9.x" labels
authorMichał Kępień <michal@isc.org>
Mon, 3 Jun 2024 11:07:21 +0000 (13:07 +0200)
committerMichał Kępień <michal@isc.org>
Mon, 3 Jun 2024 11:11:43 +0000 (11:11 +0000)
Setting "Affects v9.x" labels on a merge request duplicates information
already present on the GitLab issue associated with that merge request.
For trivial merge requests that are not associated with any GitLab
issue, setting the "Affects v9.x" label(s) is considered unnecessary.
Trigger a failure for every merge request marked with at least one
"Affects v9.x" label.

(cherry picked from commit aae51cf28d4466907e152591c8a00525f7ec7038)

dangerfile.py

index d267572fa576b4fe500b1f8c5e0641f26feeb704..ab69fa99b5b44dabcd460bff900696f97fbbfd79 100644 (file)
@@ -196,7 +196,8 @@ if not danger.gitlab.mr.milestone:
 #
 # FAIL if any of the following is true for the merge request:
 #
-# * The MR is marked as a Backport and has any "Affects v9.x" label(s) set.
+# * The MR has any "Affects v9.x" label(s) set.  These should only be used for
+#   issues.
 #
 # * The MR is marked as Backport and the number of version labels set is
 #   different than 1.  (For backports, the version label is used for indicating
@@ -220,9 +221,12 @@ BACKPORT_OF_RE = re.compile(
 VERSION_LABEL_RE = re.compile(r"v9.([0-9]+)(-S)?")
 version_labels = [l for l in mr_labels if l.startswith("v9.")]
 affects_labels = [l for l in mr_labels if l.startswith("Affects v9.")]
+if affects_labels:
+    fail(
+        "This MR is marked with at least one *Affects v9.x* label. "
+        "Please remove them as they should only be used for issues."
+    )
 if is_backport:
-    if affects_labels:
-        fail("Backports must not have any *Affects v9.x* labels set.")
     if len(version_labels) != 1:
         fail(
             "This MR was marked as *Backport*. "
@@ -281,11 +285,6 @@ else:
             "a single version label (*v9.x*) indicating the target branch. "
             "If not, set version labels for all targeted backport branches."
         )
-    if not affects_labels:
-        warn(
-            "Set `Affects v9.` label(s) for all versions that are affected by "
-            "the issue which this MR addresses."
-        )
 
 ###############################################################################
 # OTHER LABELS