diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2022-07-21 14:14:42 +0200 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2022-07-21 14:14:42 +0200 |
commit | dd8d146493ea82e97a41046d2b03692f3c26b2a5 (patch) | |
tree | 6ca643a7b6e7276176389571efa7a932831dec82 /labbot | |
parent | a2fd4e60d3b7753f6da8a1744dd5f8741bbca7c9 (diff) | |
download | lab-bot-dd8d146493ea82e97a41046d2b03692f3c26b2a5.tar.gz lab-bot-dd8d146493ea82e97a41046d2b03692f3c26b2a5.zip |
add more debug printing to merge labeler, fix logic errors
Diffstat (limited to 'labbot')
-rw-r--r-- | labbot/addons/merge-label.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/labbot/addons/merge-label.py b/labbot/addons/merge-label.py index 27e179b..a978388 100644 --- a/labbot/addons/merge-label.py +++ b/labbot/addons/merge-label.py @@ -36,7 +36,7 @@ async def merge_label_hook(event, gl, *args, **kwargs): state = event.object_attributes["state"] related_issues = [] - if title.lower().startswith("draft"): + if not description or title.lower().startswith("draft"): return match = re.search(title_regex, title) @@ -75,7 +75,7 @@ async def merge_label_hook(event, gl, *args, **kwargs): has_label = False issue_data = await gl.getitem(base_url) for label in issue_data["labels"]: - if label in act_labels or state_label.values(): + if label in act_labels or label in state_label.values(): has_label = True break @@ -91,7 +91,9 @@ async def merge_label_hook(event, gl, *args, **kwargs): delete_labels.remove(label) remove_labels = ",".join(delete_labels) - + log.debug(f"Applying {label} to {issue}") + if remove_labels: + log.debug(f"Removing `{remove_labels} from {issue}") await gl.put(base_url, data={ "add_labels": label, "remove_labels": remove_labels, |