bodhi/controllers.py | 5 ++++-
bodhi/metadata.py | 9 +++++++--
bodhi/templates/master.kid | 4 ++--
bodhi/tests/test_controllers.py | 5 ++++-
bodhi/tests/test_model.py | 12 ++++++------
5 files changed, 23 insertions(+), 12 deletions(-)
New commits:
commit 8f1d71ffad864b6de0328ba5d1921817aae93c02
Author: Mathieu Bridon (bochecha) <bochecha(a)fedoraproject.org>
Date: Wed Oct 14 23:09:47 2009 +0200
Ticket #353: "enable karma automatism" always gets reenabled
Makes the tests work with new behavior of the autokarma checkbox.
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index 8dc9b2f..2228c0a 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -97,7 +97,8 @@ class TestControllers(testutil.DBTest):
'type_' : 'enhancement',
'bugs' : '1234',
'cves' : 'CVE-2020-0001',
- 'notes' : 'foobar'
+ 'notes' : 'foobar',
+ 'autokarma' : True
}
self.save_update(params, session)
assert "This resource resides temporarily at <a href='http://localhost/updates/TurboGears-1.0.2.2-2.fc7'>http://localhost/updates/TurboGears-1.0.2.2-2.fc7</a>" in cherrypy.response.body[0], cherrypy.response.body[0]
@@ -901,6 +902,7 @@ class TestControllers(testutil.DBTest):
'bugs' : '',
'notes' : 'foobar',
'request' : 'Stable',
+ 'autokarma' : True,
'stable_karma' : 5,
'unstable_karma' : -5
}
@@ -917,6 +919,7 @@ class TestControllers(testutil.DBTest):
'bugs' : '',
'notes' : 'foobar',
'request' : 'Stable',
+ 'autokarma' : True,
'stable_karma' : 1,
'unstable_karma' : -1,
}
commit c6f359720e3c1360e309177f7328237e291818f1
Author: Mathieu Bridon (bochecha) <bochecha(a)fedoraproject.org>
Date: Wed Oct 14 22:29:21 2009 +0200
Ticket #353: "enable karma automatism" always gets reenabled
Take into account whether the package maintainer checked or
unchecked the autokarma checkbox.
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 35bf9de..fa2e7e1 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -471,7 +471,7 @@ class Root(controllers.RootController):
@identity.require(identity.not_anonymous())
def save(self, builds, type_, notes, bugs, close_bugs=False, edited=False,
request='testing', suggest_reboot=False, inheritance=False,
- autokarma=True, stable_karma=3, unstable_karma=-3, **kw):
+ autokarma=False, stable_karma=3, unstable_karma=-3, **kw):
""" Save an update.
This entails either creating a new update, or editing an existing one.
commit f9409d0309dbd3d6c141f889571ea784a7e7a411
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Jan 4 15:55:20 2010 -0500
Update our test suite for the new year :(
diff --git a/bodhi/tests/test_model.py b/bodhi/tests/test_model.py
index de20041..f2c802f 100644
--- a/bodhi/tests/test_model.py
+++ b/bodhi/tests/test_model.py
@@ -127,14 +127,14 @@ class TestPackageUpdate(testutil.DBTest):
time.localtime()[0])
# 10k bug
- update.updateid = 'FEDORA-2009-9999'
+ update.updateid = 'FEDORA-2010-9999'
newupdate = self.get_update(name='nethack-2.5.6-1.fc10')
newupdate.assign_id()
- assert newupdate.updateid == 'FEDORA-2009-10000'
+ assert newupdate.updateid == 'FEDORA-2010-10000'
newerupdate = self.get_update(name='nethack-2.5.7-1.fc10')
newerupdate.assign_id()
- assert newerupdate.updateid == 'FEDORA-2009-10001'
+ assert newerupdate.updateid == 'FEDORA-2010-10001'
# test updates that were pushed at the same time. assign_id should
# be able to figure out which one has the highest id.
@@ -144,7 +144,7 @@ class TestPackageUpdate(testutil.DBTest):
newest = self.get_update(name='nethack-2.5.8-1.fc10')
newest.assign_id()
- assert newest.updateid == 'FEDORA-2009-10002'
+ assert newest.updateid == 'FEDORA-2010-10002'
def test_epel_id(self):
""" Make sure we can handle id_prefixes that contain dashes. eg: FEDORA-EPEL """
@@ -288,7 +288,7 @@ class TestPackageUpdate(testutil.DBTest):
templates = get_template(update)
assert templates
assert templates[0][0] == u'[SECURITY] Fedora 7 Test Update: TurboGears-1.0.2.2-2.fc7'
- assert templates[0][1] == u'--------------------------------------------------------------------------------\nFedora Test Update Notification\nFEDORA-2009-0001\nNone\n--------------------------------------------------------------------------------\n\nName : TurboGears\nProduct : Fedora 7\nVersion : 1.0.2.2\nRelease : 2.fc7\nURL : turbogears.org\nSummary : summary\nDescription :\ndescription\n\n--------------------------------------------------------------------------------\nUpdate Information:\n\nfoobar\n--------------------------------------------------------------------------------\nReferences:\n\n [ 1 ] Bug #1 - None\n https://bugzilla.redhat.com/show_bug.cgi?id=1\n [ 2 ] CVE-2007-0000\n http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-0000\n----------… update can be installed with the "yum" update program. Use \nsu -c \'yum --enablerepo=updates-testing update TurboGears\' at the command line.\nFor more information, refer to "Managing Software with yum",\navailable at http://docs.fedoraproject.org/yum/.\n\nAll packages are signed with the Fedora Project GPG key. More details on the\nGPG keys used by the Fedora Project can be found at\nhttp://fedoraproject.org/keys\n----------------------------------------…', templates[0][1]
+ assert templates[0][1] == u'--------------------------------------------------------------------------------\nFedora Test Update Notification\nFEDORA-2010-0001\nNone\n--------------------------------------------------------------------------------\n\nName : TurboGears\nProduct : Fedora 7\nVersion : 1.0.2.2\nRelease : 2.fc7\nURL : turbogears.org\nSummary : summary\nDescription :\ndescription\n\n--------------------------------------------------------------------------------\nUpdate Information:\n\nfoobar\n--------------------------------------------------------------------------------\nReferences:\n\n [ 1 ] Bug #1 - None\n https://bugzilla.redhat.com/show_bug.cgi?id=1\n [ 2 ] CVE-2007-0000\n http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-0000\n----------… update can be installed with the "yum" update program. Use \nsu -c \'yum --enablerepo=updates-testing update TurboGears\' at the command line.\nFor more information, refer to "Managing Software with yum",\navailable at http://docs.fedoraproject.org/yum/.\n\nAll packages are signed with the Fedora Project GPG key. More details on the\nGPG keys used by the Fedora Project can be found at\nhttp://fedoraproject.org/keys\n----------------------------------------…', templates[0][1]
def test_latest(self):
update = self.get_update(name='yum-3.2.1-1.fc7')
@@ -548,7 +548,7 @@ class TestPackageUpdate(testutil.DBTest):
templates = get_template(update)
assert templates
assert templates[0][0] == u'[SECURITY] Fedora 7 Test Update: TurboGears-1.0.2.2-2.fc7'
- assert templates[0][1] == u'--------------------------------------------------------------------------------\nFedora Test Update Notification\nFEDORA-2009-0001\nNone\n--------------------------------------------------------------------------------\n\nName : TurboGears\nProduct : Fedora 7\nVersion : 1.0.2.2\nRelease : 2.fc7\nURL : turbogears.org\nSummary : summary\nDescription :\nZ\u2019s\n\n--------------------------------------------------------------------------------\nUpdate Information:\n\nfoobar\n--------------------------------------------------------------------------------\nReferences:\n\n [ 1 ] Bug #1 - None\n https://bugzilla.redhat.com/show_bug.cgi?id=1\n [ 2 ] CVE-2007-0000\n http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-0000\n----------… update can be installed with the "yum" update program. Use \nsu -c \'yum --enablerepo=updates-testing update TurboGears\' at the command line.\nFor more information, refer to "Managing Software with yum",\navailable at http://docs.fedoraproject.org/yum/.\n\nAll packages are signed with the Fedora Project GPG key. More details on the\nGPG keys used by the Fedora Project can be found at\nhttp://fedoraproject.org/keys\n----------------------------------------…'
+ assert templates[0][1] == u'--------------------------------------------------------------------------------\nFedora Test Update Notification\nFEDORA-2010-0001\nNone\n--------------------------------------------------------------------------------\n\nName : TurboGears\nProduct : Fedora 7\nVersion : 1.0.2.2\nRelease : 2.fc7\nURL : turbogears.org\nSummary : summary\nDescription :\nZ\u2019s\n\n--------------------------------------------------------------------------------\nUpdate Information:\n\nfoobar\n--------------------------------------------------------------------------------\nReferences:\n\n [ 1 ] Bug #1 - None\n https://bugzilla.redhat.com/show_bug.cgi?id=1\n [ 2 ] CVE-2007-0000\n http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-0000\n----------… update can be installed with the "yum" update program. Use \nsu -c \'yum --enablerepo=updates-testing update TurboGears\' at the command line.\nFor more information, refer to "Managing Software with yum",\navailable at http://docs.fedoraproject.org/yum/.\n\nAll packages are signed with the Fedora Project GPG key. More details on the\nGPG keys used by the Fedora Project can be found at\nhttp://fedoraproject.org/keys\n----------------------------------------…'
class TestBugzilla(testutil.DBTest):
commit 75fc20a0d922dcf613f26cb2c2f811e3562fa1e9
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Jan 4 15:55:03 2010 -0500
Add a big TODO, which will hopefully fix the problem with our auto-obsoletion
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index fc8e07d..35bf9de 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -731,6 +731,9 @@ class Root(controllers.RootController):
# (edited and oldBuild in edited.builds):
# obsoletable = False
# break
+# TODO:
+# ensure that all of the packages in the old update are present in the new one
+# compare length of builds, and match them.
# if rpm.labelCompare(util.get_nvr(oldBuild.nvr), nvr) < 0:
# log.debug("%s is obsoletable" % oldBuild.nvr)
# obsoletable = True
commit 0cbac3c8a832ee9dd3dd108018885e7878317ee2
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Jan 4 15:47:26 2010 -0500
Don't remove security update metadata from our updateinfo (#259).
Eventually, we should add the metadata for the latest versions of all packages.
This way, if a newer version (say, enhancement) comes out after the security
update, the user can be made aware that they are still vulnerable if they have
not updated to at least the security fix version
diff --git a/bodhi/metadata.py b/bodhi/metadata.py
index e9bbab6..3f73e92 100644
--- a/bodhi/metadata.py
+++ b/bodhi/metadata.py
@@ -24,7 +24,7 @@ from sqlobject import SQLObjectNotFound
from turbogears import config
from bodhi.util import get_repo_tag
-from bodhi.model import PackageBuild
+from bodhi.model import PackageBuild, PackageUpdate
from bodhi.buildsys import get_session
from bodhi.modifyrepo import RepoMetadata
from bodhi.exceptions import RepositoryNotFound
@@ -65,7 +65,7 @@ class ExtendedMetadata:
# Add all relevant notices from the metadata to this document
ids = [update.updateid for update in self.updates if update.updateid]
for notice in umd.get_notices():
- if notice['update_id'] in ids:
+ if notice['update_id'] in ids or notice['type'] == 'security':
self._add_notice(notice)
else:
log.debug("Removing %s from updateinfo" % notice['title'])
@@ -77,6 +77,11 @@ class ExtendedMetadata:
else:
missing_ids.append(update.title)
+ # Add *all* security updates
+ # TODO: only the most recent
+ #for update in PackageUpdate.select(PackageUpdate.q.type=='security'):
+ # self.add_update(update)
+
if missing_ids:
log.error("%d updates with missing ID!" % len(missing_ids))
log.debug(missing_ids)
commit 4e13c4494157d76ee0c2386fdbba1dee4166cf78
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Jan 4 15:46:44 2010 -0500
Move the Login/Logout button to the top of the menu (per many requests)
diff --git a/bodhi/templates/master.kid b/bodhi/templates/master.kid
index 3e0cb24..61f67d2 100644
--- a/bodhi/templates/master.kid
+++ b/bodhi/templates/master.kid
@@ -84,6 +84,8 @@ $(document).ready(function() {
</ul>
</div>
<ul id="fedora-side-nav">
+ <li py:if="not tg.identity.anonymous"><a href="${tg.url('/logout')}">Logout</a></li>
+ <li py:if="tg.identity.anonymous"><a href="${tg.url('/login')}">Login</a></li>
<li><a href="${tg.url('/')}">${tg.identity.anonymous and ' ' or "%s's " % tg.identity.user_name}Home</a></li>
<li py:if="not tg.identity.anonymous"><a href="${tg.url('/mine')}">My Updates (${PackageUpdate.select(PackageUpdate.q.submitter == tg.identity.user_name).count()})</a></li>
<li py:if="not tg.identity.anonymous"><a href="${tg.url('/new/')}">New Update</a></li>
@@ -105,8 +107,6 @@ $(document).ready(function() {
</li>
<li class="release"><a href="${tg.url('/comments')}" class="link">Comments</a><a href="${tg.url('/rss/rss2.0?comments=True')}" class="rsslink"><img src="${tg.url('/static/images/rss.png')}" /></a>
</li>
- <li py:if="not tg.identity.anonymous"><a href="${tg.url('/logout')}">Logout</a></li>
- <li py:if="tg.identity.anonymous"><a href="${tg.url('/login')}">Login</a></li>
</ul>
</div>
<!-- leftside END -->