Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

Fix PR template and Reviewable from merge commits #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion homu/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def create_merge(state, repo_cfg, branch, git_cfg):
state.head_ref,
'<try>' if state.try_ else state.approved_by,
state.title,
state.body,
utils.strip_pr_body(state.body),
)

desc = 'Merge conflict'
Expand Down
13 changes: 13 additions & 0 deletions homu/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,16 @@ def retry_until(inner, fail, state):
traceback.print_exception(*exc_info)

fail(err)


def strip_pr_body(pr_body):
"""
Strip noisy parts of the Servo PR template from merge commits.
"""
# Strip most of the template and Reviewable
pr_footer = '\n---\n<!-- Thank you for contributing to Servo! '
stripped_body = pr_body.partition(pr_footer)[0]

# May or may not exist; may be at the top or bottom of stripped_body
pr_header = '<!-- Please describe your changes on the following line: -->'
return stripped_body.replace(pr_header, '').strip()