[ 
https://issues.apache.org/jira/browse/ARROW-2185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16373743#comment-16373743
 ] 

ASF GitHub Bot commented on ARROW-2185:
---------------------------------------

wesm closed pull request #1639: ARROW-2185: Strip CI directives from commit 
messages
URL: https://github.com/apache/arrow/pull/1639
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/dev/merge_arrow_pr.py b/dev/merge_arrow_pr.py
index 6c0e66376..74f0762c3 100755
--- a/dev/merge_arrow_pr.py
+++ b/dev/merge_arrow_pr.py
@@ -175,7 +175,8 @@ def merge_pr(pr_num, target_ref):
         "Closes #%s from %s and squashes the following commits:"
         % (pr_num, pr_repo_desc)]
     for c in commits:
-        merge_message_flags += ["-m", c]
+        stripped_message = strip_ci_directives(c).strip()
+        merge_message_flags += ["-m", stripped_message]
 
     run_cmd(['git', 'commit',
              '--no-verify',  # do not run commit hooks
@@ -199,6 +200,15 @@ def merge_pr(pr_num, target_ref):
     return merge_hash
 
 
+_REGEX_CI_DIRECTIVE = re.compile('\[[^\]]*\]')
+
+
+def strip_ci_directives(commit_message):
+    # Remove things like '[force ci]', '[skip appveyor]' from the assembled
+    # commit message
+    return _REGEX_CI_DIRECTIVE.sub('', commit_message)
+
+
 def fix_version_from_branch(branch, versions):
     # Note: Assumes this is a sorted (newest->oldest) list of un-released
     # versions
@@ -209,7 +219,7 @@ def fix_version_from_branch(branch, versions):
         return [x for x in versions if x.name.startswith(branch_ver)][-1]
 
 
-def exctract_jira_id(title):
+def extract_jira_id(title):
     m = re.search(r'^(ARROW-[0-9]+)\b.*$', title)
     if m:
         return m.group(1)
@@ -219,7 +229,7 @@ def exctract_jira_id(title):
 
 
 def check_jira(title):
-    jira_id = exctract_jira_id(title)
+    jira_id = extract_jira_id(title)
     asf_jira = jira.client.JIRA({'server': JIRA_API_BASE},
                                 basic_auth=(JIRA_USERNAME, JIRA_PASSWORD))
     try:
@@ -232,7 +242,7 @@ def resolve_jira(title, merge_branches, comment):
     asf_jira = jira.client.JIRA({'server': JIRA_API_BASE},
                                 basic_auth=(JIRA_USERNAME, JIRA_PASSWORD))
 
-    default_jira_id = exctract_jira_id(title)
+    default_jira_id = extract_jira_id(title)
 
     jira_id = input("Enter a JIRA id [%s]: " % default_jira_id)
     if jira_id == "":


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Remove CI directives from squashed commit messages
> --------------------------------------------------
>
>                 Key: ARROW-2185
>                 URL: https://issues.apache.org/jira/browse/ARROW-2185
>             Project: Apache Arrow
>          Issue Type: Improvement
>            Reporter: Wes McKinney
>            Assignee: Wes McKinney
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.9.0
>
>
> In our PR squash tool, we are potentially picking up CI directives like 
> {{[skip appveyor]}} from intermediate commits. We should regex these away and 
> instead use directives in the PR title if we wish the commit to master to 
> behave in a certain way



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to