bodhi/config/app.cfg | 8 ++++++++ bodhi/controllers.py | 17 ++++++++++++++++- bodhi/model.py | 16 ++++++++++++++++ bodhi/templates/show.kid | 9 ++------- 4 files changed, 42 insertions(+), 8 deletions(-)
New commits: commit 3c0f462a11f6a8f72e60f743d648eb09bb9e8129 Author: Luke Macken lmacken@redhat.com Date: Wed Feb 23 16:46:50 2011 -0500
Support basic configurable update policy based on release 'status'.
This allows us to update bodhi's config file and change the status of a release, along with some policy variables such as the number of days that an update must spend in testing, and the number of proventesters that must +1 a critpath update.
diff --git a/bodhi/config/app.cfg b/bodhi/config/app.cfg index 6abf88d..1feaf50 100644 --- a/bodhi/config/app.cfg +++ b/bodhi/config/app.cfg @@ -182,6 +182,14 @@ critpath.min_karma = 2 fedora.mandatory_days_in_testing = 7 fedora_epel.mandatory_days_in_testing = 14
+# Release status +# pre-beta enforces the Pre Beta policy defined here: +# https://fedoraproject.org/wiki/Updates_Policy +f15.status = 'pre_beta' +f15.pre_beta.mandatory_days_in_testing = 3 +f15.pre_beta.critpath.num_admin_approvals = 1 +f15.pre_beta.critpath.min_karma = 1 + testing_approval_msg = "This update has reached %d days in testing and can be pushed to stable now if the maintainer wishes"
not_yet_tested_msg = 'This update has not yet met the minimum testing requirements defined in the <a href="https://fedoraproject.org/wiki/Package_update_acceptance_criteria">Package Update Acceptance Criteria</a>' diff --git a/bodhi/model.py b/bodhi/model.py index 2f3a241..3748ec8 100644 --- a/bodhi/model.py +++ b/bodhi/model.py @@ -122,6 +122,12 @@ class Release(SQLObject):
@property def mandatory_days_in_testing(self): + name = self.name.lower().replace('-', '') + status = config.get('%s.status' % name, None) + if status: + days = config.get('%s.%s.mandatory_days_in_testing' % (name, status)) + if days: + return days return config.get('%s.mandatory_days_in_testing' % self.id_prefix.lower().replace('-', '_'))
@@ -1062,6 +1068,16 @@ class PackageUpdate(SQLObject): @property def critpath_approved(self): """ Return whether or not this critpath update has been approved """ + release_name = self.release.name.lower().replace('-', '') + status = config.get('%s.status' % release_name, None) + if status: + num_admin_approvals = config.get('%s.%s.critpath.num_admin_approvals' % ( + release_name, status), None) + min_karma = config.get('%s.%s.critpath.min_karma' % ( + release_name, status), None) + if num_admin_approvals and min_karma: + return self.num_admin_approvals >= num_admin_approvals and \ + self.karma >= min_karma return self.num_admin_approvals >= config.get( 'critpath.num_admin_approvals', 2) and \ self.karma >= config.get('critpath.min_karma', 2)
commit 9c3582aef8cf7af3276feaec3d6ec5583e9666a4 Author: Luke Macken lmacken@redhat.com Date: Wed Feb 23 15:34:40 2011 -0500
Query for unit tests upon submission
diff --git a/bodhi/controllers.py b/bodhi/controllers.py index 1e41831..5b9c3c3 100644 --- a/bodhi/controllers.py +++ b/bodhi/controllers.py @@ -949,7 +949,6 @@ class Root(controllers.RootController): log.error("Unknown exception thrown from python-bugzilla!") note.insert(0, "Unable to access one or more bugs. Exception: %s" % e)
- # If there are any security bugs, make sure this update is # properly marked as a security update if update.type != 'security': @@ -958,6 +957,22 @@ class Root(controllers.RootController): update.type = 'security' break
+ # Append links to unit tests in the update notes + try: + test_cases = [] + for build in update.builds: + test_cases.extend(build.package.get_test_cases()) + # HACK: shove the unit tests into this PickleCol + if test_cases: + if not update.nagged: + nagged = {} + else: + nagged = update.nagged + nagged['test_cases'] = test_cases + update.nagged = nagged + except Exception, e: + log.exception(e) + # Send out mail notifications if edited: #mail.send(update.get_maintainers(), 'edited', update) diff --git a/bodhi/templates/show.kid b/bodhi/templates/show.kid index 8a6a84b..458f082 100644 --- a/bodhi/templates/show.kid +++ b/bodhi/templates/show.kid @@ -57,11 +57,6 @@ statusinfo = { 'obsolete': 'Obsolete - <b>This update has been obsoleted by a newer update.</b>', 'stable': 'Stable - <b>This update has been released to the stable updates repository and is available for all users to install via the standard update mechanisms.</b>', } - -## Build a list of test cases for this update -test_cases = [] -for build in update.builds: - test_cases.extend(build.package.get_test_cases()) ?>
<body> @@ -251,9 +246,9 @@ for build in update.builds: </blockquote> </div>
- <div py:if="test_cases"> + <div py:if="update.nagged and 'test_cases' in update.nagged.keys() and update.nagged['test_cases']"> <div class="show">Test Cases</div> - <ul py:for="test in test_cases"> + <ul py:for="test in update.nagged['test_cases']"> <li style="line-height:0px;"><a href="https://fedoraproject.org/wiki/${test}">${test.replace('QA:Testcase', '')}</a></li> </ul> </div>