bodhi-client query issues
by Roberto Sassu
Hi all
i'm using Fedora 12 and i have bodhi-client-0.7.4-1 installed.
I'm trying to execute this query:
bodhi -t bugfix -r F12 --status stable
to obtain the complete list of bugfix updates since release.
The problem is that i cannot disable the limit option and i'm only able
to receive the first 1000 records. Specifying the option -l 5000 doesn't
work for me.
Further i have another issue when executing:
bodhi kdenetwork -r F12
The program displays not only the history of the requested package but it includes
some other packages. I report a small output:
kdeaccessibility-4.4.2-1.fc12 security stable 2010-04-09
kdeadmin-4.4.2-1.fc12
kdeartwork-4.4.2-1.fc12
kdebase-4.4.2-1.fc12
kdebase-runtime-4.4.2-1.fc12
kdebindings-4.4.2-1.fc12
.....
konq-plugins-4.4.0-3.fc12
kdebase-workspace-4.4.2-5.fc12
kdelibs-4.4.2-2.fc12
kde-l10n-4.4.1-2.fc12 bugfix stable 2010-03-09
kdeaccessibility-4.4.1-1.fc12
kdeadmin-4.4.1-1.fc12
kdeartwork-4.4.1-1.fc12
.....
Thanks in advance for replies.
13 years, 6 months
bodhi/templates
by Luke Macken
bodhi/templates/master.kid | 2 +-
bodhi/templates/welcome.kid | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 15edfba566088639f8c4387646b28f2935c8f866
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri May 21 05:38:38 2010 -0400
Force https on our links to bodhi's fedorahosted (#430)
diff --git a/bodhi/templates/master.kid b/bodhi/templates/master.kid
index 930fc9b..5b6c789 100644
--- a/bodhi/templates/master.kid
+++ b/bodhi/templates/master.kid
@@ -142,7 +142,7 @@ $(document).ready(function() {
Copyright © 2007-2010 Red Hat, Inc. and others. All Rights Reserved.<br/>
Licensed under the GNU Public License v2 or later.<br />
The Fedora Project is maintained and driven by the community and sponsored by Red Hat.<br/>This is a community maintained site. Red Hat is not responsible for content.<br/>
- [ <a href="http://fedoraproject.org/wiki/Legal">Legal</a>, <a href="http://fedoraproject.org/wiki/Legal/TrademarkGuidelines">Trademark Guidelines</a>, <a href="http://bodhi.fedorahosted.org">Source Code</a> ]
+ [ <a href="http://fedoraproject.org/wiki/Legal">Legal</a>, <a href="http://fedoraproject.org/wiki/Legal/TrademarkGuidelines">Trademark Guidelines</a>, <a href="https://fedorahosted.org/bodhi">Source Code</a> ]
</div>
<!-- footer END -->
diff --git a/bodhi/templates/welcome.kid b/bodhi/templates/welcome.kid
index 62c602a..474d870 100644
--- a/bodhi/templates/welcome.kid
+++ b/bodhi/templates/welcome.kid
@@ -32,7 +32,7 @@
<tr>
<td>
<span id="bodhitip" title="Bodhi Project Homepage">
- <a href="http://fedorahosted.org/bodhi"><img src="${tg.url('/static/images/bodhi-icon-36.png')}" border="0" height="36" width="36"/></a>
+ <a href="https://fedorahosted.org/bodhi"><img src="${tg.url('/static/images/bodhi-icon-36.png')}" border="0" height="36" width="36"/></a>
</span>
</td>
<td>
13 years, 7 months
bodhi/tools
by Luke Macken
bodhi/tools/metrics.py | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
New commits:
commit ff27916e4665eb97b1141dbd96dcced54f262233
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue May 25 10:18:28 2010 -0400
Ignore admin groups when tracking comment author metrics
diff --git a/bodhi/tools/metrics.py b/bodhi/tools/metrics.py
index dfc5c39..9968d99 100755
--- a/bodhi/tools/metrics.py
+++ b/bodhi/tools/metrics.py
@@ -74,11 +74,12 @@ def main():
if comment.karma != 0:
data['num_anon_feedback'] += 1
else:
- if comment.author not in data['karma']:
- data['karma'][comment.author] = 0
- karma[comment.author] = 0
- data['karma'][comment.author] += 1
- karma[comment.author] += 1
+ author = comment.author.split('(')[0]
+ if author not in data['karma']:
+ data['karma'][author] = 0
+ karma[author] = 0
+ data['karma'][author] += 1
+ karma[author] += 1
if (not testingtime_done and
comment.text == 'This update has been pushed to testing'):
for othercomment in update.comments:
13 years, 11 months
bodhi/admin.py
by Luke Macken
bodhi/admin.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit b51bceaceccfdd768455d0150334115678b504ce
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue May 25 13:27:32 2010 -0400
Disable ProxyClient debugging
diff --git a/bodhi/admin.py b/bodhi/admin.py
index b8aa36a..ef52989 100644
--- a/bodhi/admin.py
+++ b/bodhi/admin.py
@@ -201,7 +201,7 @@ class AdminController(Controller, SecureResource):
"""
log.debug('Calling remote method "%s" with %s' % (method, kwargs))
try:
- client = ProxyClient(config.get('masher'), debug=True)
+ client = ProxyClient(config.get('masher'))
cookie = SimpleCookie(cherrypy.request.headers.get('Cookie'))
session, data = client.send_request(method,
auth_params={'session_id': cookie.get('tg-visit').value},
13 years, 11 months
.gitignore
by Luke Macken
.gitignore | 1 +
1 file changed, 1 insertion(+)
New commits:
commit 174145c99f05566576f49b02b41ae599bbb65cca
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat May 22 15:11:38 2010 -0400
Update our gitignore for bodhi-pickledb*
diff --git a/.gitignore b/.gitignore
index 374a415..bb399f7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@ dist
MANIFEST
virtenv
build
+bodhi-pickledb*
13 years, 11 months
bodhi/tests
by Luke Macken
bodhi/tests/test_controllers.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 28a46cfe8bbd67fd89ae72f0b615f3b3a4b8b19b
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu May 20 06:14:09 2010 -0400
Make the test actually work as expected
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index fe97696..1ca20f9 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -1986,4 +1986,4 @@ class TestControllers(testutil.DBTest):
testutil.create_request('/updates/comment?text=foobar&title=%s&karma=1' %
params['builds'], method='POST', headers=session)
up = PackageUpdate.byTitle(params['builds'])
- assert up.karma == 2, up
+ assert up.karma == 3
13 years, 11 months
bodhi/tests
by Luke Macken
bodhi/tests/test_controllers.py | 53 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
New commits:
commit 49654c889054a330f1acedf1e1230e49c9e43c28
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu May 20 05:55:07 2010 -0400
Add a unit test to ensure that developers can go from a -1 to a +1
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index 06cfc61..fe97696 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -1934,3 +1934,56 @@ class TestControllers(testutil.DBTest):
except cherrypy._cperror.HTTPRedirect, e:
assert e.status == 303
assert e.urls[0] == u'/updates/TurboGears2-2.0.3-1.fc7'
+
+ def test_karma_change(self):
+ """
+ Ensure that a developer can give negative karma, and then proceed to later
+ give positive karma.
+ """
+ session = login()
+ create_release()
+ params = {
+ 'builds' : 'TurboGears-1.0.8-1.fc7',
+ 'release' : 'Fedora 7',
+ 'type_' : 'security',
+ 'bugs' : '',
+ 'notes' : 'foobar',
+ 'request' : 'Stable',
+ 'autokarma' : True,
+ 'stable_karma' : 5,
+ 'unstable_karma' : -5
+ }
+ self.save_update(params, session)
+ assert PackageUpdate.byTitle(params['builds']).karma == 0
+
+ dev1 = login(username='bob')
+ testutil.create_request('/updates/comment?text=bar&title=%s&karma=1' %
+ params['builds'], method='POST', headers=dev1)
+ up = PackageUpdate.byTitle(params['builds'])
+ assert up.karma == 1
+
+ dev2 = login(username='jim')
+ testutil.create_request('/updates/comment?text=biz&title=%s&karma=1' %
+ params['builds'], method='POST', headers=dev2)
+ assert PackageUpdate.byTitle(params['builds']).karma == 2
+
+ testutil.create_request('/updates/comment?text=foobar&title=%s&karma=-1' %
+ params['builds'], method='POST', headers=session)
+ assert PackageUpdate.byTitle(params['builds']).karma == 1
+
+ # Give a bunch of +0's
+ testutil.create_request('/updates/comment?text=blah&title=%s&karma=0' %
+ params['builds'], method='POST', headers=dev1)
+ assert PackageUpdate.byTitle(params['builds']).karma == 1
+ testutil.create_request('/updates/comment?text=blah&title=%s&karma=0' %
+ params['builds'], method='POST', headers=session)
+ assert PackageUpdate.byTitle(params['builds']).karma == 1
+ testutil.create_request('/updates/comment?text=blah&title=%s&karma=0' %
+ params['builds'], method='POST', headers=dev2)
+ assert PackageUpdate.byTitle(params['builds']).karma == 1
+
+ # have the submitter +1 the update
+ testutil.create_request('/updates/comment?text=foobar&title=%s&karma=1' %
+ params['builds'], method='POST', headers=session)
+ up = PackageUpdate.byTitle(params['builds'])
+ assert up.karma == 2, up
13 years, 11 months
bodhi/buildsys.py bodhi/controllers.py bodhi/model.py
by Luke Macken
bodhi/buildsys.py | 6 +++++-
bodhi/controllers.py | 17 +++++++++++++++++
bodhi/model.py | 2 ++
3 files changed, 24 insertions(+), 1 deletion(-)
New commits:
commit 662cb826f3ebc463954655c6ce716fd8d5229804
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed May 19 12:13:12 2010 -0400
Only deny editing an update if there is an active request. If not, log a warning...
diff --git a/bodhi/buildsys.py b/bodhi/buildsys.py
index 4ebafb4..f0f9a0b 100644
--- a/bodhi/buildsys.py
+++ b/bodhi/buildsys.py
@@ -131,13 +131,17 @@ class DevBuildsys(Buildsystem):
if 'fc7' in build:
return [{'arches': 'i386 x86_64 ppc ppc64', 'id': 10, 'locked': True,
'name': 'dist-fc7-updates-candidate', 'perm': None, 'perm_id': None},
+ {'arches': 'i386 x86_64 ppc ppc64', 'id': 10, 'locked': True,
+ 'name': 'dist-fc7-updates-testing', 'perm': None, 'perm_id': None},
{'arches': 'i386 x86_64 ppc ppc64', 'id': 5, 'locked': True,
'name': 'dist-fc7', 'perm': None, 'perm_id': None}]
else:
return [{'arches': 'i386 x86_64 ppc ppc64', 'id': 10, 'locked': True,
'name': 'dist-f8-updates-candidate', 'perm': None, 'perm_id': None},
{'arches': 'i386 x86_64 ppc ppc64', 'id': 5, 'locked': True,
- 'name': 'dist-f8', 'perm': None, 'perm_id': None}]
+ 'name': 'dist-f8', 'perm': None, 'perm_id': None},
+ {'arches': 'i386 x86_64 ppc ppc64', 'id': 5, 'locked': True,
+ 'name': 'dist-f8-updates-testing', 'perm': None, 'perm_id': None}]
def listTagged(self, tag, *args, **kw):
if tag not in ('dist-rawhide', 'dist-fc7', 'dist-fc7-updates-candidate',
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 86ec777..f2cf08a 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -657,6 +657,23 @@ class Root(controllers.RootController):
"and try again." % (build, other_build))
raise InvalidUpdateException(params)
+ # Make sure the tag has not been moved, which indicates that we
+ # are in the middle of pushing this update
+ if edited.get_implied_build_tag() not in buildinfo[builds[0]]['tags']:
+ if edited.request:
+ flash_log("Unable to edit update. %s is currently tagged with %s "
+ "where bodhi expects it to be %s. This most likely means "
+ "that this update is currently being pushed." % (
+ builds[0], buildinfo[builds[0]]['tags'],
+ edited.get_implied_build_tag()))
+ raise InvalidUpdateException(params)
+ else:
+ log.warn('Mismatched tags for an update without a request!?')
+ log.debug(edited)
+ log.debug('Implied tag: %s\nActual tags: %s' % (
+ edited.get_implied_build_tag(),
+ buildinfo[builds[0]]['tags']))
+
edited.unpush()
# Refresh the tags for these builds
diff --git a/bodhi/model.py b/bodhi/model.py
index 3577352..2f848d9 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -617,6 +617,8 @@ class PackageUpdate(SQLObject):
tag = self.release.testing_tag
return tag
+ get_implied_build_tag = get_build_tag
+
def update_bugs(self, bugs):
"""
Create any new bugs, and remove any missing ones. Destroy removed bugs
13 years, 11 months
bodhi/controllers.py
by Luke Macken
bodhi/controllers.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 1fb95358c1efb83db9b93f1360ddf8a6452262b0
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed May 19 10:49:14 2010 -0400
More s/qa/proventesters
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 8877b9f..86ec777 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -912,7 +912,7 @@ class Root(controllers.RootController):
# Politely discourage devs from pushing critpath straight to stable
if (update.request == 'stable' and update.critpath and
- 'qa' not in identity.current.groups 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 "
13 years, 11 months
5 commits - bodhi/controllers.py bodhi/metadata.py bodhi/model.py bodhi/tests
by Luke Macken
bodhi/controllers.py | 60 ++++++++++++---------
bodhi/metadata.py | 2
bodhi/model.py | 1
bodhi/tests/test_controllers.py | 110 +++++++++++++++++++++-------------------
4 files changed, 95 insertions(+), 78 deletions(-)
New commits:
commit 42a5e5b00ce96ef843773d75ab5e4a7f73e2b2a7
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed May 19 10:02:54 2010 -0400
Get the test suite running again after the recent admin_groups changes
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index 38748bb..06cfc61 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -1102,6 +1102,9 @@ class TestControllers(testutil.DBTest):
def test_admin_push(self):
session = login(username='admin', group='releng')
+ me = User.by_user_name('admin')
+ testers = Group(group_name='proventesters', display_name='proventesters')
+ me.addGroup(testers)
create_release()
testutil.create_request('/updates/admin/push', headers=session)
assert '0 pending requests' in cherrypy.response.body[0]
@@ -1113,6 +1116,7 @@ class TestControllers(testutil.DBTest):
'notes' : 'Initial release of new package!',
'request' : 'stable'
}
+
self.save_update(params, session)
assert PackageUpdate.select().count() == 1
assert PackageUpdate.select()[0].request == 'stable'
@@ -1445,7 +1449,7 @@ class TestControllers(testutil.DBTest):
assert update.request == 'testing'
def test_push_critpath_to_frozen_release_and_request_stable_as_releng(self):
- session = login(group='releng')
+ session = login(group='proventesters')
create_release(locked=True)
params = {
'builds' : 'kernel-2.6.31-1.fc7',
@@ -1505,7 +1509,7 @@ class TestControllers(testutil.DBTest):
Ensure releng/qa can push critpath updates to stable for pending releases
after 1 releng/qa karma, and 1 other karma
"""
- releng = login(group='releng')
+ releng = login(group='proventesters')
create_release(locked=True)
params = {
'builds' : 'kernel-2.6.31-1.fc7',
@@ -1651,7 +1655,7 @@ class TestControllers(testutil.DBTest):
"""
Ensure admins can submit critpath updates for pending releases to stable.
"""
- session = login(group='qa')
+ session = login(group='proventesters')
create_release(locked=True)
params = {
'builds' : 'kernel-2.6.31-1.fc7',
commit 1c04192e417bbef916801efb0f5d6b6e714329b3
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed May 19 09:43:25 2010 -0400
Auto-obsoletion improvements. Ensure the same packages are present in the
obsoletable update
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index a9a9f55..8877b9f 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -771,11 +771,7 @@ class Root(controllers.RootController):
# all updates are safe to obsolete, or else just skip it.
for oldBuild in package.builds:
obsoletable = False
- print "Potentially obsoleting %s with %s" % (oldBuild.nvr, build)
- print oldBuild
- print oldBuild.updates
for update in oldBuild.updates:
- print update
if update.status not in ('pending', 'testing') or \
update.request or \
update.release not in buildinfo[build]['releases'] or \
@@ -783,10 +779,17 @@ class Root(controllers.RootController):
(edited and oldBuild in edited.builds):
obsoletable = False
break
+ # Ensure the same number of builds are present
+ if len(update.builds) != len(releases[update.release]):
+ obsoletable = False
+ break
# Ensure that all of the packages in the old update are
- # present in the new one. If not, don't obsolete it but
- # make sure the developer knows that the update exists
- #for build in builds:
+ # present in the new one.
+ pkgs = [get_nvr(b)[0] for b in releases[update.release]]
+ for build in update.builds:
+ if build.package.name not in pkgs:
+ obsoletable = False
+ break
if rpm.labelCompare(util.get_nvr(oldBuild.nvr), nvr) < 0:
log.debug("%s is obsoletable" % oldBuild.nvr)
obsoletable = True
commit b996fd012d4374dae57258001c08c4dfb9f71173
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed May 19 09:33:33 2010 -0400
Remove a duplicate log message
diff --git a/bodhi/model.py b/bodhi/model.py
index 6fdbbd3..3577352 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -786,7 +786,6 @@ class PackageUpdate(SQLObject):
task = koji.moveBuild(curtag, newtag, build.nvr, force=True)
tasks.append(task)
if tasks:
- log.debug('Waiting for %s tasks to complete...' % tasks)
if buildsys.wait_for_tasks(tasks, sleep=1):
log.error('One or more tasks failed!')
else:
commit d678dbb9293714b6b945b01c66df0f181aa2f91f
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed May 19 09:23:24 2010 -0400
Re-enable our auto-obsoletion code, and expand the test suite a bit
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index e9cb30a..a9a9f55 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -769,32 +769,37 @@ class Root(controllers.RootController):
# Obsolete any older pending/testing updates.
# If a build is associated with multiple updates, make sure that
# all updates are safe to obsolete, or else just skip it.
- #for oldBuild in package.builds:
- # obsoletable = False
- # for update in oldBuild.updates:
- # if update.status not in ('pending', 'testing') or \
- # update.request or \
- # update.release not in buildinfo[build]['releases'] or \
- # update in pkgBuild.updates or \
- # (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
- # if obsoletable:
- # for update in oldBuild.updates:
- # # Have the newer update inherit the older updates bugs
- # for bug in update.bugs:
- # bugs.append(unicode(bug.bz_id))
- # # Also inherit the older updates notes as well
- # notes += '\n' + update.notes
- # update.obsolete(newer=build)
- # note.append('This update has obsoleted %s, and has '
- # 'inherited its bugs and notes.' % oldBuild.nvr)
+ for oldBuild in package.builds:
+ obsoletable = False
+ print "Potentially obsoleting %s with %s" % (oldBuild.nvr, build)
+ print oldBuild
+ print oldBuild.updates
+ for update in oldBuild.updates:
+ print update
+ if update.status not in ('pending', 'testing') or \
+ update.request or \
+ update.release not in buildinfo[build]['releases'] or \
+ update in pkgBuild.updates or \
+ (edited and oldBuild in edited.builds):
+ obsoletable = False
+ break
+ # Ensure that all of the packages in the old update are
+ # present in the new one. If not, don't obsolete it but
+ # make sure the developer knows that the update exists
+ #for build in builds:
+ if rpm.labelCompare(util.get_nvr(oldBuild.nvr), nvr) < 0:
+ log.debug("%s is obsoletable" % oldBuild.nvr)
+ obsoletable = True
+ if obsoletable:
+ for update in oldBuild.updates:
+ # Have the newer update inherit the older updates bugs
+ for bug in update.bugs:
+ bugs.append(unicode(bug.bz_id))
+ # Also inherit the older updates notes as well
+ notes += '\n' + update.notes
+ update.obsolete(newer=build)
+ note.append('This update has obsoleted %s, and has '
+ 'inherited its bugs and notes.' % oldBuild.nvr)
# Create or modify the necessary PackageUpdate objects
for release, builds in releases.items():
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index c39a38e..38748bb 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -770,78 +770,84 @@ class TestControllers(testutil.DBTest):
self.save_update(params, session)
assert "This resource resides temporarily" in cherrypy.response.body[0], cherrypy.response.body[0]
- #def test_obsoleting(self):
- # session = login()
- # create_release()
- # params = {
- # 'builds' : 'TurboGears-1.0.2.2-2.fc7',
- # 'release' : 'Fedora 7',
- # 'type_' : 'enhancement',
- # 'bugs' : '1234',
- # 'cves' : 'CVE-2020-0001',
- # 'notes' : 'foobar',
- # 'request' : None
- # }
- # self.save_update(params, session)
- # print cherrypy.response.body[0]
- # 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]
- # update = PackageUpdate.byTitle(params['builds'])
- # assert update.status == 'pending'
-
- # # Throw a newer build in, which should obsolete the previous
- # newparams = {
- # 'builds' : 'TurboGears-1.0.2.2-3.fc7',
- # 'release' : 'Fedora 7',
- # 'type_' : 'enhancement',
- # 'bugs' : '4321',
- # 'cves' : 'CVE-2020-0001',
- # 'notes' : 'bizbaz'
- # }
- # self.save_update(newparams, session)
- # newupdate = PackageUpdate.byTitle(newparams['builds'])
- # assert newupdate.status == 'pending'
- # update = PackageUpdate.byTitle(params['builds'])
- # assert update.status == 'obsolete'
-
- # # The newer build should also inherit the obsolete updates bugs
- # bugz = [bug.bz_id for bug in newupdate.bugs]
- # assert 1234 in bugz and 4321 in bugz
-
- # # The newer update should also inherit the obsolete updates notes
- # assert newupdate.notes == "%s\n%s" % (newparams['notes'], params['notes'])
-
- def test_obsoleting_request(self):
+ def test_obsoleting(self):
session = login()
create_release()
params = {
'builds' : 'TurboGears-1.0.2.2-2.fc7',
'release' : 'Fedora 7',
- 'type_' : 'enhancement',
+ 'type_' : 'enhancement',
'bugs' : '1234',
'cves' : 'CVE-2020-0001',
- 'notes' : 'foobar'
+ 'notes' : 'foobar',
+ 'request' : None
}
self.save_update(params, session)
+ print cherrypy.response.body[0]
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]
update = PackageUpdate.byTitle(params['builds'])
assert update.status == 'pending'
- assert update.request == 'testing'
- # Throw a newer build in, which should *NOT* obsolete the previous,
- # since it has an active request
+ # Throw a newer build in, which should obsolete the previous
newparams = {
'builds' : 'TurboGears-1.0.2.2-3.fc7',
'release' : 'Fedora 7',
'type_' : 'enhancement',
'bugs' : '4321',
'cves' : 'CVE-2020-0001',
- 'notes' : 'foobar'
+ 'notes' : 'bizbaz'
}
self.save_update(newparams, session)
newupdate = PackageUpdate.byTitle(newparams['builds'])
assert newupdate.status == 'pending'
update = PackageUpdate.byTitle(params['builds'])
+ assert update.status == 'obsolete'
+
+ # The newer build should also inherit the obsolete updates bugs
+ bugz = [bug.bz_id for bug in newupdate.bugs]
+ assert 1234 in bugz and 4321 in bugz
+
+ # The newer update should also inherit the obsolete updates notes
+ assert newupdate.notes == "%s\n%s" % (newparams['notes'], params['notes'])
+
+ def test_obsoleting_multibuild_update(self):
+ """ Ensure that a new update cannot obsolete an older update that
+ contains this new build along with others """
+ session = login()
+ create_release()
+ params = {
+ 'builds' : 'TurboGears-1.0.2.2-2.fc7 python-sqlalchemy-0.5-0-1.fc7',
+ 'release' : 'Fedora 7',
+ 'type_' : 'enhancement',
+ 'bugs' : '1234',
+ 'cves' : 'CVE-2020-0001',
+ 'notes' : 'foobar',
+ 'request' : None
+ }
+ self.save_update(params, session)
+ update = PackageUpdate.byTitle(','.join(params['builds'].split()))
assert update.status == 'pending'
+ assert len(update.builds) == 2
+ assert len(update.builds[0].updates) == 1
+ update.status = 'testing'
+ update.pushed = True
+ update.date_pushed = datetime.now()
+
+ # Throw a newer build in, which should *NOT* obsolete the previous
+ newparams = {
+ 'builds' : 'python-sqlalchemy-0.5.1-1.fc7',
+ 'release' : 'Fedora 7',
+ 'type_' : 'enhancement',
+ 'bugs' : '',
+ 'cves' : '',
+ 'notes' : ''
+ }
+ self.save_update(newparams, session)
+ newupdate = PackageUpdate.byTitle(newparams['builds'])
+ assert newupdate.status == 'pending'
+ assert newupdate.notes == ''
+ update = PackageUpdate.byTitle(','.join(params['builds'].split()))
+ assert update.status == 'testing', update.status
def test_list(self):
"""
commit 700dcff3be5aa2104449e5d61226d913a7a63b99
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Mar 16 06:23:23 2010 -0400
Set the epoch to 0 instead of None if it doesn't exist
diff --git a/bodhi/metadata.py b/bodhi/metadata.py
index 0401344..b996e71 100644
--- a/bodhi/metadata.py
+++ b/bodhi/metadata.py
@@ -256,7 +256,7 @@ class ExtendedMetadata:
'name' : rpm['name'],
'version' : rpm['version'],
'release' : rpm['release'],
- 'epoch' : rpm['epoch'],
+ 'epoch' : rpm['epoch'] or '0',
'arch' : rpm['arch'],
'src' : urlpath
})
13 years, 11 months