Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 60 lines (44 sloc) 1.748 kb
4219143 @bhearsum bug 435472: Add option to tryserver to email the owner of the build o…
bhearsum authored
1 import re
391a4d5 @catlee Bug 469680: Implement ChangeNotifier which notifies people via email …
catlee authored
2
62ff0b1 @catlee nobug: PEP8! r=bitrotallthethings
catlee authored
3
391a4d5 @catlee Bug 469680: Implement ChangeNotifier which notifies people via email …
catlee authored
4 def buildTryChangeMessage(change, packageDir):
5 got_revision = revision = change.revision[:12]
6 who = change.who
45f85f8 @edmorley Bug 1072163 - Remove links to TBPL from Try server emails
edmorley authored
7 tree = change.branch
391a4d5 @catlee Bug 469680: Implement ChangeNotifier which notifies people via email …
catlee authored
8 packageDir = packageDir % locals()
9 msgdict = {"type": "plain"}
8f7f80c Bug 749151 Try server emails for try-comm-central include the wrong l…
Mark Banner authored
10 msgdict['subject'] = "%(tree)s submission %(revision)s" % locals()
45f85f8 @edmorley Bug 1072163 - Remove links to TBPL from Try server emails
edmorley authored
11 msgdict['headers'] = {"In-Reply-To": "<%(tree)s-%(revision)s>" % locals(),
12 "References": "<%(tree)s-%(revision)s>" % locals(),
391a4d5 @catlee Bug 469680: Implement ChangeNotifier which notifies people via email …
catlee authored
13 }
14 msgdict["body"] = """\
31f718e @edmorley Bug 810995 - Remove hgweb link from "thank you for your try submissio…
edmorley authored
15 Thank you for your try submission. It's the best!
391a4d5 @catlee Bug 469680: Implement ChangeNotifier which notifies people via email …
catlee authored
16
fcc6c30 @edmorley Bug 1072159 - Emphasise treeherder URLs in Try emails & fix for try-c…
edmorley authored
17 Results will be displayed on Treeherder as they come in:
70e265d @edmorley Bug 1043880 - Update Treeherder URL to shorter form now bug 1063411 i…
edmorley authored
18 https://treeherder.mozilla.org/#/jobs?repo=%(tree)s&revision=%(revision)s
870f44d @lsblakk Bug 620679 - updated try email links to single push tbpl view p=lsbla…
lsblakk authored
19
31f718e @edmorley Bug 810995 - Remove hgweb link from "thank you for your try submissio…
edmorley authored
20 Once completed, builds and logs will be available at:
21 %(packageDir)s
391a4d5 @catlee Bug 469680: Implement ChangeNotifier which notifies people via email …
catlee authored
22 """ % locals()
23
eda5254 @poiru Bug 1048322 - Include commit messages in Try submission emails. r=catlee
poiru authored
24 commitTitles = change.properties.getProperty('commit_titles')
25 if commitTitles:
26 title = getSensibleCommitTitle(commitTitles)
27 allTitles = '\n * '.join(commitTitles)
28
29 msgdict['subject'] += ': %(title)s' % locals()
30 msgdict['body'] += """\
31
32 Summary:
33 * %(allTitles)s
34 """ % locals()
35
391a4d5 @catlee Bug 469680: Implement ChangeNotifier which notifies people via email …
catlee authored
36 return msgdict
eda5254 @poiru Bug 1048322 - Include commit messages in Try submission emails. r=catlee
poiru authored
37
fcc6c30 @edmorley Bug 1072159 - Emphasise treeherder URLs in Try emails & fix for try-c…
edmorley authored
38
eda5254 @poiru Bug 1048322 - Include commit messages in Try submission emails. r=catlee
poiru authored
39 def getSensibleCommitTitle(titles):
40 """
41 Returns the first non-trychooser title with unnecessary cruft removed.
42 """
43 for title in titles:
44 # Remove trychooser syntax.
45 title = re.sub(r'\btry: .*', '', title)
46
47 # Remove MQ cruft.
75e3f93 @edmorley Bug 1074826 - Clean up some pyflakes & PEP8 warnings in buildbotcusto…
edmorley authored
48 title = re.sub(r'^(imported patch|\[mq\]:) ', '', title)
eda5254 @poiru Bug 1048322 - Include commit messages in Try submission emails. r=catlee
poiru authored
49
50 # Remove review, feedback, etc. annotations.
51 title = re.sub(r'\b(r|sr|f|a)[=\?].*', '', title)
52
53 # Remove trailing punctuation and whitespace.
75e3f93 @edmorley Bug 1074826 - Clean up some pyflakes & PEP8 warnings in buildbotcusto…
edmorley authored
54 title = re.sub(r'[;,\-\. ]+$', '', title).strip()
eda5254 @poiru Bug 1048322 - Include commit messages in Try submission emails. r=catlee
poiru authored
55
a039e2c @edmorley Bug 1137442 - Try to use a try email commit description of at least 3…
edmorley authored
56 if len(title) > 2:
eda5254 @poiru Bug 1048322 - Include commit messages in Try submission emails. r=catlee
poiru authored
57 return title
58
59 return titles[0]
Something went wrong with that request. Please try again.