bodhi.egg-info/PKG-INFO | 2 -
bodhi.egg-info/SOURCES.txt | 1
bodhi.egg-info/requires.txt | 3 +-
bodhi.spec | 5 +++
bodhi/controllers.py | 51 +++++++++++++++++++++++++---------------
bodhi/model.py | 45 +++++++++++++++++++----------------
bodhi/modifyrepo.py | 10 +++----
bodhi/release.py | 4 +--
bodhi/templates/show.kid | 36 ++++++----------------------
bodhi/tests/test_controllers.py | 18 +++++++++-----
bodhi/tools/client.py | 8 +++++-
11 files changed, 100 insertions(+), 83 deletions(-)
New commits:
commit 570b250681d4a09a9d132fa094ee5b526bb90048
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jun 29 15:12:12 2010 -0400
Add an --untested argument to the bodhi client to display untested critpath
updates. Also pass in specific releases to the critpath controller as well.
diff --git a/bodhi/tools/client.py b/bodhi/tools/client.py
index fe1d8bf..2b47e3b 100755
--- a/bodhi/tools/client.py
+++ b/bodhi/tools/client.py
@@ -89,6 +89,9 @@ def get_parser():
parser.add_option("", "--critpath",
action="store_true",
help="Display a list of pending critical path updates",
dest="critpath")
+ parser.add_option("", "--untested",
action="store_true",
+ help="Display a list of untested critical path updates",
+ dest="untested", default=False)
## Details
parser.add_option("-s", "--status", action="store",
type="string",
@@ -310,7 +313,10 @@ def main():
elif opts.critpath:
log.info("Getting a list of critical path updates...")
- data = bodhi.send_request('critpath')
+ data = bodhi.send_request('critpath', req_params={
+ 'untested': opts.untested,
+ 'release': opts.release,
+ })
if data['tg_flash']:
log.info(data['tg_flash'])
for update in data['updates']:
commit 1032ac2d04160fd94c0ac7574bf262eeaecd2a9b
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jun 29 15:11:53 2010 -0400
Use the new hashlib module instead of `sha`
diff --git a/bodhi/modifyrepo.py b/bodhi/modifyrepo.py
index e8593ec..5be6400 100644
--- a/bodhi/modifyrepo.py
+++ b/bodhi/modifyrepo.py
@@ -26,9 +26,9 @@
import os
import sys
-import sha
import gzip
+from hashlib import sha1 as sha
from xml.dom import minidom
from bodhi.exceptions import RepositoryNotFound
@@ -98,17 +98,17 @@ class RepoMetadata:
self._insert_element(data, 'location',
attrs={ 'href' : 'repodata/' + mdname })
self._insert_element(data, 'checksum', attrs={ 'type' :
'sha' },
- text=sha.new(newmd).hexdigest())
+ text=sha(newmd).hexdigest())
self._insert_element(data, 'timestamp',
text=str(os.stat(destmd).st_mtime))
self._insert_element(data, 'open-checksum', attrs={ 'type' :
'sha' },
- text=sha.new(md.encode('utf-8')).hexdigest())
+ text=sha(md.encode('utf-8')).hexdigest())
#print " type =", mdtype
#print " location =", 'repodata/' + mdname
- #print " checksum =", sha.new(newmd).hexdigest()
+ #print " checksum =", sha(newmd).hexdigest()
#print " timestamp =", str(os.stat(destmd).st_mtime)
- #print " open-checksum =", sha.new(md).hexdigest()
+ #print " open-checksum =", sha(md).hexdigest()
## Write the updated repomd.xml
outmd = file(self.repomdxml, 'w')
commit d988cd2dd629e6f4b839c8d70612a214a33fc54c
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jun 29 15:09:09 2010 -0400
Improve our critpath controller method.
Give it a 'release' argument, as well as an 'untested' argument to
see
what critical path updates need to be tested
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 9e12e95..0ba2a6d 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -1296,16 +1296,25 @@ class Root(controllers.RootController):
return builds
@expose(template='bodhi.templates.critpath', allow_json=True)
+ @validate(validators={'untested': validators.StringBool()})
@paginate('updates', limit=1000, max_limit=1000)
- def critpath(self, *args, **kw):
+ def critpath(self, untested=False, release=None, *args, **kw):
updates = []
- releases = Release.select(Release.q.locked==True)
+ if release:
+ releases = [Release.byName(release)]
+ else:
+ releases = Release.select()
for update in PackageUpdate.select(
AND(PackageUpdate.q.status != 'stable',
OR(*[PackageUpdate.q.releaseID == release.id
for release in releases]))):
if update.critpath:
- updates.append(update)
+ if untested:
+ if update.critpath_approved:
+ updates.append(update)
+ else:
+ updates.append(update)
num_items = len(updates)
return dict(updates=updates, num_items=num_items,
- title='%d Critical Path Updates' % num_items)
+ title='%d %sCritical Path Updates' % (num_items,
+ untested and 'Untested ' or ''))
commit 1656abac9ebee027d848e51a224a5a48e5de6c07
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jun 29 15:09:05 2010 -0400
Prep for 0.7.5 release
diff --git a/bodhi.egg-info/PKG-INFO b/bodhi.egg-info/PKG-INFO
index d0e55cc..e0c55ca 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.7.1
+Version: 0.7.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.egg-info/SOURCES.txt b/bodhi.egg-info/SOURCES.txt
index 30292b4..9fcd46b 100644
--- a/bodhi.egg-info/SOURCES.txt
+++ b/bodhi.egg-info/SOURCES.txt
@@ -178,6 +178,7 @@ bodhi/tools/client.py
bodhi/tools/dev_init.py
bodhi/tools/fix_dupe_ids.py
bodhi/tools/init.py
+bodhi/tools/log_stats.py
bodhi/tools/metrics.py
bodhi/tools/pickledb.py
bodhi/tools/rmrelease.py
diff --git a/bodhi.egg-info/requires.txt b/bodhi.egg-info/requires.txt
index 79d655b..053d119 100644
--- a/bodhi.egg-info/requires.txt
+++ b/bodhi.egg-info/requires.txt
@@ -1,3 +1,4 @@
TurboGears >= 1.0
TurboMail
-python_fedora
\ No newline at end of file
+python_fedora
+markdown
\ No newline at end of file
diff --git a/bodhi.spec b/bodhi.spec
index a9eb7c0..9f84ce9 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.7.4
+Version: 0.7.5
Release: 1%{?dist}
Summary: A modular framework that facilitates publishing software updates
Group: Applications/Internet
@@ -117,6 +117,9 @@ rm -rf bodhi/tests bodhi/tools/test-bodhi.py
%changelog
+* Tue Jun 29 2010 Luke Macken <lmacken(a)redhat.com> - 0.7.5-1
+- 0.7.5 release
+
* Thu Mar 04 2010 Luke Macken <lmacken(a)redhat.com> - 0.7.4-1
- 0.7.4
diff --git a/bodhi/release.py b/bodhi/release.py
index ff270ef..1313e39 100644
--- a/bodhi/release.py
+++ b/bodhi/release.py
@@ -1,9 +1,9 @@
-VERSION = '0.7.4'
+VERSION = '0.7.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'
EMAIL = 'lmacken(a)redhat.com'
-COPYRIGHT = '2007-2009 Red Hat, Inc.'
+COPYRIGHT = '2007-2010 Red Hat, Inc.'
URL = 'https://fedorahosted.org/bodhi'
DOWNLOAD_URL = 'https://fedorahosted.org/releases/b/o/bodhi/'
LICENSE = 'GPLv2'
commit cc0325c1531c7b3affbe22ce98c55c64a20b91f2
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jun 29 15:02:43 2010 -0400
Enable strict critical path update policy across all releases.
This requires that all critical path updates get 2 admin approvals, along with
one other 1+ from the community. These values are configurable, and this
feature can be completely disabled by setting `critpath.num_admin_approvals =
0` in the bodhi configuration.
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index ac10b22..9e12e95 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -930,20 +930,26 @@ class Root(controllers.RootController):
flash_log(str(e))
raise InvalidUpdateException(params)
- # Politely discourage devs from pushing critpath straight to stable
- if (update.request == 'stable' and update.critpath and
- 'proventesters' not in identity.current.groups and
- 'releng' not in identity.current.groups and
- not update.critpath_approved):
- note.append("You're pushing a critical path package directly to
"
- "stable, which is strongly discouraged. Please "
- "consider pushing to testing first!")
- # Discourage devs from pushing directly to stable for pending releases
- elif update.request == 'stable' and update.release.locked:
- note.append("This update is bypassing testing for an "
- "upcoming release, which is strongly discouraged.
"
- "Please ensure that it is properly tested, or "
- "consider pushing it to testing first.")
+ # Disable pushing critpath updates straight to stable
+ # XXX: This block shouldn't be necessary, as the set_request call
+ # above should handle this logic. Keeping it here for another
+ # release to see if this gets hit.
+ if config.get('critpath.num_admin_approvals'):
+ if (update.request == 'stable' and update.critpath and
+ not update.critpath_approved):
+ update.request = 'testing'
+ log.error("Unapproved critpath request is 'stable'.
"
+ "This shouldn't happen!")
+ note.append('This critical path update has not '
+ 'yet been approved for pushing to the stable '
+ 'repository. It must first reach a karma '
+ 'of %d, consisting of %d positive karma from '
+ 'proventesters, along with %d additional '
+ 'karma from the community.' % (
+ config.get('critpath.min_karma'),
+ config.get('critpath.num_admin_approvals'),
+ config.get('critpath.min_karma') -
+ config.get('critpath.num_admin_approvals')))
flash_log('. '.join(note))
diff --git a/bodhi/model.py b/bodhi/model.py
index 2f848d9..a63caa4 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -420,20 +420,26 @@ class PackageUpdate(SQLObject):
# [No Frozen Rawhide] Disable pushing critical path updates for
# pending releases directly to stable.
- if action == 'stable' and self.release.locked and self.critpath:
- if not self.critpath_approved:
- if self.status != 'testing':
- action = 'testing'
- log.info('Forcing critical path update into testing')
- notes.append('This critical path update has not '
- 'yet been approved. It must reach a karma '
- 'of %d, consisting of %d positive karma from '
- 'releng/qa, along with %d additional karma from '
- 'the community.' % (
- config.get('critpath.min_karma'),
- config.get('critpath.num_admin_approvals'),
- config.get('critpath.min_karma') -
- config.get('critpath.num_admin_approvals')))
+ if action == 'stable' and self.critpath:
+ if config.get('critpath.num_admin_approvals'):
+ if not self.critpath_approved:
+ notes.append('This critical path update has not '
+ 'yet been approved for pushing to the stable '
+ 'repository. It must first reach a karma '
+ 'of %d, consisting of %d positive karma from '
+ 'proventesters, along with %d additional '
+ 'karma from the community.' % (
+ config.get('critpath.min_karma'),
+ config.get('critpath.num_admin_approvals'),
+ config.get('critpath.min_karma') -
+ config.get('critpath.num_admin_approvals')))
+ if self.status == 'testing':
+ self.request = None
+ flash_log('. '.join(notes))
+ return
+ else:
+ log.info('Forcing critical path update into testing')
+ action = 'testing'
self.request = action
self.pushed = False
@@ -738,11 +744,10 @@ class PackageUpdate(SQLObject):
# If we're a criticalpath update to a pending release that is
# not yet approved, ensure that this karma can't cause it
# to go to stable.
- if (self.critpath and self.release.locked and
- not self.critpath_approved):
+ if self.critpath and not self.critpath_approved:
pass
else:
- if self.status != 'stable':
+ if 'stable' not in (self.status, self.request):
log.info("Automatically marking %s as stable" %
self.title)
self.request = 'stable'
self.pushed = False
@@ -757,8 +762,8 @@ class PackageUpdate(SQLObject):
'being unpushed and marked as unstable' %
self.karma)
mail.send(self.submitter, 'unstable', self)
- # If we're a Critical Path update for a pending release
- if self.critpath and self.release.locked:
+ # If we're a Critical Path update
+ if self.critpath:
# If we weren't approved before, and now are, push to stable
if not critpath_approved and self.critpath_approved:
self.comment('Critical path update approved',
author='bodhi')
@@ -898,7 +903,7 @@ class PackageUpdate(SQLObject):
# Hack, to get this working for F13 w/o changing the DB
if comment.author.endswith(')'):
group = comment.author[:-1].split('(')[-1]
- if group in config.get('admin_groups', 'qa
releng').split():
+ if group in config.get('admin_groups').split():
approvals += 1
return approvals
diff --git a/bodhi/templates/show.kid b/bodhi/templates/show.kid
index 19c0c3d..6592e41 100644
--- a/bodhi/templates/show.kid
+++ b/bodhi/templates/show.kid
@@ -77,27 +77,17 @@ karma = "<img src=\"%s\" align=\"top\"
/> <b>%d</b>" % (tg.url('/static/images/k
</span>
<span py:if="update.status !=
'stable'">
- <span py:if="update.release.locked">
- <span py:if="update.critpath">
- <span
py:if="update.critpath_approved">
- <td>
- <a
href="${util.url('/request/stable/%s' % update.title)}"
class="list">
- <img
src="${tg.url('/static/images/submit.png')}" border="0"/>
- Push Critical Path update to
Stable
- </a>
- </td>
- </span>
- </span>
- <span py:if="not
update.critpath">
+ <span py:if="update.critpath">
+ <span
py:if="update.critpath_approved">
<td>
<a
href="${util.url('/request/stable/%s' % update.title)}"
class="list">
<img
src="${tg.url('/static/images/submit.png')}" border="0"/>
- Push to Stable
+ Push Critical Path update to Stable
</a>
</td>
</span>
</span>
- <span py:if="not
update.release.locked">
+ <span py:if="not update.critpath">
<td>
<a
href="${util.url('/request/stable/%s' % update.title)}"
class="list">
<img
src="${tg.url('/static/images/submit.png')}" border="0"/>
@@ -129,27 +119,17 @@ karma = "<img src=\"%s\" align=\"top\"
/> <b>%d</b>" % (tg.url('/static/images/k
</td>
<span py:if="update.status ==
'testing'">
<span py:if="update.request == None">
- <span py:if="update.release.locked">
- <span py:if="update.critpath">
- <span
py:if="update.critpath_approved">
- <td>
- <a
href="${util.url('/request/stable/%s' % update.title)}"
class="list">
- <img
src="${tg.url('/static/images/submit.png')}" border="0"/>
- Mark Critical Path update as
Stable
- </a>
- </td>
- </span>
- </span>
- <span py:if="not update.critpath">
+ <span py:if="update.critpath">
+ <span
py:if="update.critpath_approved">
<td>
<a
href="${util.url('/request/stable/%s' % update.title)}"
class="list">
<img
src="${tg.url('/static/images/submit.png')}" border="0"/>
- Mark as Stable
+ Mark Critical Path update as Stable
</a>
</td>
</span>
</span>
- <span py:if="not
update.release.locked">
+ <span py:if="not update.critpath">
<td>
<a
href="${util.url('/request/stable/%s' % update.title)}"
class="list">
<img
src="${tg.url('/static/images/submit.png')}" border="0"/>
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index 1ca20f9..bb068a1 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -1350,7 +1350,11 @@ class TestControllers(testutil.DBTest):
except SQLObjectNotFound:
pass
- def test_push_critpath_to_release(self):
+ def test_push_untested_critpath_to_release(self):
+ """
+ Ensure that we cannot push an untested critpath update directly to
+ stable.
+ """
session = login()
create_release()
params = {
@@ -1366,9 +1370,9 @@ class TestControllers(testutil.DBTest):
testutil.capture_log(["bodhi.util", "bodhi.controllers",
"bodhi.model"])
self.save_update(params, session)
log = testutil.get_log()
- assert "Update successfully created. You're pushing a critical path
package directly to stable, which is strongly discouraged. Please consider pushing to
testing first!" in log, log
+ assert "Forcing critical path update into testing" in log, log
update = PackageUpdate.byTitle(params['builds'])
- assert update.request == 'stable'
+ assert update.request == 'testing'
def test_critpath_actions_in_normal_release(self):
session = login()
@@ -1389,16 +1393,18 @@ class TestControllers(testutil.DBTest):
testutil.create_request('/updates/%s' % params['builds'],
method='GET', headers=session)
- assert "Push to Stable" in cherrypy.response.body[0]
+ assert "Push to Stable" not in cherrypy.response.body[0]
assert "Push to Testing" in cherrypy.response.body[0]
testutil.create_request('/updates/request/stable/%s' %
params['builds'],
method='GET', headers=session)
update = PackageUpdate.byTitle(params['builds'])
- # We're allowing devs to still request critpath updates to stable
+ # We're no longer allowing devs to request critpath updates to stable
# without a karma prerequisite for non-pending releases.
- assert update.request == 'stable'
+ # This feature can be disabled by setting
+ #`critpath.num_admin_approvals = 0` in your configuration
+ assert update.request == 'testing'
def test_non_critpath_actions_in_normal_release(self):
session = login()