Repository: python/bedevere (python)

Issue:
Copy over topic-* labels to backport PRs
Working on the REPL recently and trying to organize work with a `topic-repl` label, I noticed that `topic-*` labels are not copied over to backport PRs. Would it make sense for bedevere to do that?

Pull request description:
Copy over topic-* labels to backport PRs
Closes #640.

Patch:
diff --git a/bedevere/backport.py b/bedevere/backport.py
index 7786f75..6dede2d 100644
--- a/bedevere/backport.py
+++ b/bedevere/backport.py
@@ -31,7 +31,7 @@ BACKPORT_TITLE_DEVGUIDE_URL = (
 
 async def _copy_over_labels(gh, original_issue, backport_issue):
     """Copy over relevant labels from the original PR to the backport PR."""
-    label_prefixes = "skip", "type", "sprint"
+    label_prefixes = "skip", "type", "sprint", "topic"
     labels = list(
         filter(lambda x: x.startswith(label_prefixes), util.labels(original_issue))
     )


Test patch:
diff --git a/tests/test_backport.py b/tests/test_backport.py
index 85ad1bd..f0d4dce 100644
--- a/tests/test_backport.py
+++ b/tests/test_backport.py
@@ -276,7 +276,13 @@ async def test_label_copying(pr_prefix):
         },
     }
     event = sansio.Event(event_data, event="pull_request", delivery_id="1")
-    labels_to_test = "CLA signed", "skip news", "type-enhancement", "sprint"
+    labels_to_test = (
+        "CLA signed",
+        "skip news",
+        "type-enhancement",
+        "sprint",
+        "topic-repl",
+    )
     getitem_data = {
         "https://api.github.com/issue/1234": {
             "labels": [{"name": label} for label in labels_to_test],
@@ -293,7 +299,12 @@ async def test_label_copying(pr_prefix):
     expected_post = None
     for post in gh.post_:
         if post[0] == "https://api.github.com/issue/1234/labels":
-            assert {"skip news", "type-enhancement", "sprint"} == frozenset(post[1])
+            assert {
+                "skip news",
+                "type-enhancement",
+                "sprint",
+                "topic-repl",
+            } == frozenset(post[1])
             expected_post = post
 
     assert expected_post is not None