[RFE] Adding darkserver in the workflow of bodhi
by Kushal Das
Hi all,
Darkserver is a service written to help people finding details of
build-id(s). People will be able query the service based on
build-id(s) or rpm package names. The service will provide output in
JSON format as it will be easier for other tools to parse the output.
Now to import the data into darkserver , the import command needs to
run on each rpm goes out to people. Bodhi is place through which all
rpms go out. It will only require to run one import command to run for
the each rpm. The darkserver-import command will import the details to
mysql database.
I have a details sketch of the flow at [1].
People are waiting to use this service to write helper tools.
[1] http://kushal.fedorapeople.org/darkserver_idea.png
Kushal
--
http://fedoraproject.org
http://kushaldas.in
12 years, 4 months
4 commits - bodhi/controllers.py bodhi/model.py setup.py
by Luke Macken
bodhi/controllers.py | 30 +++++++++++++++---------------
bodhi/model.py | 3 +--
setup.py | 2 ++
3 files changed, 18 insertions(+), 17 deletions(-)
New commits:
commit 854efbfaaa98cc3326f9be42202bec24d0eb0454
Merge: 6ffa2a6 dd36e4d
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Nov 26 10:22:13 2011 -0500
Merge branch 'master' of git+ssh://git.fedorahosted.org/git/bodhi
commit 6ffa2a68abf107edcbe9757a3e8ed7332b333f32
Merge: 8d7c5cd 7724243
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Nov 16 12:58:58 2011 -0500
Merge branch 'master' of git+ssh://git.fedorahosted.org/git/bodhi
commit 8d7c5cd10979f6e59a6f01b93cb87a92084510d2
Merge: 8a9f895 e72d070
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Oct 27 15:25:13 2011 -0400
Merge branch 'master' of git+ssh://git.fedorahosted.org/git/bodhi
commit 8a9f895f94a541a10882565b0719294bc920eff2
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Oct 18 13:51:48 2011 -0400
Merge
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 5909b85..aea71a3 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -629,19 +629,18 @@ class Root(controllers.RootController):
raise InvalidUpdateException(params)
# Make sure this update doesn't already exist
- if not edited:
- for build in builds:
- try:
- b = PackageBuild.byNvr(build)
- if request_format() == 'json':
- flash_log("%s update already exists!" % build)
- return dict()
- else:
- flash_log("%s update already exists!" %
- link(build, b.get_url()))
- raise redirect('/new', **params)
- except SQLObjectNotFound:
- pass
+ for build in builds:
+ try:
+ b = PackageBuild.byNvr(build)
+ if request_format() == 'json':
+ flash_log("%s update already exists!" % build)
+ return dict()
+ else:
+ flash_log("%s update already exists!" %
+ link(build, b.get_url()))
+ raise redirect('/new', **params)
+ except SQLObjectNotFound:
+ pass
# Make sure the submitter has commit access to these builds
for build in builds:
@@ -693,8 +692,9 @@ class Root(controllers.RootController):
# Verify that the user is either in the committers list, or is
# a member of a groups that has privileges to commit to this package
if not identity.current.user_name in people and \
- not filter(lambda group: group in identity.current.groups,
- config.get('admin_groups').split()) and \
+ # Disallow admin_groups from pushing anything
+ #not filter(lambda group: group in identity.urrent.groups,
+ # config.get('admin_groups').split()) and \
not filter(lambda x: x in identity.current.groups, groups[0]):
flash_log("%s does not have commit access to %s" % (
identity.current.user_name, pkg))
diff --git a/bodhi/model.py b/bodhi/model.py
index e0ebcf7..eaef7f3 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -949,7 +949,6 @@ class PackageUpdate(SQLObject):
# self.expire_buildroot_overrides()
#except Exception, e:
# log.exception(e)
- # log.error('There was non-fatal problem expiring the override')
self.pushed = False
self.status = 'pending'
@@ -985,7 +984,7 @@ class PackageUpdate(SQLObject):
self.remove_tag(self.release.pending_stable_tag)
# Expire any buildroot overrides
- self.expire_buildroot_overrides()
+ #self.expire_buildroot_overrides()
self.status = 'obsolete'
self.request = None
diff --git a/setup.py b/setup.py
index fd1e801..9c140de 100755
--- a/setup.py
+++ b/setup.py
@@ -167,6 +167,8 @@ setup(
"python_fedora",
#"markdown",
"CherryPy<3.0",
+ "kitchen",
+ "python-fedora",
#"hashlib",
],
scripts = [],
12 years, 4 months
bodhi.egg-info/PKG-INFO bodhi/model.py bodhi/tests
by Luke Macken
bodhi.egg-info/PKG-INFO | 2 -
bodhi/model.py | 11 ++++++++
bodhi/tests/test_controllers.py | 52 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 64 insertions(+), 1 deletion(-)
New commits:
commit dd36e4d8fada89bfae5ba66d865b1d2575eb8d59
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Nov 22 23:07:28 2011 -0500
Disallow pushing critpath to stable after 2 weeks in testing if there is negative karma
diff --git a/bodhi.egg-info/PKG-INFO b/bodhi.egg-info/PKG-INFO
index 2c063a8..bb2ae46 100644
--- a/bodhi.egg-info/PKG-INFO
+++ b/bodhi.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: bodhi
-Version: 0.8.4
+Version: 0.8.5
Summary: Bodhi is a modular web-system that facilitates the process of publishing updates for a Fedora-based software distribution
Home-page: https://fedorahosted.org/bodhi
Author: Luke Macken
diff --git a/bodhi/model.py b/bodhi/model.py
index 2b1c805..e213b7d 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -24,6 +24,7 @@ from kid import XML
from kid.element import encode_entity
from sqlobject import *
from datetime import datetime
+from collections import defaultdict
from turbogears import config
from turbogears.database import PackageHub
@@ -1181,6 +1182,16 @@ class PackageUpdate(SQLObject):
simply return True.
"""
if self.critpath:
+ # Ensure there is no negative karma. We're looking at the sum of
+ # each users karma for this update, which takes into account
+ # changed votes.
+ feedback = defaultdict(int)
+ for comment in self.comments:
+ if not comment.anonymous:
+ feedback[comment.author] += comment.karma
+ for karma in feedback.values():
+ if karma < 0:
+ return False
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
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index 82df22e..0762163 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -2148,6 +2148,7 @@ class TestControllers(testutil.DBTest):
# Ensure it can now be pushed
testutil.create_request('/updates/%s' % params['builds'],
method='GET', headers=releng)
+ assert "Mark Critical Path update as Stable" in cherrypy.response.body[0]
testutil.create_request('/updates/request/stable/%s' %
params['builds'], method='POST',
@@ -2155,6 +2156,57 @@ class TestControllers(testutil.DBTest):
update = PackageUpdate.byTitle(params['builds'])
assert update.request == 'stable', update.request
+ def test_critpath_two_weeks_with_negative_karma(self):
+ """
+ Ensure critpath updates cannot be pushed to stable after two weeks with
+ 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)
+
+ # Give some negative karma
+ testutil.create_request('/updates/comment?text=foobar&title=%s&karma=-1' %
+ params['builds'], method='POST', headers=releng)
+
+ # Ensure it cannot now be pushed
+ 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()
12 years, 4 months
bodhi/util.py
by Luke Macken
bodhi/util.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 1c136b1d637fd77967a724fca485d5e6eb460f5b
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Nov 22 18:44:23 2011 -0500
Cache our critpath list for 1 day by default
diff --git a/bodhi/util.py b/bodhi/util.py
index 97615df..014da5c 100644
--- a/bodhi/util.py
+++ b/bodhi/util.py
@@ -295,9 +295,9 @@ def get_pkg_pushers(pkgName, collectionName='Fedora', collectionVersion='devel')
return ((pAllowed, pNotify), (gAllowed, gNotify))
-def cache_with_expire(expire=600):
+def cache_with_expire(expire=86400):
# expire is the number of seconds to cache for.
- # Default is 600s == 10 minutes
+ # Default is 86400s == 24 hours
_cache = {}
def cached(func, *args, **kwargs):
# Setup the args
12 years, 4 months
4 commits - bodhi/config bodhi/jobs.py bodhi/mail.py bodhi/model.py bodhi/release.py bodhi.spec bodhi/tests bodhi/tools
by Luke Macken
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(a)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(a)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(a)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(a)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(a)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
12 years, 4 months
6 commits - bodhi/config bodhi/model.py bodhi/util.py
by Luke Macken
bodhi/config/app.cfg | 5 +++++
bodhi/model.py | 11 +++++------
bodhi/util.py | 50 ++++++++++++++++++++++++++++++++++++++++++++++++--
3 files changed, 58 insertions(+), 8 deletions(-)
New commits:
commit 38be693881dedf8b67b5e5fb35687c01ef120ecc
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Nov 21 22:20:26 2011 -0500
The PackageDB call returns Bunch(collection=[]), so only return a list.
diff --git a/bodhi/util.py b/bodhi/util.py
index 54f15a2..97615df 100644
--- a/bodhi/util.py
+++ b/bodhi/util.py
@@ -331,6 +331,7 @@ def get_critpath_pkgs(collection='devel'):
if critpath_type == 'pkgdb':
pkgdb = PackageDB(config.get('pkgdb_url'))
critpath_pkgs = pkgdb.get_critpath_pkgs([collection])
+ critpath_pkgs = getattr(critpath_pkgs, collection, [])
else:
critpath_pkgs = []
# HACK: Avoid the current critpath policy for EPEL
commit b98e27a3bd345f565f499009cfff0477fbd42935
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Nov 21 22:20:12 2011 -0500
Currently, only the 'devel' collection returns critpath packages
diff --git a/bodhi/model.py b/bodhi/model.py
index dd8e13f..9215299 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(self.release.name)
+ critpath_pkgs = get_critpath_pkgs()
if not critpath_pkgs:
# Optimize case where there's no critpath packages
return False
diff --git a/bodhi/util.py b/bodhi/util.py
index 62c6a28..54f15a2 100644
--- a/bodhi/util.py
+++ b/bodhi/util.py
@@ -326,7 +326,7 @@ def cache_with_expire(expire=600):
return decorator(cached)
@cache_with_expire()
-def get_critpath_pkgs(collection):
+def get_critpath_pkgs(collection='devel'):
critpath_type = config.get('critpath.type', None)
if critpath_type == 'pkgdb':
pkgdb = PackageDB(config.get('pkgdb_url'))
commit 03ea808b0f5587824e86660b4d61d02563365a58
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Nov 21 22:04:02 2011 -0500
Don't use a single PackageDB instance.
Our config is not initialized before the PackageDB object is instantiated, thus
it passes it None.
diff --git a/bodhi/util.py b/bodhi/util.py
index 07efb80..62c6a28 100644
--- a/bodhi/util.py
+++ b/bodhi/util.py
@@ -52,9 +52,6 @@ header = lambda x: "%s\n %s\n%s\n" % ('=' * 80, x, '=' * 80)
pluralize = lambda val, name: val == 1 and name or "%ss" % name
-# Setup one pkgdb client instance to use with any function here
-pkgdb = PackageDB(config.get('pkgdb_url'))
-
def rpm_fileheader(pkgpath):
log.debug("Grabbing the rpm header of %s" % pkgpath)
is_oldrpm = hasattr(rpm, 'opendb')
@@ -264,8 +261,10 @@ def get_pkg_pushers(pkgName, collectionName='Fedora', collectionVersion='devel')
if config.get('acl_system') == 'dummy':
return (['guest'], ['guest']), (['guest'], ['guest'])
+
# Note if AppError is raised (for no pkgNamme or other server errors) we
# do not catch the exception here.
+ pkgdb = PackageDB(config.get('pkgdb_url'))
pkg = pkgdb.get_owners(pkgName, collectionName, collectionVersion)
# Owner is allowed to commit and gets notified of pushes
@@ -330,6 +329,7 @@ def cache_with_expire(expire=600):
def get_critpath_pkgs(collection):
critpath_type = config.get('critpath.type', None)
if critpath_type == 'pkgdb':
+ pkgdb = PackageDB(config.get('pkgdb_url'))
critpath_pkgs = pkgdb.get_critpath_pkgs([collection])
else:
critpath_pkgs = []
commit 4ac9ab6d4b9036406d51f06cd63e6f42080220f7
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Nov 21 22:03:19 2011 -0500
Document the new 'critpath.type' config option.
diff --git a/bodhi/config/app.cfg b/bodhi/config/app.cfg
index 61ded18..c779dfb 100644
--- a/bodhi/config/app.cfg
+++ b/bodhi/config/app.cfg
@@ -185,6 +185,11 @@ tgcaptcha.key = 'Y`h`f&s}TZz'
##
## Critical Path Packages
##
+
+# Enable this to query the Fedora Package Database for the list of Critical
+# Path Packages. If disabled, it'll just use the hardcoded list below.
+#critpath.type = 'pkgdb'
+
## Hardcoded, until we can query the pkgdb for it.
# http://kojipkgs.fedoraproject.org/mash/branched-20110912/logs/critpath.txt
critpath = "ConsoleKit ConsoleKit-libs ConsoleKit-x11 GConf2 GConf2-gtk ModemManager NetworkManager NetworkManager-glib NetworkManager-gnome OpenEXR-libs PackageKit PackageKit-device-rebind PackageKit-glib PackageKit-gstreamer-plugin PackageKit-yum abattis-cantarell-fonts accountsservice accountsservice-libs acl adwaita-cursor-theme adwaita-gtk2-theme adwaita-gtk3-theme alsa-lib anaconda anaconda-yum-plugins apg at-spi2-atk at-spi2-core atk attica attr audit audit-libs authconfig authconfig-gtk avahi avahi-autoipd avahi-glib avahi-libs basesystem bash bind-libs-lite bind-license binutils biosdevname bluedevil bluez bluez-libs bzip2 bzip2-libs ca-certificates cagibi cairo cairo-gobject caribou cdparanoia-libs celt checkpolicy cheese-libs chkconfig cloog-ppl clucene-core clutter clutter-gst clutter-gtk cogl color-filesystem colord comps-extras control-center control-center-filesystem coreutils coreutils-libs cpio cpp cracklib cracklib-dicts cracklib-python createrepo cronie cronie-anacron cronie-noanacron crontabs cryptopp cryptsetup-luks cryptsetup-luks-libs cups-libs cups-pk-helper curl cyrus-sasl cyrus-sasl-lib cyrus-sasl-plain dash db4 db4-utils dbus dbus-glib dbus-libs dbus-python dbus-x11 dbusmenu-qt dconf deltarpm desktop-backgrounds-gnome desktop-file-utils device-mapper device-mapper-event device-mapper-event-libs device-mapper-libs device-mapper-multipath device-mapper-multipath-libs dhclient dhcp-common dhcp-libs diffutils dirac-libs dmidecode dmraid dmraid-events dnsmasq docbook-dtds docbook-style-xsl dosfstools dracut e2fsprogs e2fsprogs-libs efibootmgr eject elfutils elfutils-libelf elfutils-libs enca enchant evolution-data-server exempi exiv2-libs expat fcoe-utils fedora-icon-theme fedora-logos fedora-release fftw file file-libs filesystem findutils fipscheck fipscheck-lib firstboot flac folks fontconfig fontpackages-filesystem fprintd fprintd-pam freetype fuse fuse-libs gamin gawk gcc gcc-c++ gd gdb gdbm gdk-pixbuf2 gdm gdm-plugin-fingerprint genisoimage geoclue gettext gettext-libs giflib gjs glib-networking glib2 glibc glibc-common glibc-devel glibc-headers glibmm24 glx-utils gmp gnome-bluetooth gnome-bluetooth-libs gnome-desktop3 gnome-disk-utility-libs gnome-icon-theme gnome-icon-theme-symbolic gnome-keyring gnome-keyring-pam gnome-menus gnome-online-accounts gnome-packagekit gnome-panel gnome-panel-libs gnome-python2 gnome-python2-canvas gnome-python2-gconf gnome-session gnome-session-xsession gnome-settings-daemon gnome-shell gnome-terminal gnome-themes gnome-themes-standard gnupg2 gnutls gobject-introspection gpgme grep grub2 grubby gsettings-desktop-schemas gsm gstreamer gstreamer-plugins-bad-free gstreamer-plugins-base gstreamer-plugins-good gstreamer-tools gtk2 gtk2-engines gtk3 gvfs gvfs-fuse gvfs-obexftp gzip hdparm herqq hesiod hicolor-icon-theme hostname htdig hunspell hwdata ilmbase info initscripts iptables iputils iscsi-initiator-utils iso-codes isomd5sum jack-audio-connection-kit jasper-libs js json-glib kbd kbd-misc kde-filesystem kde-settings kdebase-runtime kdebase-runtime-flags kdebase-runtime-libs kdelibs kdelibs-common kdepimlibs kernel kernel-headers keyutils-libs koji kpartx krb5-libs lcms-libs lcms2 libGLEW libICE libSM libX11 libX11-common libXScrnSaver libXau libXcomposite libXcursor libXdamage libXdmcp libXevie libXext libXfixes libXfont libXft libXi libXinerama libXmu libXpm libXrandr libXrender libXres libXt libXtst libXv libXvMC libXxf86misc libXxf86vm libacl libaio libarchive libart_lgpl libass libassuan libasyncns libatasmart libattr libavc1394 libblkid libbluedevil libcanberra libcanberra-gtk2 libcanberra-gtk3 libcap libcap-ng libcdaudio libcdio libcom_err libconfig libcroco libcurl libdaemon libdb libdc1394 libdrm libdv libdvdnav libdvdread libedit libexif libffado libffi libfontenc libfprint libfreebob libgcc libgcrypt libgdata libgee libglade2 libgnome-keyring libgnomecanvas libgnomekbd libgomp libgpg-error libgphoto2 libgtop2 libgudev1 libgweather libhbaapi libhbalinux libical libicu libidn libiec61883 libieee1284 libimobiledevice libiodbc libjpeg-turbo libkate libmcpp libmng libmodman libmodplug libmount libmpc libmpcdec libmx libnl libnotify liboauth libofa libogg libpcap libpciaccess libplist libpng libproxy libqzeitgeist libraw1394 libreport libreport-gtk libreport-newt libreport-python librsvg2 libsamplerate libselinux libselinux-python libselinux-utils libsemanage libsepol libshout libsigc++20 libsmbclient libsndfile libsocialweb libsocialweb-keys libsoup libss libssh libssh2 libstdc++ libstdc++-devel libtalloc libtasn1 libtdb libthai libtheora libtiff libtool-ltdl libudev libusb libusb1 libuser libuser-python libutempter libuuid libv4l libvisual libvorbis libvpx libwnck3 libxcb libxkbfile libxklavier libxml++ libxml2 libxml2-python libxslt linux-firmware livecd-tools lldpad llvm-libs lockdev logrotate lorax lua lvm2 lvm2-libs lzo m4 makebootfat mash mcpp mdadm mesa-dri-drivers mesa-dri-filesystem mesa-libGL mesa-libGLU metacity mingetty mobile-broadband-provider-info module-init-tools mpfr mtools mutter nautilus nautilus-extensions ncurses ncurses-base ncurses-libs net-tools netxen-firmware newt newt-python notification-daemon nspr nss nss-myhostname nss-softokn nss-softokn-freebl nss-sysinit nss-util ntfs-3g ntfsprogs obex-data-server obexd openbox openbox-libs openldap openobex openslp openssh openssh-clients openssh-server openssl orc os-prober oxygen-icon-theme p11-kit pam pango parted passwd patch pciutils-libs pcre perl perl-Module-Pluggable perl-PathTools perl-Pod-Escapes perl-Pod-Simple perl-Scalar-List-Utils perl-libs perl-macros perl-threads perl-threads-shared phonon phonon-backend-gstreamer pinentry pixman pkgconfig plymouth plymouth-core-libs plymouth-scripts pm-utils policycoreutils polkit polkit-desktop-policy polkit-gnome polkit-qt popt ppl ppl-pwl ppp procmail psmisc pth pulseaudio pulseaudio-gdm-hooks pulseaudio-libs pulseaudio-libs-glib2 pulseaudio-module-bluetooth pulseaudio-module-gconf pulseaudio-module-x11 pulseaudio-utils pungi pyOpenSSL pyatspi pycairo pyclutter pycryptopp pygobject2 pygpgme pygtk2 pygtk2-libglade pykickstart pyparted python python-beaker python-bugzilla python-chardet python-cryptsetup python-deltarpm python-ethtool python-imgcreate python-iniparse python-kid python-kitchen python-krbV python-libs python-magic python-mako python-markupsafe python-meh python-nss python-paste python-pyblock python-pycurl python-slip python-tempita python-urlgrabber python-virtkey python-xlib pyxdg pyxf86config qca2 qt qt-mobility qt-x11 qtsoap qtwebkit raptor2 rasqal readline redhat-menus redhat-rpm-config redland redland-virtuoso repoview rest rootfiles rpm rpm-build rpm-build-libs rpm-libs rpm-python rsyslog rtkit samba-winbind-clients sane-backends sane-backends-libs sane-backends-libs-gphoto2 schroedinger sed selinux-policy selinux-policy-targeted sendmail setserial setup setuptool sg3_utils-libs sgml-common sgpio shadow-utils shared-color-profiles shared-desktop-ontologies shared-mime-info slang slv2 smp_utils soprano sound-theme-freedesktop speex sqlite squashfs-tools startup-notification strigi-libs sudo sysklogd syslinux syslinux-extlinux system-config-date system-config-firewall-base system-config-keyboard system-config-users system-setup-keyboard systemd systemd-sysv systemd-units sysvinit-tools taglib tar tcp_wrappers-libs telepathy-filesystem telepathy-glib telepathy-logger tigervnc-license tigervnc-server-minimal tzdata udev udisks unzip upower usbmuxd usermode usermode-gtk ustr util-linux verne-backgrounds-gnome verne-backgrounds-single vim-minimal virtuoso-opensource vte3 wavpack webkitgtk3 which wpa_supplicant xcb-util xdg-user-dirs xdg-utils xfsprogs xkeyboard-config xml-common xmlrpc-c xmlrpc-c-client xorg-x11-drivers xorg-x11-drv-acecad xorg-x11-drv-aiptek xorg-x11-drv-apm xorg-x11-drv-ast xorg-x11-drv-ati xorg-x11-drv-cirrus xorg-x11-drv-dummy xorg-x11-drv-elographics xorg-x11-drv-evdev xorg-x11-drv-fbdev xorg-x11-drv-fpit xorg-x11-drv-geode xorg-x11-drv-glint xorg-x11-drv-hyperpen xorg-x11-drv-i128 xorg-x11-drv-i740 xorg-x11-drv-intel xorg-x11-drv-keyboard xorg-x11-drv-mach64 xorg-x11-drv-mga xorg-x11-drv-mouse xorg-x11-drv-mutouch xorg-x11-drv-neomagic xorg-x11-drv-nouveau xorg-x11-drv-nv xorg-x11-drv-openchrome xorg-x11-drv-penmount xorg-x11-drv-qxl xorg-x11-drv-r128 xorg-x11-drv-rendition xorg-x11-drv-s3virge xorg-x11-drv-savage xorg-x11-drv-siliconmotion xorg-x11-drv-sis xorg-x11-drv-sisusb xorg-x11-drv-synaptics xorg-x11-drv-tdfx xorg-x11-drv-trident xorg-x11-drv-v4l xorg-x11-drv-vesa xorg-x11-drv-vmmouse xorg-x11-drv-vmware xorg-x11-drv-void xorg-x11-drv-voodoo xorg-x11-drv-wacom xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-server-utils xorg-x11-xauth xorg-x11-xinit xorg-x11-xkb-utils xz xz-libs yajl yum yum-metadata-parser yum-utils zenity zlib"
commit 0b6ce18f3d6eb30c257370de8eead6f21d2cb4d2
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Nov 21 21:56:43 2011 -0500
Fix the cache decorator
diff --git a/bodhi/util.py b/bodhi/util.py
index 8f524b0..07efb80 100644
--- a/bodhi/util.py
+++ b/bodhi/util.py
@@ -326,7 +326,7 @@ def cache_with_expire(expire=600):
return result
return decorator(cached)
-@cache_with_expire
+@cache_with_expire()
def get_critpath_pkgs(collection):
critpath_type = config.get('critpath.type', None)
if critpath_type == 'pkgdb':
commit 6c3d33682f602f7cfeebf33cf8dec554a0b869a2
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Nov 21 21:55:44 2011 -0500
Patch from Toshio to fetch critpath lists from the pkgdb.
diff --git a/bodhi/model.py b/bodhi/model.py
index f03aa4a..dd8e13f 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -40,7 +40,7 @@ except ImportError:
from bodhi import buildsys, mail
from bodhi.util import get_nvr, rpm_fileheader, header, get_age, get_age_in_days
from bodhi.util import Singleton, authorized_user, flash_log, build_evr, url
-from bodhi.util import link, isint
+from bodhi.util import link, isint, get_critpath_pkgs
from bodhi.exceptions import RPMNotFound, InvalidRequest
from bodhi.identity.tables import *
@@ -1076,12 +1076,11 @@ class PackageUpdate(SQLObject):
@property
def critpath(self):
""" Return whether or not this update is in the critical path """
- # HACK: Avoid the current critpath policy for EPEL
- if self.release.name.startswith('EL'):
- return False
-
critical = False
- critpath_pkgs = config.get('critpath').split()
+ critpath_pkgs = get_critpath_pkgs(self.release.name)
+ if not critpath_pkgs:
+ # Optimize case where there's no critpath packages
+ return False
for build in self.builds:
if build.package.name in critpath_pkgs:
critical = True
diff --git a/bodhi/util.py b/bodhi/util.py
index e4d0858..8f524b0 100644
--- a/bodhi/util.py
+++ b/bodhi/util.py
@@ -31,7 +31,7 @@ from kid import Element
from yum import repoMDObject
from yum.misc import checksum
from os.path import isdir, join, dirname, basename, isfile
-from datetime import datetime
+from datetime import datetime, timedelta
from decorator import decorator
from turbogears import config, flash, redirect
from fedora.client import PackageDB
@@ -52,6 +52,9 @@ header = lambda x: "%s\n %s\n%s\n" % ('=' * 80, x, '=' * 80)
pluralize = lambda val, name: val == 1 and name or "%ss" % name
+# Setup one pkgdb client instance to use with any function here
+pkgdb = PackageDB(config.get('pkgdb_url'))
+
def rpm_fileheader(pkgpath):
log.debug("Grabbing the rpm header of %s" % pkgpath)
is_oldrpm = hasattr(rpm, 'opendb')
@@ -261,7 +264,6 @@ def get_pkg_pushers(pkgName, collectionName='Fedora', collectionVersion='devel')
if config.get('acl_system') == 'dummy':
return (['guest'], ['guest']), (['guest'], ['guest'])
- pkgdb = PackageDB(config.get('pkgdb_url'))
# Note if AppError is raised (for no pkgNamme or other server errors) we
# do not catch the exception here.
pkg = pkgdb.get_owners(pkgName, collectionName, collectionVersion)
@@ -294,6 +296,49 @@ def get_pkg_pushers(pkgName, collectionName='Fedora', collectionVersion='devel')
return ((pAllowed, pNotify), (gAllowed, gNotify))
+def cache_with_expire(expire=600):
+ # expire is the number of seconds to cache for.
+ # Default is 600s == 10 minutes
+ _cache = {}
+ def cached(func, *args, **kwargs):
+ # Setup the args
+ if kwargs:
+ key = args, frozenset(kwargs.iteritems())
+ else:
+ key = args
+
+ # Retrieve from cache
+ entry = None
+ if key in _cache:
+ entry = _cache[key]
+ if (datetime.utcnow() - entry[0]) < timedelta(0, expire, 0):
+ # Unexpired cache
+ result = entry[1]
+ else:
+ # Expired cache
+ del _cache[key]
+ entry = None
+
+ # Retrieve fresh entry
+ if entry is None:
+ result = func(*args, **kwargs)
+ _cache[key] = (datetime.utcnow(), result)
+ return result
+ return decorator(cached)
+
+@cache_with_expire
+def get_critpath_pkgs(collection):
+ critpath_type = config.get('critpath.type', None)
+ if critpath_type == 'pkgdb':
+ critpath_pkgs = pkgdb.get_critpath_pkgs([collection])
+ else:
+ critpath_pkgs = []
+ # HACK: Avoid the current critpath policy for EPEL
+ if not collection.startswith('EL'):
+ # Note: ''.split() == []
+ critpath_pkgs = config.get('critpath', '').split()
+ return critpath_pkgs
+
def build_evr(build):
if not build['epoch']:
build['epoch'] = 0
12 years, 4 months
2 commits - bodhi/controllers.py bodhi.egg-info/PKG-INFO bodhi/release.py bodhi.spec bodhi/tools
by Luke Macken
bodhi.egg-info/PKG-INFO | 2 +-
bodhi.spec | 2 +-
bodhi/controllers.py | 6 ++++--
bodhi/release.py | 2 +-
bodhi/tools/client.py | 2 +-
5 files changed, 8 insertions(+), 6 deletions(-)
New commits:
commit acd63854b8acde0773394755b73eb769e58027de
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Nov 16 15:46:22 2011 -0500
0.8.4
diff --git a/bodhi.egg-info/PKG-INFO b/bodhi.egg-info/PKG-INFO
index d12f59a..2c063a8 100644
--- a/bodhi.egg-info/PKG-INFO
+++ b/bodhi.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: bodhi
-Version: 0.8.2
+Version: 0.8.4
Summary: Bodhi is a modular web-system that facilitates the process of publishing updates for a Fedora-based software distribution
Home-page: https://fedorahosted.org/bodhi
Author: Luke Macken
diff --git a/bodhi.spec b/bodhi.spec
index 3bd73df..b6270be 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.3
+Version: 0.8.4
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 edae6f1..7cee46a 100644
--- a/bodhi/release.py
+++ b/bodhi/release.py
@@ -1,4 +1,4 @@
-VERSION = '0.8.3'
+VERSION = '0.8.4'
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 39cf8e0..b2e179f 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(a)redhat.com>
-__version__ = '0.8.3'
+__version__ = '0.8.4'
__description__ = 'Command line tool for interacting with Bodhi'
import sys
commit 12b54e24452331c4217b9aa13016b6406a0471a7
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Nov 16 14:07:53 2011 -0500
Hide autoqa comments from the Latest Comments grid
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 71b91a2..bacbf9d 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -97,8 +97,10 @@ class Root(controllers.RootController):
# { 'Title' : [SelectResults, [(row, row_callback),]], ... }
grids = {
'comments' : [
- Comment.select(Comment.q.author != 'bodhi',
- orderBy=Comment.q.timestamp).reversed(),
+ Comment.select(
+ AND(Comment.q.author != 'bodhi',
+ Comment.q.author != 'autoqa'),
+ orderBy=Comment.q.timestamp).reversed(),
[
('Update', make_update_link),
('Comment', lambda row: row.text),
12 years, 4 months
bodhi/config
by Luke Macken
bodhi/config/app.cfg | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 8a054b1656458f67156a89f133d44eb5211d627a
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Nov 16 13:17:50 2011 -0500
Change our default TurboMail encoding to utf-8 (#648)
We have been using 'utf-8-qp' by default for a long time. I recall
that encoding solving some sort of issue, but I cannot track down what
it was. In TurboMail 3.0, the behavior of this encoding is now
different.
diff --git a/bodhi/config/app.cfg b/bodhi/config/app.cfg
index 87f1199..61ded18 100644
--- a/bodhi/config/app.cfg
+++ b/bodhi/config/app.cfg
@@ -111,7 +111,7 @@ fedora_epel_test_announce_list = None
mail.on = False
mail.server = None
mail.debug = False
-mail.encoding = 'utf-8-qp'
+mail.encoding = 'utf-8'
# Exclude sending emails to these users
exclude_mail = 'autoqa'
12 years, 4 months
bodhi/overrides.py
by Luke Macken
bodhi/overrides.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
New commits:
commit 77242432abff01538611d2ddd751b292cf0f9e9a
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Nov 8 19:06:13 2011 -0500
Allow provenpackagers to submit overrides for anything
diff --git a/bodhi/overrides.py b/bodhi/overrides.py
index 83c0df7..c4a36f0 100644
--- a/bodhi/overrides.py
+++ b/bodhi/overrides.py
@@ -181,9 +181,11 @@ class BuildRootOverrideController(Controller):
if request_format() == 'json': return dict()
raise redirect('/override/new')
if identity.current.user_name not in people[0]:
- flash("Error: You do not have commit privileges to %s" % n)
- if request_format() == 'json': return dict()
- raise redirect('/override/new')
+ if 'provenpackager' not in identity.current.groups:
+
+ flash("Error: You do not have commit privileges to %s" % n)
+ if request_format() == 'json': return dict()
+ raise redirect('/override/new')
# Create a new overrides object
try:
12 years, 4 months