Skip to content

Commit

Permalink
PortAddonPullRequest: same PR description with one or multiple ported…
Browse files Browse the repository at this point in the history
… PRs

Display ported PRs as list in PR description, even if only one has been
ported, so platforms like GitHub can render such list nicely with
helpful information (PR title, color and status).
  • Loading branch information
sebalix committed Jan 9, 2025
1 parent 67c69f6 commit 79b18f9
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions oca_port/port_addon_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,20 +518,14 @@ def _prepare_pull_request_data(self, processed_prs, blacklisted_prs):
f"[{self.app.target_version}][FW] {self.app.addon}: multiple ports "
f"from {self.app.source_version}"
)
lines = [f"- #{pr['number']}" for pr in processed_prs.values()]
body = "\n".join(
[
f"Port of the following PRs from {self.app.source_version} "
f"to {self.app.target_version}:"
]
+ lines
)
if len(processed_prs) == 1:
pr = list(processed_prs.values())[0]
title = f"[{self.app.target_version}][FW] {pr['title']}"
body = (
f"Port of #{pr['number']} from {self.app.source_version} "
f"to {self.app.target_version}."
if processed_prs:
lines = [f"- #{pr['number']}" for pr in processed_prs.values()]
body = "\n".join(
[f"Port from {self.app.source_version} to {self.app.target_version}:"]
+ lines
)
# Handle blacklisted PRs
if blacklisted_prs:
Expand Down

0 comments on commit 79b18f9

Please sign in to comment.