Browse Source

MINOR: Exclude Committer Checklist section from commit message

It seems like it's sufficient to be able to refer to it in the PR.

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>

Closes #4202 from ijuma/exclude-committer-checklist-when-merging
pull/4208/head
Ismael Juma 7 years ago
parent
commit
d04daf570e
  1. 4
      PULL_REQUEST_TEMPLATE.md
  2. 14
      kafka-merge-pr.py

4
PULL_REQUEST_TEMPLATE.md

@ -1,6 +1,6 @@
*More detailed description of your change, *More detailed description of your change,
if necessary. The PR title and PR message become if necessary. The PR title and PR message become
the squashed commit message so use a separate the squashed commit message, so use a separate
comment to ping reviewers.* comment to ping reviewers.*
*Summary of testing strategy (including rationale) *Summary of testing strategy (including rationale)
@ -8,7 +8,7 @@ for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and tests are expected for any behaviour change and
system tests should be considered for larger changes.* system tests should be considered for larger changes.*
### Committer Checklist ### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation - [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status - [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes) - [ ] Verify documentation (including upgrade notes)

14
kafka-merge-pr.py

@ -157,16 +157,22 @@ def merge_pr(pr_num, target_ref, title, body, pr_repo_desc):
merge_message_flags = [] merge_message_flags = []
merge_message_flags += ["-m", title] merge_message_flags += ["-m", title]
if body is not None: if body is not None:
# We remove @ symbols from the body to avoid triggering e-mails # Remove "Committer Checklist" section
# to people every time someone creates a public fork of the project. checklist_index = body.find("### Committer Checklist")
merge_message_flags += ["-m", body.replace("@", "")] if checklist_index != -1:
body = body[:checklist_index].rstrip()
# Remove @ symbols from the body to avoid triggering e-mails to people every time someone creates a
# public fork of the project.
body = body.replace("@", "")
merge_message_flags += ["-m", body]
authors = "\n".join(["Author: %s" % a for a in distinct_authors]) authors = "\n".join(["Author: %s" % a for a in distinct_authors])
merge_message_flags += ["-m", authors] merge_message_flags += ["-m", authors]
if (reviewers != ""): if reviewers != "":
merge_message_flags += ["-m", "Reviewers: %s" % reviewers] merge_message_flags += ["-m", "Reviewers: %s" % reviewers]
if had_conflicts: if had_conflicts:

Loading…
Cancel
Save