Bug 1352809 - Use shorter revision id for e-mail subject; r?catlee draft
authorAryeh Gregor <ayg@aryeh.name>
Tue, 15 Aug 2017 14:26:16 +0300
changeset 5192 350925c02e717ac2fa4d9c4a5bd2a75b4f56dc17
parent 5186 c48ef0db803e9a41faa37b5ba832acfdd8e38e88
push id3669
push userbmo:ayg@aryeh.name
push dateTue, 15 Aug 2017 11:31:09 +0000
reviewerscatlee
bugs1352809, 1297414
Bug 1352809 - Use shorter revision id for e-mail subject; r?catlee On a narrow screen, the e-mail subject is truncated when viewing your inbox (at least in Gmail), so you get e-mail subjects like try submission 4b1ebb3fda263851ba0ca804f8ea6bb72a09 which is not very helpful if you have several such e-mails. Instead, output just a prefix of the hash, so the rest is visible, like this: try submission 4b1ebb3: Bug 1297414 - Change defaul It might be reasonable to omit the hash entirely, and/or the word "submission", but this change should be good enough for me to tell apart the e-mails in my inbox.
status/generators.py
--- a/status/generators.py
+++ b/status/generators.py
@@ -1,18 +1,19 @@
 import re
 
 
 def buildTryChangeMessage(change, packageDir):
     got_revision = revision = change.revision
+    short_revision = revision[:7]
     who = change.who
     tree = change.branch
     packageDir = packageDir % locals()
     msgdict = {"type": "plain"}
-    msgdict['subject'] = "%(tree)s submission %(revision)s" % locals()
+    msgdict['subject'] = "%(tree)s submission %(short_revision)s" % locals()
     msgdict['headers'] = {"In-Reply-To": "<%(tree)s-%(revision)s>" % locals(),
                           "References": "<%(tree)s-%(revision)s>" % locals(),
                           }
     msgdict["body"] = """\
 Thank you for your try submission. It's the best!
 
 Results will be displayed on Treeherder as they come in:
 https://treeherder.mozilla.org/#/jobs?repo=%(tree)s&revision=%(revision)s