Skip to content

Commit

Permalink
Copy over topic-* labels to backport PRs
Browse files Browse the repository at this point in the history
Closes python#640.
  • Loading branch information
lysnikolaou committed Jun 7, 2024
1 parent 5757871 commit ddb8c04
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bedevere/backport.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

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))
)
Expand Down
15 changes: 13 additions & 2 deletions tests/test_backport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -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
Expand Down

0 comments on commit ddb8c04

Please sign in to comment.