You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@livy.apache.org by js...@apache.org on 2017/07/21 00:13:15 UTC

incubator-livy git commit: [MINOR] Change Livy commit message style from LIVY-xxx. to [LIVY-xxx]

Repository: incubator-livy
Updated Branches:
  refs/heads/master 27625a0b2 -> feeb8678f


[MINOR] Change Livy commit message style from LIVY-xxx. to [LIVY-xxx]

According to discussion, changing the commit message style from LIVY-xxx. to [LIVY-xxx].

Author: jerryshao <ss...@hortonworks.com>

Closes #17 from jerryshao/update-merge-script.


Project: http://git-wip-us.apache.org/repos/asf/incubator-livy/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-livy/commit/feeb8678
Tree: http://git-wip-us.apache.org/repos/asf/incubator-livy/tree/feeb8678
Diff: http://git-wip-us.apache.org/repos/asf/incubator-livy/diff/feeb8678

Branch: refs/heads/master
Commit: feeb8678f4a2f59a1ec3ebdd31a1c8c65cc613a2
Parents: 27625a0
Author: jerryshao <ss...@hortonworks.com>
Authored: Thu Jul 20 17:13:02 2017 -0700
Committer: jerryshao <ss...@hortonworks.com>
Committed: Thu Jul 20 17:13:02 2017 -0700

----------------------------------------------------------------------
 dev/merge_livy_pr.py | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-livy/blob/feeb8678/dev/merge_livy_pr.py
----------------------------------------------------------------------
diff --git a/dev/merge_livy_pr.py b/dev/merge_livy_pr.py
index 949db16..741ec2e 100755
--- a/dev/merge_livy_pr.py
+++ b/dev/merge_livy_pr.py
@@ -310,31 +310,38 @@ def resolve_jira_issues(title, merge_branches, comment):
 
 def standardize_jira_ref(text):
     """
-    Standardize the LIVY-XXXX. prefix
-    Converts "[LIVY-XXX] Issue", "LIVY-XXX Issue", "LIVY XXX: Issue" or "LIVY-XXX: Issue" to
-    "LIVY-XXX. Issue"
+    Standardize the [LIVY-XXXXX] [MODULE] prefix
+    Converts "[LIVY-XXX][repl] Issue", "[Repl] LIVY-XXX. Issue" or "LIVY XXX [REPL]: Issue" to
+    "[LIVY-XXX][REPL] Issue"
     """
     jira_refs = []
     components = []
 
     # If the string is compliant, no need to process any further
-    if (re.search(r'^LIVY-[0-9]{3,6}\. \S+', text)):
+    if (re.search(r'^\[LIVY-[0-9]{3,6}\](\[[A-Z0-9_\s,]+\] )+\S+', text)):
         return text
 
     # Extract JIRA ref(s):
     pattern = re.compile(r'(LIVY[-\s]*[0-9]{3,6})+', re.IGNORECASE)
     for ref in pattern.findall(text):
         # Add brackets, replace spaces with a dash, & convert to uppercase
-        jira_refs.append(re.sub(r'\s+', '-', ref.upper()))
+        jira_refs.append('[' + re.sub(r'\s+', '-', ref.upper()) + ']')
         text = text.replace(ref, '')
 
+    # Extract livy component(s):
+    # Look for alphanumeric chars, spaces, dashes, periods, and/or commas
+    pattern = re.compile(r'(\[[\w\s,-\.]+\])', re.IGNORECASE)
+    for component in pattern.findall(text):
+        components.append(component.upper())
+        text = text.replace(component, '')
+
     # Cleanup any remaining symbols:
     pattern = re.compile(r'^\W+(.*)', re.IGNORECASE)
     if (pattern.search(text) is not None):
         text = pattern.search(text).groups()[0]
 
-    # Assemble full text (JIRA ref(s), remaining text)
-    clean_text = ''.join(jira_refs).strip() + ". " + text.strip()
+    # Assemble full text (JIRA ref(s), module(s), remaining text)
+    clean_text = ''.join(jira_refs).strip() + ''.join(components).strip() + " " + text.strip()
 
     # Replace multiple spaces with a single space, e.g. if no jira refs and/or components were
     # included