bodhi/tools
by Luke Macken
bodhi/tools/metrics.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 2e07b2c96a448906971c2857d95017e383a11b54
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Oct 28 13:05:23 2011 -0400
clarify a metric
diff --git a/bodhi/tools/metrics.py b/bodhi/tools/metrics.py
index e3d8f49..6dac22c 100755
--- a/bodhi/tools/metrics.py
+++ b/bodhi/tools/metrics.py
@@ -253,7 +253,7 @@ def main():
print
print "Out of %d total updates, %d received feedback (%0.2f%%)" % (
num_updates, feedback, (float(feedback) / num_updates * 100))
- print "Out of %d total unique karma submitters, the top 50 are:" % (
+ print "Out of %d total unique commenters, the top 50 are:" % (
len(karma))
for submitter in sorted(karma.iteritems(), key=itemgetter(1), reverse=True)[:50]:
print " * %s (%d)" % (submitter[0], submitter[1])
12 years, 6 months
bodhi/masher.py
by Luke Macken
bodhi/masher.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit b7f466eb4a831165301cc74f2ab2035ebe174a3e
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Oct 28 12:52:03 2011 -0400
Don't spam updates with comments when resuming pushes
diff --git a/bodhi/masher.py b/bodhi/masher.py
index 01987ef..2b780f3 100644
--- a/bodhi/masher.py
+++ b/bodhi/masher.py
@@ -179,7 +179,8 @@ class MashTask(Thread):
log.warning('Skipping update without request: %s' %update.title)
continue
self.updates.add(update)
- update.comment('This update is currently being pushed to the %s %s updates repository.' % (update.release.long_name, update.request), author='bodhi', email=False)
+ if not resume:
+ update.comment('This update is currently being pushed to the %s %s updates repository.' % (update.release.long_name, update.request), author='bodhi', email=False)
if self.updates:
up = self.updates.pop()
12 years, 6 months
2 commits - bodhi/tools
by Luke Macken
bodhi/tools/metrics.py | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
New commits:
commit 451d012ae23b37b21e5dd68de769a3a0dc7dcf86
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Oct 28 11:45:33 2011 -0400
Ignore autoqa comments in our metrics script
diff --git a/bodhi/tools/metrics.py b/bodhi/tools/metrics.py
index 7219bb4..e3d8f49 100755
--- a/bodhi/tools/metrics.py
+++ b/bodhi/tools/metrics.py
@@ -89,6 +89,8 @@ def main():
testingtime_done = False
for comment in update.comments:
+ if comment.comment_author == 'autoqa':
+ continue
# Track the # of +1's, -1's, and +0's.
if comment.author_name != 'bodhi':
commit 71db84f63352be9f1f89d961eb98c728d110bf19
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Oct 28 11:45:20 2011 -0400
Some more proventester metrics tweaks
diff --git a/bodhi/tools/metrics.py b/bodhi/tools/metrics.py
index f51ecda..7219bb4 100755
--- a/bodhi/tools/metrics.py
+++ b/bodhi/tools/metrics.py
@@ -19,6 +19,9 @@ from bodhi.model import PackageUpdate, Release
statuses = ('stable', 'testing', 'pending', 'obsolete')
types = ('bugfix', 'enhancement', 'security', 'newpackage')
+def short_url(update):
+ return 'https://admin.fedoraproject.org/updates/%s' % update.builds[0].nvr
+
def main():
load_config()
stats = {} # {release: {'stat': ...}}
@@ -42,9 +45,9 @@ def main():
'num_stablekarma': 0,
'num_testingtime': 0,
'critpath_without_karma': set(),
- 'conflicted_proventesters': 0,
- 'critpath_positive_karma_including_proventesters': 0,
- 'critpath_positive_karma_negative_proventesters': 0,
+ 'conflicted_proventesters': [],
+ 'critpath_positive_karma_including_proventesters': [],
+ 'critpath_positive_karma_negative_proventesters': [],
'stable_with_negative_karma': PackageUpdate.select(
AND(PackageUpdate.q.releaseID==release.id,
PackageUpdate.q.status=='stable',
@@ -159,17 +162,17 @@ def main():
# Conflicting proventesters
if positive_proventesters and negative_proventesters:
- data['conflicted_proventesters'] += 1
+ data['conflicted_proventesters'] += [short_url(update)]
# Track updates with overall positive karma, including positive
# karma from a proventester
if update.karma > 0 and positive_proventesters:
- data['critpath_positive_karma_including_proventesters'] += 1
+ data['critpath_positive_karma_including_proventesters'] += [short_url(update)]
# Track updates with overall positive karma, including negative
# karma from a proventester
if update.karma > 0 and negative_proventesters:
- data['critpath_positive_karma_negative_proventesters'] += 1
+ data['critpath_positive_karma_negative_proventesters'] += [short_url(update)]
if testingtime_done:
data['num_tested'] += 1
@@ -204,9 +207,13 @@ def main():
print " * %d +1's from proventesters" % data['proventesters_1']
print " * %d -1's from proventesters" % data['proventesters_-1']
if data['num_critpath']:
- print " * %d critpath updates with conflicting proventesters (%0.2f%% of critpath)" % (data['conflicted_proventesters'], float(data['conflicted_proventesters']) / data['num_critpath'] * 100)
- print " * %d critpath updates with positive karma and negative proventester feedback (%0.2f%% of critpath)" % (data['critpath_positive_karma_negative_proventesters'], float(data['critpath_positive_karma_negative_proventesters']) / data['num_critpath'] * 100)
- print " * %d critpath updates with positive karma and positive proventester feedback (%0.2f%% of critpath)" % (data['critpath_positive_karma_including_proventesters'], float(data['critpath_positive_karma_including_proventesters']) / data['num_critpath'] * 100)
+ print " * %d critpath updates with conflicting proventesters (%0.2f%% of critpath)" % (len(data['conflicted_proventesters']), float(len(data['conflicted_proventesters'])) / data['num_critpath'] * 100)
+ for u in data['conflicted_proventesters']:
+ print " * " + u
+ print " * %d critpath updates with positive karma and negative proventester feedback (%0.2f%% of critpath)" % (len(data['critpath_positive_karma_negative_proventesters']), float(len(data['critpath_positive_karma_negative_proventesters'])) / data['num_critpath'] * 100)
+ for u in data['critpath_positive_karma_negative_proventesters']:
+ print " * " + u
+ print " * %d critpath updates with positive karma and positive proventester feedback (%0.2f%% of critpath)" % (len(data['critpath_positive_karma_including_proventesters']), float(len(data['critpath_positive_karma_including_proventesters'])) / data['num_critpath'] * 100)
print " * %d anonymous users gave feedback (%0.2f%%)" % (
data['num_anon_feedback'], float(data['num_anon_feedback']) /
(data['num_anon_feedback'] + sum(data['karma'].values())) * 100)
12 years, 6 months
2 commits - bodhi/tools
by Luke Macken
bodhi/tools/metrics.py | 45 ++++++++++++++++++++++++++++++++++++++-------
1 file changed, 38 insertions(+), 7 deletions(-)
New commits:
commit a09b4734eb2cb8b3d51c86a68394ad82f21d3f4d
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Oct 27 16:15:29 2011 -0400
Add some more critpath proventester metrics, per FESCo's request
diff --git a/bodhi/tools/metrics.py b/bodhi/tools/metrics.py
index b455048..f51ecda 100755
--- a/bodhi/tools/metrics.py
+++ b/bodhi/tools/metrics.py
@@ -42,6 +42,9 @@ def main():
'num_stablekarma': 0,
'num_testingtime': 0,
'critpath_without_karma': set(),
+ 'conflicted_proventesters': 0,
+ 'critpath_positive_karma_including_proventesters': 0,
+ 'critpath_positive_karma_negative_proventesters': 0,
'stable_with_negative_karma': PackageUpdate.select(
AND(PackageUpdate.q.releaseID==release.id,
PackageUpdate.q.status=='stable',
@@ -140,6 +143,34 @@ def main():
#if not feedback_done:
if update.status == 'stable' and update.karma == 0:
data['critpath_without_karma'].add(update)
+
+ # Proventester metrics
+ proventester_karma = defaultdict(int) # {username: karma}
+ positive_proventesters = 0
+ negative_proventesters = 0
+ for comment in update.comments:
+ if comment.author_group == 'proventesters':
+ proventester_karma[comment.author_name] += comment.karma
+ for _karma in proventester_karma.values():
+ if _karma > 0:
+ positive_proventesters += 1
+ elif _karma < 0:
+ negative_proventesters += 1
+
+ # Conflicting proventesters
+ if positive_proventesters and negative_proventesters:
+ data['conflicted_proventesters'] += 1
+
+ # Track updates with overall positive karma, including positive
+ # karma from a proventester
+ if update.karma > 0 and positive_proventesters:
+ data['critpath_positive_karma_including_proventesters'] += 1
+
+ # Track updates with overall positive karma, including negative
+ # karma from a proventester
+ if update.karma > 0 and negative_proventesters:
+ data['critpath_positive_karma_negative_proventesters'] += 1
+
if testingtime_done:
data['num_tested'] += 1
if not feedback_done:
@@ -172,6 +203,10 @@ def main():
print " * %d proventesters" % len(data['proventesters'])
print " * %d +1's from proventesters" % data['proventesters_1']
print " * %d -1's from proventesters" % data['proventesters_-1']
+ if data['num_critpath']:
+ print " * %d critpath updates with conflicting proventesters (%0.2f%% of critpath)" % (data['conflicted_proventesters'], float(data['conflicted_proventesters']) / data['num_critpath'] * 100)
+ print " * %d critpath updates with positive karma and negative proventester feedback (%0.2f%% of critpath)" % (data['critpath_positive_karma_negative_proventesters'], float(data['critpath_positive_karma_negative_proventesters']) / data['num_critpath'] * 100)
+ print " * %d critpath updates with positive karma and positive proventester feedback (%0.2f%% of critpath)" % (data['critpath_positive_karma_including_proventesters'], float(data['critpath_positive_karma_including_proventesters']) / data['num_critpath'] * 100)
print " * %d anonymous users gave feedback (%0.2f%%)" % (
data['num_anon_feedback'], float(data['num_anon_feedback']) /
(data['num_anon_feedback'] + sum(data['karma'].values())) * 100)
commit cb9c2e933bb6c64162338410221e63faa5227254
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Oct 27 16:15:14 2011 -0400
Minor cleanups to our metrics script
diff --git a/bodhi/tools/metrics.py b/bodhi/tools/metrics.py
index cd816c5..b455048 100755
--- a/bodhi/tools/metrics.py
+++ b/bodhi/tools/metrics.py
@@ -23,7 +23,7 @@ def main():
load_config()
stats = {} # {release: {'stat': ...}}
feedback = 0 # total number of updates that received feedback
- karma = {} # {username: # of karma submissions}
+ karma = defaultdict(int) # {username: # of karma submissions}
num_updates = PackageUpdate.select().count()
proventesters = set()
@@ -47,7 +47,7 @@ def main():
PackageUpdate.q.status=='stable',
PackageUpdate.q.karma < 0)).count(),
'bugs': set(),
- 'karma': {},
+ 'karma': defaultdict(int),
'deltas': [],
'occurrences': {},
'accumulative': timedelta(),
@@ -113,11 +113,7 @@ def main():
if comment.karma != 0:
data['num_anon_feedback'] += 1
else:
- # strip the group name from the author names
- author = comment.author.split('(')[0].strip()
- if author not in data['karma']:
- data['karma'][author] = 0
- karma[author] = 0
+ author = comment.author_name
data['karma'][author] += 1
karma[author] += 1
12 years, 6 months
bodhi/templates
by Toshio くらとみ
bodhi/templates/master.html | 12 ++++++++++--
bodhi/templates/master.kid | 13 +++++++++++--
2 files changed, 21 insertions(+), 4 deletions(-)
New commits:
commit e72d070d00303e041c091876197871e3b4b47cb7
Author: Toshio Kuratomi <toshio(a)fedoraproject.org>
Date: Thu Oct 27 11:35:34 2011 -0700
Change login link so that it can be friendlier if only a missing csrf_token is preventing a use from being deemed logeed in.
diff --git a/bodhi/templates/master.html b/bodhi/templates/master.html
index 6ee26c8..387db05 100644
--- a/bodhi/templates/master.html
+++ b/bodhi/templates/master.html
@@ -106,8 +106,16 @@ $(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>
+ <li py:if="tg.identity.anonymous and not tg.identity.only_token">
+ <a href="${tg.url('/login')}">Login</a>
+ </li>
+ <li py:if="tg.identity.anonymous and tg.identity.only_token">
+ <a href="${tg.url(tg.request.path_info)}">CSRF protected<br />
+ Verify Login</a>
+ </li>
+ <li py:if="not tg.identity.anonymous or tg.identity.only_token">
+ <a href="${tg.url('/logout')}">Logout</a>
+ </li>
</ul>
</div>
<!-- leftside END -->
diff --git a/bodhi/templates/master.kid b/bodhi/templates/master.kid
index f31bd89..3e7bcca 100644
--- a/bodhi/templates/master.kid
+++ b/bodhi/templates/master.kid
@@ -88,8 +88,17 @@ $(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 py:if="tg.identity.anonymous and not tg.identity.only_token">
+ <a href="${tg.url('/login')}">Login</a>
+ </li>
+ <li py:if="tg.identity.anonymous and tg.identity.only_token">
+ <a href="${tg.url(tg.request.path_info)}">
+ CSRF protected<br />
+ Verify Login</a>
+ </li>
+ <li py:if="not tg.identity.anonymous or tg.identity.only_token">
+ <a href="${tg.url('/logout')}">Logout</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>
12 years, 6 months
bodhi/controllers.py bodhi/masher.py bodhi/model.py
by Luke Macken
bodhi/controllers.py | 6 ++++--
bodhi/masher.py | 4 ++--
bodhi/model.py | 2 +-
3 files changed, 7 insertions(+), 5 deletions(-)
New commits:
commit b55fc48dcb9737d2937b2aa0db32edfdccbbf7b3
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Oct 26 19:27:30 2011 -0400
A couple of more tweaks to get the URL scheme working properly.
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index f5c0030..71b91a2 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -1177,10 +1177,12 @@ class Root(controllers.RootController):
# /PackageUpdate.updateid/*
if args:
- update = PackageUpdate.select(PackageUpdate.q.updateid)
+ update = PackageUpdate.select(PackageUpdate.q.updateid == args[0])
if update.count():
+ update = update[0]
return dict(tg_template='bodhi.templates.show',
- update=update[0], comment_form=form)
+ update=update, comment_form=form,
+ updates=[], values={'title': update.title})
# /Package.name
if len(args) == 1:
diff --git a/bodhi/masher.py b/bodhi/masher.py
index a24e38e..01987ef 100644
--- a/bodhi/masher.py
+++ b/bodhi/masher.py
@@ -838,14 +838,14 @@ class MashTask(Thread):
if security_updates:
maildata += u'The following %s Security updates need testing:\n\n' % prefix
for update in security_updates:
- maildata += u' %s\n' % (config.get('base_address') + url(update.get_url(show_builds=True)))
+ maildata += u' %s\n' % (config.get('base_address') + url(update.get_url()))
maildata += '\n\n'
critpath_updates = self.get_unapproved_critpath_updates(prefix)
if critpath_updates:
maildata += u'The following %s Critical Path updates have yet to be approved:\n\n' % prefix
for update in self.get_unapproved_critpath_updates(prefix):
- maildata += u' %s\n' % (config.get('base_address') + url(update.get_url(show_builds=True)))
+ maildata += u' %s\n' % (config.get('base_address') + url(update.get_url()))
maildata += '\n\n'
except Exception, e:
log.exception(e)
diff --git a/bodhi/model.py b/bodhi/model.py
index 6e435d5..f03aa4a 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -665,7 +665,7 @@ class PackageUpdate(SQLObject):
else:
log.error("Cannot find mailing list address for update notice")
- def get_url(self, show_builds=False):
+ def get_url(self):
""" Return the relative URL to this update """
path = ['/']
if self.updateid:
12 years, 6 months
bodhi/controllers.py bodhi/model.py bodhi/tests
by Luke Macken
bodhi/controllers.py | 9 +++++++++
bodhi/model.py | 4 ++--
bodhi/tests/test_controllers.py | 18 ++++++++++++++++++
3 files changed, 29 insertions(+), 2 deletions(-)
New commits:
commit 86ec2fb28d15c2fc76866924a84f1380221948d6
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Oct 26 19:02:03 2011 -0400
Implement a new URL scheme: /updates/<ID>/<build nvrs>
This improves our previous URL structure in that no matter how an update is
edited, the URL will still take us to that specific update, while at the same
time keeping the builds on the end so people know what packages they update is
for.
Based on the the discussion on the Fedora devel list:
https://lists.fedoraproject.org/pipermail/devel/2011-October/158770.html
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index c9bd3a9..f5c0030 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -1158,6 +1158,7 @@ class Root(controllers.RootController):
/Package.name
/PackageUpdate.title
+ /PackageUpdate.updateid/*
/PackageBuild.nvr
/Release.name
/Release.name/PackageUpdate.update_id
@@ -1173,6 +1174,14 @@ class Root(controllers.RootController):
query = []
form = identity.current.anonymous and self.comment_captcha_form \
or self.comment_form
+
+ # /PackageUpdate.updateid/*
+ if args:
+ update = PackageUpdate.select(PackageUpdate.q.updateid)
+ if update.count():
+ return dict(tg_template='bodhi.templates.show',
+ update=update[0], comment_form=form)
+
# /Package.name
if len(args) == 1:
try:
diff --git a/bodhi/model.py b/bodhi/model.py
index f5594b9..6e435d5 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -668,9 +668,9 @@ class PackageUpdate(SQLObject):
def get_url(self, show_builds=False):
""" Return the relative URL to this update """
path = ['/']
- if self.updateid and not show_builds:
- #path.append(self.release.name)
+ if self.updateid:
path.append(self.updateid)
+ path.append(self.title)
else:
path.append(self.title)
return join(*path)
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index cf2b241..111842b 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -2865,3 +2865,21 @@ class TestControllers(testutil.DBTest):
self.save_update(params, session)
logs = testutil.get_log()
assert 'Error: You must supply details for this update' in logs
+
+ def test_new_updateid_url(self):
+ session = login()
+ create_release()
+ params = {
+ 'builds' : 'TurboGears-1.0.2.2-2.fc7',
+ 'release' : 'Fedora 7',
+ 'type_' : 'enhancement',
+ 'bugs' : '1234',
+ 'notes' : 'notes go here',
+ }
+ self.save_update(params, session)
+ up = PackageUpdate.byTitle(params['builds'])
+ up.assign_id()
+ testutil.create_request('/updates/' + up.updateid)
+ assert 'notes go here' in cherrypy.response.body[0]
+ testutil.create_request('/updates/%s/%s' % (up.updateid, up.title))
+ assert 'notes go here' in cherrypy.response.body[0]
12 years, 6 months
bodhi/templates
by Luke Macken
bodhi/templates/master.kid | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 036555ee1836da0318addb3aac83bdf9975e6598
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Oct 25 16:58:53 2011 -0400
Fix our license name in the footer (#487) and update our copyright year
diff --git a/bodhi/templates/master.kid b/bodhi/templates/master.kid
index 7133ef9..f31bd89 100644
--- a/bodhi/templates/master.kid
+++ b/bodhi/templates/master.kid
@@ -140,8 +140,8 @@ $(document).ready(function() {
<!-- footer BEGIN -->
<div id="fedora-footer">
Bodhi Version: ${version} -- Server: ${hostname}<br/>
- Copyright © 2007-2010 Red Hat, Inc. and others.<br/>
- Licensed under the GNU Public License v2 or later.<br />
+ Copyright © 2007-2011 Red Hat, Inc. and others.<br/>
+ Licensed under the GNU General 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="https://fedoraproject.org/wiki/Legal">Legal</a>, <a href="https://fedoraproject.org/wiki/Legal/TrademarkGuidelines">Trademark Guidelines</a>, <a href="https://fedorahosted.org/bodhi">Source Code</a> ]
</div>
12 years, 6 months
bodhi/controllers.py bodhi/tests
by Luke Macken
bodhi/controllers.py | 7 +++---
bodhi/tests/test_controllers.py | 43 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 47 insertions(+), 3 deletions(-)
New commits:
commit ff01dda83f5ab9a7ab1949a4d1a8988db6e32ee5
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Oct 25 16:42:27 2011 -0400
Fix a bug in our auto-obsoletion code (#617)
This bug occurs when a multibuild update contains the same number of packages
as a previous update, but with a different package.
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 36155c0..c9bd3a9 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -945,6 +945,9 @@ class Root(controllers.RootController):
(edited and oldBuild in edited.builds):
obsoletable = False
break
+ if rpm.labelCompare(util.get_nvr(oldBuild.nvr), nvr) < 0:
+ log.debug("%s is newer than %s" % (nvr, oldBuild.nvr))
+ obsoletable = True
# Ensure the same number of builds are present
if len(update.builds) != len(releases[update.release]):
obsoletable = False
@@ -956,10 +959,8 @@ class Root(controllers.RootController):
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
if obsoletable:
+ log.info('%s is obsoletable' % oldBuild.nvr)
for update in oldBuild.updates:
# Have the newer update inherit the older updates bugs
for bug in update.bugs:
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index d6dcdfc..cf2b241 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -975,6 +975,49 @@ class TestControllers(testutil.DBTest):
update = PackageUpdate.byTitle(','.join(params['builds'].split()))
assert update.status == 'testing', update.status
+ def test_obsoleting_update_with_different_packages(self):
+ """ Ensure that a new update cannot obsolete an older update that
+ contains a different package """
+ session = login()
+ create_release()
+ params = {
+ 'builds' : 'TurboGears-1.0.2.2-2.fc7 python-sqlalchemy-0.5.0-1.fc7 nethack-1.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) == 3
+ 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' : 'TurboGears-1.0.3.2-2.fc7 python-sqlalchemy-0.6.0-1.fc7 kernel-3.0-1.fc7',
+ 'release' : 'Fedora 7',
+ 'type_' : 'enhancement',
+ 'bugs' : '',
+ 'cves' : '',
+ 'notes' : 'foo'
+ }
+ #testutil.capture_log(['bodhi.model', 'bodhi.controllers', 'bodhi.admin', 'bodhi.masher', 'bodhi.util'])
+ self.save_update(newparams, session)
+ #assert False, testutil.get_log()
+ newupdate = PackageUpdate.byTitle(','.join(newparams['builds'].split()))
+ assert newupdate.status == 'pending'
+ assert newupdate.notes == 'foo', newupdate.notes
+
+ # Ensure the original update is still in tact
+ update = PackageUpdate.byTitle(','.join(params['builds'].split()))
+ assert update.status == 'testing', update.status
+
def test_list(self):
"""
This unittest verifies various aspects of the generic list controller
12 years, 6 months