bodhi.spec | 2 - bodhi/config/app.cfg | 6 ++++ bodhi/jobs.py | 4 --- bodhi/mail.py | 2 + bodhi/model.py | 15 ++++++++---- bodhi/release.py | 2 - bodhi/tests/test_controllers.py | 50 ++++++++++++++++++++++++++++++++++++++++ bodhi/tools/client.py | 2 - 8 files changed, 72 insertions(+), 11 deletions(-)
New commits: commit db390967cac7fc1ec2a4c5e41399251e818c0236 Author: Luke Macken lmacken@redhat.com Date: Tue Nov 22 17:06:46 2011 -0500
Prep for 0.8.5
diff --git a/bodhi.spec b/bodhi.spec index b6270be..fd6dcaf 100644 --- a/bodhi.spec +++ b/bodhi.spec @@ -2,7 +2,7 @@ %{!?pyver: %define pyver %(%{__python} -c "import sys ; print sys.version[:3]")}
Name: bodhi -Version: 0.8.4 +Version: 0.8.5 Release: 1%{?dist} Summary: A modular framework that facilitates publishing software updates Group: Applications/Internet diff --git a/bodhi/release.py b/bodhi/release.py index 7cee46a..4a378ab 100644 --- a/bodhi/release.py +++ b/bodhi/release.py @@ -1,4 +1,4 @@ -VERSION = '0.8.4' +VERSION = '0.8.5' NAME = 'bodhi' DESCRIPTION = 'Bodhi is a modular web-system that facilitates the process of publishing updates for a Fedora-based software distribution' AUTHOR = 'Luke Macken' diff --git a/bodhi/tools/client.py b/bodhi/tools/client.py index b2e179f..fddac2b 100755 --- a/bodhi/tools/client.py +++ b/bodhi/tools/client.py @@ -15,7 +15,7 @@ # Copyright 2007-2010 Red Hat, Inc # Authors: Luke Macken lmacken@redhat.com
-__version__ = '0.8.4' +__version__ = '0.8.5' __description__ = 'Command line tool for interacting with Bodhi'
import sys
commit 7aec571469d50689694d5a431d3d31fb02af51c7 Author: Luke Macken lmacken@redhat.com Date: Tue Nov 22 17:05:37 2011 -0500
Allow critpath to submit for stable after 2 weeks with no negative karma (#642)
diff --git a/bodhi/config/app.cfg b/bodhi/config/app.cfg index 4c655b2..d754828 100644 --- a/bodhi/config/app.cfg +++ b/bodhi/config/app.cfg @@ -204,6 +204,9 @@ critpath.num_admin_approvals = 1 # The net karma required to submit a critial path update to a pending release) critpath.min_karma = 2
+# Allow critpath to submit for stable after 2 weeks with no negative karma +critpath.stable_after_days_without_negative_karma = 14 + # The minimum amount of time an update must spend in testing before # it can reach the stable repository fedora.mandatory_days_in_testing = 7 diff --git a/bodhi/jobs.py b/bodhi/jobs.py index 7a319dd..0a3d9bf 100644 --- a/bodhi/jobs.py +++ b/bodhi/jobs.py @@ -189,10 +189,6 @@ def approve_testing_updates(): # If this has already met testing requirements, skip it if update.met_testing_requirements: continue - # If this is a critpath update, skip it, since they have their own - # testing requirements, aside from spending time in testing. - if update.critpath: - continue if update.meets_testing_requirements: log.info('%s now meets testing requirements' % update.title) update.comment( diff --git a/bodhi/model.py b/bodhi/model.py index 22addef..2b1c805 100644 --- a/bodhi/model.py +++ b/bodhi/model.py @@ -493,11 +493,14 @@ class PackageUpdate(SQLObject): 'repository. It must first reach a karma ' 'of %d, consisting of %d positive karma from ' 'proventesters, along with %d additional ' - 'karma from the community.' % ( + 'karma from the community. Or, it must ' + 'spend %d days in testing without any ' + 'negative feedback' % ( config.get('critpath.min_karma'), config.get('critpath.num_admin_approvals'), config.get('critpath.min_karma') - - config.get('critpath.num_admin_approvals'))) + config.get('critpath.num_admin_approvals'), + config.get('critpath.stable_after_days_without_negative_karma'))) if self.status == 'testing': self.request = None flash_log('. '.join(notes)) @@ -1116,6 +1119,9 @@ class PackageUpdate(SQLObject): if num_admin_approvals and min_karma: return self.num_admin_approvals >= num_admin_approvals and \ self.karma >= min_karma + # https://fedorahosted.org/bodhi/ticket/642 + if self.meets_testing_requirements: + return True return self.num_admin_approvals >= config.get( 'critpath.num_admin_approvals', 2) and \ self.karma >= config.get('critpath.min_karma', 2) @@ -1175,7 +1181,8 @@ class PackageUpdate(SQLObject): simply return True. """ if self.critpath: - return self.critpath_approved + num_days = config.get('critpath.stable_after_days_without_negative_karma') + return self.days_in_testing >= num_days num_days = self.release.mandatory_days_in_testing if not num_days: return True diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py index 111842b..82df22e 100644 --- a/bodhi/tests/test_controllers.py +++ b/bodhi/tests/test_controllers.py @@ -2105,6 +2105,56 @@ class TestControllers(testutil.DBTest): update.request_complete() assert not update.request
+ def test_critpath_two_weeks_without_negative_karma(self): + """ + Ensure critpath updates can be pushed to stable after two weeks without + any negative feedback. + """ + releng = login(group='proventesters') + create_release(locked=True) + params = { + 'builds' : 'kernel-2.6.31-1.fc7', + 'release' : 'Fedora 7', + 'type_' : 'bugfix', + 'bugs' : '', + 'notes' : 'foobar', + 'autokarma': True, + 'stable_karma' : 3, + 'request': None, + 'unstable_karma' : -3, + 'autokarma': True, + } + self.save_update(params, releng) + update = PackageUpdate.byTitle(params['builds']) + testutil.create_request('/updates/%s' % params['builds'], + method='GET', headers=releng) + + # Ensure releng/QA can't push critpath updates alone + assert "Push to Testing" in cherrypy.response.body[0] + assert "Push Critical Path update to Stable" not in cherrypy.response.body[0] + testutil.create_request('/updates/request/stable/%s' % + params['builds'], method='POST', + headers=releng) + update = PackageUpdate.byTitle(params['builds']) + assert update.request == 'testing', update.request + + # Time travel + update.pushed = True + update.request = None + update.status = 'testing' + update.status_comment() + update.comments[-1].timestamp -= timedelta(days=14) + + # Ensure it can now be pushed + testutil.create_request('/updates/%s' % params['builds'], + method='GET', headers=releng) + + testutil.create_request('/updates/request/stable/%s' % + params['builds'], method='POST', + headers=releng) + update = PackageUpdate.byTitle(params['builds']) + assert update.request == 'stable', update.request + def test_created_since(self): session = login() create_release()
commit 35d387dff78d70dc44ba6c781aefdacfc563cf75 Author: Luke Macken lmacken@redhat.com Date: Tue Nov 22 14:59:23 2011 -0500
TurboMail3 expects full email addresses, not just usernames.
diff --git a/bodhi/config/app.cfg b/bodhi/config/app.cfg index c779dfb..4c655b2 100644 --- a/bodhi/config/app.cfg +++ b/bodhi/config/app.cfg @@ -22,6 +22,9 @@ stablekarma_comment = 'This update has reached the stable karma threshold and wi query_wiki_test_cases = False wiki_url = 'https://fedoraproject.org/w/api.php'
+# Email domain to prepend usernames to +default_email_domain = 'fedoraproject.org' + ## ## Mash settings ## diff --git a/bodhi/mail.py b/bodhi/mail.py index e84fdee..1c05567 100644 --- a/bodhi/mail.py +++ b/bodhi/mail.py @@ -437,6 +437,8 @@ def send_mail(sender, to, subject, body): from turbomail import MailNotEnabledException if to in config.get('exclude_mail').split(): return + if '@' not in to: + to = '%s@%s' % (to, config.get('default_email_domain')) message = turbomail.Message(sender, to, subject) message.plain = body try:
commit 64844ec8f2ced37cfb92582d3b7c8b12a584f537 Author: Luke Macken lmacken@redhat.com Date: Tue Nov 22 14:50:41 2011 -0500
The pkgdb expects lower-case collection names
diff --git a/bodhi/model.py b/bodhi/model.py index 9215299..22addef 100644 --- a/bodhi/model.py +++ b/bodhi/model.py @@ -1077,7 +1077,7 @@ class PackageUpdate(SQLObject): def critpath(self): """ Return whether or not this update is in the critical path """ critical = False - critpath_pkgs = get_critpath_pkgs() + critpath_pkgs = get_critpath_pkgs(self.release.name.lower()) if not critpath_pkgs: # Optimize case where there's no critpath packages return False