parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexleven...@apache.org
Subject parquet-mr git commit: PARQUET-376: Tolerate square brackets in PR titles
Date Mon, 14 Sep 2015 23:39:31 GMT
Repository: parquet-mr
Updated Branches:
  refs/heads/master f203d809d -> d24ecb32f


PARQUET-376: Tolerate square brackets in PR titles

This allows for PRs like:

`[PARQUET-XXXX] description`

to be parsed, as we often get this format and we usually have to ask the submitter to change
the title for us.

Author: Alex Levenson <alexlevenson@twitter.com>

Closes #271 from isnotinvain/alexlevenson/tolerate-brackets-pr-merge and squashes the following
commits:

edf086d [Alex Levenson] Remove brackets from commit message
3ba963d [Alex Levenson] Tolerate square brackets in PR titles


Project: http://git-wip-us.apache.org/repos/asf/parquet-mr/repo
Commit: http://git-wip-us.apache.org/repos/asf/parquet-mr/commit/d24ecb32
Tree: http://git-wip-us.apache.org/repos/asf/parquet-mr/tree/d24ecb32
Diff: http://git-wip-us.apache.org/repos/asf/parquet-mr/diff/d24ecb32

Branch: refs/heads/master
Commit: d24ecb32ff58d13c178991f0c8618980ff123080
Parents: f203d80
Author: Alex Levenson <alexlevenson@twitter.com>
Authored: Mon Sep 14 16:39:25 2015 -0700
Committer: Alex Levenson <alexlevenson@twitter.com>
Committed: Mon Sep 14 16:39:25 2015 -0700

----------------------------------------------------------------------
 dev/merge_parquet_pr.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/d24ecb32/dev/merge_parquet_pr.py
----------------------------------------------------------------------
diff --git a/dev/merge_parquet_pr.py b/dev/merge_parquet_pr.py
index 621fcde..d8dbbc6 100755
--- a/dev/merge_parquet_pr.py
+++ b/dev/merge_parquet_pr.py
@@ -141,7 +141,9 @@ def merge_pr(pr_num, target_ref):
 
     merge_message_flags = []
 
-    merge_message_flags += ["-m", title]
+    title_without_brackets = remove_brackets_from_pr_title(title)
+
+    merge_message_flags += ["-m", title_without_brackets]
     if body != None:
         merge_message_flags += ["-m", body]
 
@@ -217,8 +219,15 @@ def fix_version_from_branch(branch, versions):
         branch_ver = branch.replace("branch-", "")
         return filter(lambda x: x.name.startswith(branch_ver), versions)[-1]
 
+def remove_brackets_from_pr_title(title):
+    m = re.search(r'^\[?(PARQUET-[0-9]+)\]?(\s.*)$', title)
+    if m and len(m.groups()) == 2:
+        return m.group(1) + m.group(2)
+    else:
+        fail("PR title should be prefixed by a jira id \"PARQUET-XXX: ...\", found: \"%s\""
% title)  
+
 def exctract_jira_id(title):
-    m = re.search(r'^(PARQUET-[0-9]+)\b.*$', title)
+    m = re.search(r'^\[?(PARQUET-[0-9]+)\]?\s.*$', title)
     if m and m.groups > 0:
         return m.group(1)
     else:


Mime
View raw message