bodhi/config/app.cfg | 2 ++
bodhi/model.py | 3 +++
bodhi/tests/test_controllers.py | 10 ++++++----
3 files changed, 11 insertions(+), 4 deletions(-)
New commits:
commit 1afc02a269d3f118e17d1a030c997cf95b22e014
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Oct 19 11:08:58 2010 -0400
Comment on updates upon reaching the stable karma threshold (#489)
diff --git a/bodhi/config/app.cfg b/bodhi/config/app.cfg
index 9bdc7ce..ad99f39 100644
--- a/bodhi/config/app.cfg
+++ b/bodhi/config/app.cfg
@@ -16,6 +16,8 @@ frontpage_notice = ''
# A notice to flash on the New Update page
newupdate_notice = ''
+stablekarma_comment = 'This update has reached the stable karma threshold and will be
pushed to the stable updates repository'
+
##
## Mash settings
##
diff --git a/bodhi/model.py b/bodhi/model.py
index a01b148..768b003 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -808,6 +808,7 @@ class PackageUpdate(SQLObject):
if (self.stable_karma < min_karma and self.critpath_approved and
self.karma >= min_karma and self.pushable):
self.request = 'stable'
+ self.comment(config.get('stablekarma_comment'),
author='bodhi')
mail.send(self.submitter, 'stablekarma', self)
mail.send_admin('stablekarma', self)
# If we're approved and meet the minimum requirements, then
@@ -816,6 +817,7 @@ class PackageUpdate(SQLObject):
self.karma >= self.stable_karma and
self.karma >= min_karma):
self.request = 'stable'
+ self.comment(config.get('stablekarma_comment'),
author='bodhi')
mail.send(self.submitter, 'stablekarma', self)
mail.send_admin('stablekarma', self)
@@ -825,6 +827,7 @@ class PackageUpdate(SQLObject):
self.request = 'stable'
self.pushed = False
#self.date_pushed = None
+ self.comment(config.get('stablekarma_comment'),
author='bodhi')
mail.send(self.submitter, 'stablekarma', self)
mail.send_admin('stablekarma', self)
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index fb69a6d..0eaec14 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -1969,10 +1969,12 @@ class TestControllers(testutil.DBTest):
assert update.critpath
assert update.critpath_approved
#assert False, testutil.get_log()
- assert len(update.comments) == 3, update.comments
- assert update.comments[1].author == 'bob', update.comments
- assert update.comments[2].author == 'bodhi', update.comments
- assert update.comments[2].text == 'Critical path update approved'
+ assert len(update.comments) == 4, update.comments
+ assert update.comments[1].author == 'bodhi', update.comments
+ assert update.comments[1].text == config.get('stablekarma_comment')
+ assert update.comments[2].author == 'bob', update.comments
+ assert update.comments[-1].author == 'bodhi', update.comments
+ assert update.comments[-1].text == 'Critical path update approved'
def test_critpath_request_complete(self):
"""
Show replies by date