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.739 kb
4219143 Ben Hearsum bug 435472: Add option to tryserver to email the owner of the build on b...
bhearsum authored
1 import re
391a4d5 Chris AtLee Bug 469680: Implement ChangeNotifier which notifies people via email whe...
catlee authored
2
62ff0b1 Chris AtLee nobug: PEP8! r=bitrotallthethings
catlee authored
3
391a4d5 Chris AtLee Bug 469680: Implement ChangeNotifier which notifies people via email whe...
catlee authored
4 def buildTryChangeMessage(change, packageDir):
5 got_revision = revision = change.revision[:12]
6 who = change.who
45f85f8 Ed Morley Bug 1072163 - Remove links to TBPL from Try server emails
edmorley authored
7 tree = change.branch
391a4d5 Chris AtLee Bug 469680: Implement ChangeNotifier which notifies people via email whe...
catlee authored
8 packageDir = packageDir % locals()
9 msgdict = {"type": "plain"}
8f7f80c Bug 749151 Try server emails for try-comm-central include the wrong link...
Mark Banner authored
10 msgdict['subject'] = "%(tree)s submission %(revision)s" % locals()
45f85f8 Ed Morley 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 Chris AtLee Bug 469680: Implement ChangeNotifier which notifies people via email whe...
catlee authored
13 }
14 msgdict["body"] = """\
31f718e Ed Morley Bug 810995 - Remove hgweb link from "thank you for your try submission" ...
edmorley authored
15 Thank you for your try submission. It's the best!
391a4d5 Chris AtLee Bug 469680: Implement ChangeNotifier which notifies people via email whe...
catlee authored
16
fcc6c30 Ed Morley Bug 1072159 - Emphasise treeherder URLs in Try emails & fix for try-comm...
edmorley authored
17 Results will be displayed on Treeherder as they come in:
70e265d Ed Morley Bug 1043880 - Update Treeherder URL to shorter form now bug 1063411 is f...
edmorley authored
18 https://treeherder.mozilla.org/#/jobs?repo=%(tree)s&revision=%(revision)s
870f44d Lukas Blakk Bug 620679 - updated try email links to single push tbpl view p=lsblakk ...
lsblakk authored
19
31f718e Ed Morley Bug 810995 - Remove hgweb link from "thank you for your try submission" ...
edmorley authored
20 Once completed, builds and logs will be available at:
21 %(packageDir)s
391a4d5 Chris AtLee Bug 469680: Implement ChangeNotifier which notifies people via email whe...
catlee authored
22 """ % locals()
23
eda5254 Birunthan Mohanathas 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 Chris AtLee Bug 469680: Implement ChangeNotifier which notifies people via email whe...
catlee authored
36 return msgdict
eda5254 Birunthan Mohanathas Bug 1048322 - Include commit messages in Try submission emails. r=catlee
poiru authored
37
fcc6c30 Ed Morley Bug 1072159 - Emphasise treeherder URLs in Try emails & fix for try-comm...
edmorley authored
38
eda5254 Birunthan Mohanathas 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 Ed Morley Bug 1074826 - Clean up some pyflakes & PEP8 warnings in buildbotcustom; ...
edmorley authored
48 title = re.sub(r'^(imported patch|\[mq\]:) ', '', title)
eda5254 Birunthan Mohanathas 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 Ed Morley Bug 1074826 - Clean up some pyflakes & PEP8 warnings in buildbotcustom; ...
edmorley authored
54 title = re.sub(r'[;,\-\. ]+$', '', title).strip()
eda5254 Birunthan Mohanathas Bug 1048322 - Include commit messages in Try submission emails. r=catlee
poiru authored
55
56 if title:
57 return title
58
59 return titles[0]
Something went wrong with that request. Please try again.