bodhi/controllers.py | 17 +++++++----
bodhi/model.py | 3 +
bodhi/search.py | 2 -
bodhi/templates/search.kid | 61 ++++++++++++++++++++++++++++++++++++++++
bodhi/tests/test_controllers.py | 25 +++++++++-------
5 files changed, 90 insertions(+), 18 deletions(-)
New commits:
commit 1f669ca7354e5d704220352ad04b7d29e700c4e6
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Aug 20 15:32:58 2008 -0400
Use our new search template in the search controller
diff --git a/bodhi/search.py b/bodhi/search.py
index 45a4b05..4f13c9c 100644
--- a/bodhi/search.py
+++ b/bodhi/search.py
@@ -38,7 +38,7 @@ class SearchController(Controller):
return dict(form=search_form, values={}, action=url('/search/'),
title='Search Updates')
- @expose(template="bodhi.templates.list")
+ @expose(template="bodhi.templates.search")
@validate(validators={ "search" : validators.UnicodeString() })
@error_handler(index)
@paginate('updates', default_order='date_submitted',
default_reversed=True,
commit e8f7387132b0a3bc68d27446ddf63d4d5457391a
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Aug 20 15:30:31 2008 -0400
Add a custom search template so we can order results by date submitted
diff --git a/bodhi/templates/search.kid b/bodhi/templates/search.kid
new file mode 100644
index 0000000..015aa56
--- /dev/null
+++ b/bodhi/templates/search.kid
@@ -0,0 +1,61 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://purl.org/kid/ns#"
+ py:extends="'master.kid'">
+
+<head>
+ <meta content="text/html; charset=UTF-8"
http-equiv="content-type" py:replace="''"/>
+ <title>Fedora Updates</title>
+</head>
+
+<body>
+ <b>${title}</b>
+ <div py:if="num_items" class="list">
+ <span py:for="page in tg.paginate.pages">
+ <a py:if="page != tg.paginate.current_page"
+ href="${tg.paginate.get_href(page)}">${page}</a>
+ <b py:if="page ==
tg.paginate.current_page">${page}</b>
+ </span>
+ <a href="?tg_paginate_limit=${num_items}">all</a>
+ </div>
+
+ <table class="list">
+ <tr class="list">
+ <th class="list">
+ <b>ID</b>
+ </th>
+ <th class="list">
+ <b>Update</b>
+ </th>
+ <th class="list">
+ <center><b>Type</b></center>
+ </th>
+ <th class="list">
+ <b>Submitter</b>
+ </th>
+ <th class="list">
+ <b>Date Submitted</b>
+ </th>
+ </tr>
+ <?python row_color = "#FFFFFF" ?>
+ <tr class="list" bgcolor="${row_color}"
py:for="update in updates">
+ <td class="list">
+ ${update.updateid}
+ </td>
+ <td class="list" width="35%">
+ <a class="list"
href="${tg.url(update.get_url())}">${update.title.replace(',', ',
')}</a>
+ </td>
+ <td class="list" align="center">
+ <img src="${tg.url('/static/images/%s.png' %
update.type)}" title="${update.type}" />
+ </td>
+ <td class="list">
+ <a href="${tg.url('/user/' +
update.submitter)}">${update.submitter}</a>
+ </td>
+ <td class="list">
+ ${update.date_submitted}
+ </td>
+ <?python row_color = (row_color == "#f1f1f1") and
"#FFFFFF" or "#f1f1f1" ?>
+ </tr>
+ </table>
+
+</body>
+</html>
commit fd47b0174787c10a514d6a87286f92f77b5b0fcc
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Aug 20 14:50:31 2008 -0400
Avoid a koji tag race condition by skipping tag verification if we're editing and
update.
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index ec4227e..6cd08de 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -566,7 +566,11 @@ class Root(controllers.RootController):
buildinfo[build]['releases'].add(rel)
valid = True
- if not valid:
+ # If all of the builds are not properly tagged, then complain.
+ # If we're editing an update, we can already assume that we've
+ # moved the builds back to the candidates tag above, and can
+ # skip this verification.
+ if not valid and not edited:
flash_log("%s not tagged as an update candidate" % build)
if request_format() == 'json': return dict()
raise redirect('/new', **params)
commit 54c5118de5d23e8da128e2c9579bfd0b55b7e77c
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Aug 20 14:45:30 2008 -0400
Stop spamming all committers for each comment, until we can figure out how to
differentiate between a 'committer' and a 'maintainer'
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index ce68748..ec4227e 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -693,13 +693,15 @@ class Root(controllers.RootController):
# Send out mail notifications
if edited:
- mail.send(update.get_maintainers(), 'edited', update)
+ #mail.send(update.get_maintainers(), 'edited', update)
+ mail.send(update.submitter, 'edited', update)
note.insert(0, "Update successfully edited")
else:
# Notify security team of newly submitted security updates
if update.type == 'security':
mail.send(config.get('security_team'), 'security',
update)
- mail.send(update.get_maintainers(), 'new', update)
+ #mail.send(update.get_maintainers(), 'new', update)
+ mail.send(update.submitter, 'new', update)
note.insert(0, "Update successfully created")
# Comment on all bugs
commit b3fc0d0800fcba90d07b4da27c30a211faadf4a0
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Aug 20 13:34:49 2008 -0400
Clean up some unnecessary output
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index bdf9ad5..ce68748 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -643,7 +643,6 @@ class Root(controllers.RootController):
bugs.append(unicode(bug.bz_id))
# Also inherit the older updates notes as well
notes += '\n' + update.notes
- print "new notes =", notes
update.obsolete(newer=build)
note.append('This update has obsoleted %s, and has '
'inherited its bugs and notes.' % oldBuild.nvr)
@@ -663,7 +662,6 @@ class Root(controllers.RootController):
log.debug("Removing unnecessary build: %s" %
build.nvr)
update.removePackageBuild(build)
if len(build.updates) == 0:
- log.debug("Destroying %s" % build.nvr)
build.destroySelf()
else:
update = PackageUpdate(title=','.join(builds),
diff --git a/bodhi/model.py b/bodhi/model.py
index 23694cf..39533c8 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -633,7 +633,8 @@ class PackageUpdate(SQLObject):
return
for build in self.builds:
if build.inherited:
- log.debug("Removing %s tag from %s" % (curtag, build.nvr))
+ log.debug("Removing %s tag from inherited build %s" % (
+ curtag, build.nvr))
koji.untagBuild(curtag, build.nvr, force=True)
else:
log.debug("Moving %s from %s to %s" % (build.nvr, curtag,
newtag))
commit 8c87c33645b95ef7da9daa9bdd6bec0e9be4d3da
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Aug 20 13:34:22 2008 -0400
I really hope this fixes the self-obsoletion issue...
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 48ff56a..bdf9ad5 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -629,7 +629,8 @@ class Root(controllers.RootController):
if update.status not in ('pending', 'testing') or \
update.request or \
update.release not in buildinfo[build]['releases'] or \
- update in pkgBuild.updates:
+ update in pkgBuild.updates or \
+ (edited and oldBuild in edited.builds):
obsoletable = False
break
if rpm.labelCompare(util.get_nvr(oldBuild.nvr), nvr) < 0:
commit 8974a9e098164d6dad200911a7f881d852ad0674
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Aug 20 13:30:47 2008 -0400
Elaborate on our test_edit_obsoletion unit test with some real world data
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index 8c80f90..b0bd843 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -1069,27 +1069,32 @@ class TestControllers(testutil.DBTest):
def test_edit_obsoletion(self):
""" Make sure that an update cannot obsolete itself during edit
"""
session = login()
- create_release()
+ create_release(num='9', dist='dist-f')
+ create_release(num='8', dist='dist-f')
params = {
- 'builds' :
'TurboGears-2.6.23.1-21.fc7,python-sqlalchemy-0.5.0-1.fc7',
- 'release' : 'Fedora 7',
- 'type_' : 'newpackage',
- 'bugs' : '',
- 'notes' : '',
+ 'builds' :
u'kdelibs-4.1.0-5.fc9,kdegames-4.1.0-2.fc9,konq-plugins-4.1.0-2.fc9,qt-4.4.1-2.fc9,quarticurve-kwin-theme-0.0-0.5.beta4.fc9,kdepimlibs-4.1.0-2.fc9,kdebase-workspace-4.1.0-8.fc9,akonadi-1.0.0-2.fc9,kde-l10n-4.1.0-2.fc9,kdegraphics-4.1.0-3.fc9,kdeutils-4.1.0-1.fc9.1,kdebindings-4.1.0-5.fc9,kde-i18n-3.5.9-8.fc9,kdeartwork-4.1.0-1.fc9,kdemultimedia-4.1.0-1.fc9,kdetoys-4.1.0-1.fc9,kdebase-runtime-4.1.0-1.fc9,kdeadmin-4.1.0-2.fc9,kdenetwork-4.1.0-2.fc9,kdeaccessibility-4.1.0-1.fc9,kdeplasma-addons-4.1.0-1.fc9,kdeedu-4.1.0-1.fc9,kdebase-4.1.0-1.fc9.1,kdesdk-4.1.0-1.fc9,kde-filesystem-4-17.fc9,qscintilla-2.2-3.fc9,qgtkstyle-0.0-0.2.20080719svn693.fc9,compiz-0.7.6-3.fc9.1,soprano-2.1-1.fc9,PyQt4-4.4.2-2.fc9,sip-4.7.6-1.fc9,automoc-1.0-0.8.rc1.fc9,phonon-4.2.0-2.fc9',
+ 'type_' : 'enhancement',
+ 'bugs' : u'457526 456820 454930 454458 456827 456797
456850 440226 455623 440031 453321 457479 457739',
+ 'notes' : u'This is an update to kde-4.1.0. \r\n\r\nSee
also:\r\nhttp://www.kde.org/announcements/4.1/\r\n\r\nNOTE: This update does not include
kdepim-4.1.0',
}
self.save_update(params, session)
+ assert PackageUpdate.select().count() == 1
update = PackageUpdate.byTitle(params['builds'])
assert update.status == 'pending'
+ assert PackageBuild.select().count() ==
len(params['builds'].split(','))
+ update.status = 'testing'
params = {
- 'builds' :
'TurboGears-2.6.24.1-21.fc7,python-sqlalchemy-0.5.0-1.fc7',
+ 'builds' :
u'kdelibs-4.1.0-5.fc9,kdegames-4.1.0-2.fc9,konq-plugins-4.1.0-2.fc9,qt-4.4.1-2.fc9,quarticurve-kwin-theme-0.0-0.5.beta4.fc9,kdepimlibs-4.1.0-2.fc9,kdebase-workspace-4.1.0-8.fc9,akonadi-1.0.0-2.fc9,kde-l10n-4.1.0-2.fc9,kdegraphics-4.1.0-4.fc9,kdeutils-4.1.0-1.fc9.1,kdebindings-4.1.0-5.fc9,kde-i18n-3.5.9-8.fc9,kdeartwork-4.1.0-1.fc9,kdemultimedia-4.1.0-1.fc9,kdetoys-4.1.0-1.fc9,kdebase-runtime-4.1.0-3.fc9,kdeadmin-4.1.0-2.fc9,kdenetwork-4.1.0-2.fc9,kdeaccessibility-4.1.0-1.fc9,kdeplasma-addons-4.1.0-1.fc9,kdeedu-4.1.0-1.fc9,kdebase-4.1.0-1.fc9.1,kdesdk-4.1.0-1.fc9,kde-filesystem-4-17.fc9,qscintilla-2.2-3.fc9,qgtkstyle-0.0-0.2.20080719svn693.fc9,compiz-0.7.6-3.fc9.1,soprano-2.1-1.fc9,PyQt4-4.4.2-2.fc9,sip-4.7.6-1.fc9,automoc-1.0-0.8.rc1.fc9,phonon-4.2.0-4.fc9',
'release' : 'Fedora 7',
- 'type_' : 'newpackage',
+ 'type_' : 'enhancement',
'bugs' : '',
'notes' : '',
- 'edited' :
'TurboGears-2.6.23.1-21.fc7,python-sqlalchemy-0.5.0-1.fc7',
+ 'edited' :
u'kdelibs-4.1.0-5.fc9,kdegames-4.1.0-2.fc9,konq-plugins-4.1.0-2.fc9,qt-4.4.1-2.fc9,quarticurve-kwin-theme-0.0-0.5.beta4.fc9,kdepimlibs-4.1.0-2.fc9,kdebase-workspace-4.1.0-8.fc9,akonadi-1.0.0-2.fc9,kde-l10n-4.1.0-2.fc9,kdegraphics-4.1.0-3.fc9,kdeutils-4.1.0-1.fc9.1,kdebindings-4.1.0-5.fc9,kde-i18n-3.5.9-8.fc9,kdeartwork-4.1.0-1.fc9,kdemultimedia-4.1.0-1.fc9,kdetoys-4.1.0-1.fc9,kdebase-runtime-4.1.0-1.fc9,kdeadmin-4.1.0-2.fc9,kdenetwork-4.1.0-2.fc9,kdeaccessibility-4.1.0-1.fc9,kdeplasma-addons-4.1.0-1.fc9,kdeedu-4.1.0-1.fc9,kdebase-4.1.0-1.fc9.1,kdesdk-4.1.0-1.fc9,kde-filesystem-4-17.fc9,qscintilla-2.2-3.fc9,qgtkstyle-0.0-0.2.20080719svn693.fc9,compiz-0.7.6-3.fc9.1,soprano-2.1-1.fc9,PyQt4-4.4.2-2.fc9,sip-4.7.6-1.fc9,automoc-1.0-0.8.rc1.fc9,phonon-4.2.0-2.fc9',
}
+ testutil.capture_log(['bodhi.controllers', 'bodhi.util',
'bodhi.model'])
self.save_update(params, session)
update = PackageUpdate.byTitle(params['builds'])
assert update.status == 'pending'
assert PackageUpdate.select().count() == 1
- assert PackageBuild.select().count() == 2
+ assert PackageBuild.select().count() ==
len(params['builds'].split(','))
+ testutil.print_log()