Bug 1137442 - Try to use a try email commit description of at least 3 characters
authorEd Morley <emorley@mozilla.com>
Mon, 02 Mar 2015 18:36:53 +0000 (2015-03-02)
changeset 4115 79b669d659b08b1fdb787fcf7dac8e8046e3b084
parent 4113 6c4dd1d4bfb5df9c0dcb16f70d486370693150f1
child 4116 c27f27b0f93f48d7e4187ab5ec40de2d3d49cb2a
child 4125 797716224ab8b8df81335351feba00884692040f
push id3419
push useremorley@mozilla.com
push dateMon, 02 Mar 2015 18:37:27 +0000 (2015-03-02)
bugs1137442
Bug 1137442 - Try to use a try email commit description of at least 3 characters When iterating through the list of commits in a try push to extract a summary for the email, reject titles that are less than 3 characters.
status/generators.py
test/test_status.py
--- a/status/generators.py
+++ b/status/generators.py
@@ -48,12 +48,12 @@ def getSensibleCommitTitle(titles):
         title = re.sub(r'^(imported patch|\[mq\]:) ', '', title)
 
         # Remove review, feedback, etc. annotations.
         title = re.sub(r'\b(r|sr|f|a)[=\?].*', '', title)
 
         # Remove trailing punctuation and whitespace.
         title = re.sub(r'[;,\-\. ]+$', '', title).strip()
 
-        if title:
+        if len(title) > 2:
             return title
 
     return titles[0]
--- a/test/test_status.py
+++ b/test/test_status.py
@@ -4,16 +4,19 @@ from buildbot.changes import changes
 from buildbotcustom.status.generators import getSensibleCommitTitle
 
 SENSIBLE_TITLE_TESTCASES = [
     ['Bug 1', ['Bug 1']],
     ['Bug 1', ['Bug 1', 'Bug 2']],
 
     ['Bug 1', ['try: -b d -p all', 'Bug 1']],
     ['Bug 1', ['try: -b d -p all', 'try: -b d -p none', 'Bug 1']],
+    ['Bug 1', ['"try: -b d -p linux -u all -t none"', 'Bug 1']],
+
+    ['Bug 1', ['zz', 'Bug 1']],
 
     ['test.patch', ['[mq]: test.patch']],
     ['test.patch', ['imported patch test.patch']],
     ['test imported patch test.patch', ['test imported patch test.patch']],
 
     ['Bug 1 - Test', ['Bug 1 - Test; r=me']],
     ['Bug 1 - Test', ['Bug 1 - Test. r?me f=you']],