]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fail for backports with "Affects v9.x" labels set
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:42 +0000 (11:11 +0000)
Backports are not expected to have any "Affects v9.x" labels set since
those are only meant to be set for merge requests that should have
backports created for them.

(cherry picked from commit 9359cb9c99454626b65b3863e10e710a329ca99c)

dangerfile.py

index 6ed0e0bf10151295a0132de300edf4364d6f06ef..5dd2f18c51e452de75283efb457a25f798eca3f9 100644 (file)
@@ -164,6 +164,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 is marked as Backport and the number of version labels set is
 #   different than 1.  (For backports, the version label is used for indicating
 #   its target branch.  This is a rather ugly attempt to address a UI
@@ -187,6 +189,8 @@ 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 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*. "