Include PR title in change message

Gerrit includes the whole commit message (subject + body). For a GitHub
PR only the body was included in the change message.

This patch adds also the PR title to the change message so we have a
similar behavior for GitHub.

Change-Id: I662e6898cb52b73e0341512b7bffe7f858552dda
This commit is contained in:
Simon Westphahl
2019-01-16 13:29:56 +01:00
committed by Tobias Henkel
parent a1283f403f
commit 47d55215aa
2 changed files with 11 additions and 2 deletions

View File

@@ -936,7 +936,13 @@ class GithubConnection(BaseConnection):
change.number)
change.labels = change.pr.get('labels')
# ensure message is at least an empty string
change.message = change.pr.get('body') or ''
message = change.pr.get("body") or ""
if change.title:
if message:
message = "{}\n\n{}".format(change.title, message)
else:
message = change.title
change.message = message
# Note(tobiash): The updated_at timestamp is a moving target that is
# not bound to the pull request 'version' we can solve that by just not