2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-22 10:10:06 +00:00

danger: check the Affects labels are set

Unless the MR is a backport, the Affects labels should be used to
indicate which versions are affected by the issue that prompted the MR.
This commit is contained in:
Tom Krizek 2022-12-19 15:14:48 +01:00
parent d1172e011c
commit 64d71a1f5f
No known key found for this signature in database
GPG Key ID: 01623B9B652A20A7

View File

@ -177,6 +177,7 @@ BACKPORT_OF_RE = re.compile(
VERSION_LABEL_RE = re.compile(r"v9.([0-9]+)(-S)?") VERSION_LABEL_RE = re.compile(r"v9.([0-9]+)(-S)?")
backport_desc = BACKPORT_OF_RE.search(danger.gitlab.mr.description) backport_desc = BACKPORT_OF_RE.search(danger.gitlab.mr.description)
version_labels = [l for l in mr_labels if l.startswith("v9.")] 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 is_backport:
if len(version_labels) != 1: if len(version_labels) != 1:
fail( fail(
@ -228,12 +229,18 @@ if is_backport:
"commits are meant to be backported." "commits are meant to be backported."
) )
fail(msg) fail(msg)
if not is_backport and not version_labels: else:
fail( if not version_labels:
"If this merge request is a backport, set the *Backport* label and " fail(
"a single version label (*v9.x*) indicating the target branch. " "If this merge request is a backport, set the *Backport* label and "
"If not, set version labels for all targeted backport branches." "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 # OTHER LABELS