Changes to 'refs/tags/0.7.8.1'
by Luke Macken
Tag '0.7.8.1' created by Luke Macken <lmacken(a)redhat.com> at 2010-08-14 00:11 +0000
0.7.8.1
Changes since 0.7.8:
Luke Macken (8):
Require python-kitchen
Revert "Update our approve_testing_updates job to handle updates that have met the"
Calculate the number of days in testing based on the most recent push
Update our DevBuildsys to allow us to edit updates in our local dev instance
Fix a bug when mashing a single repo, without any updates (#462)
Skip critpath updates in our approve_testing_updates job, since they have seperate
Run the approve_testing_updates job every 6 hours
0.7.8.1 masher bugfix release
---
bodhi.spec | 3 ++-
bodhi/buildsys.py | 7 ++++---
bodhi/jobs.py | 21 +++++++++++++++------
bodhi/masher.py | 2 +-
bodhi/model.py | 2 +-
5 files changed, 23 insertions(+), 12 deletions(-)
---
13 years, 8 months
Changes to 'refs/tags/0.7.9'
by Luke Macken
Tag '0.7.9' created by Luke Macken <lmacken(a)redhat.com> at 2010-09-10 22:37 +0000
0.7.9
Changes since 0.7.8.1:
Luke Macken (36):
Revert "Obsolete updates when they are deleted, as opposed to destroying them."
Remove a spurious debugging statement in the bodhi-client
Hopefully fix a bug in using `bodhi --push-build=` on multi-build updates (#409)
Capture stderr from our mash subprocess
Add --stablekarma, --unstablekarma, and --disable-autokarma client args (#327)
Move group of the author of comments to its own field in JSON results (#400)
Set the pagination max_limit to None, as opposed to hard coding it (#414)
Add tooltips next to the update 'status' to better explain "what's next" (#423)
Fix our delta_dirs in our f13-updates-testing.mash config (#440)
Send old_testing nagmail based on the most recent push to testing (#452)
Link to the update newer update in the obsoleted one (#450)
Return the update as JSON instead of a string when using the comment API (#394)
Sync
Revert "Sync"
Merge branch 'master' of git+ssh://git.fedorahosted.org/git/bodhi
Have bodhi start managing the 'pending' koji tags.
Update our DevBuildsys to get our test suite working with the new 'pending' tags
Add some more setuptools magic to our wsgi file to work with multiple version
Handle 'rhbz#1234' bug links in the comments
Some initial tweaks to the CSS of the python-fedora login form
Update our metrics.py script to calculate more metrics
Prevent conflicting builds from being added to the same update (#385)
Get 2 unit tests working again.
Get another unit test working again
Add a new test_duplicate_packages_for_different_releases unit test.
Refactor our PackageUpdate.unpush method.
Re-write our clean-testing script to catch more problems (#464)
More clean-testing.py improvements
Improve our editing workflow, only unpushing when necessary (#474).
Update our test_edit unit test to look for the new edit comments
Revert "Some initial tweaks to the CSS of the python-fedora login form"
Fix a bug in our suggest reboot checkbox
Allow for normal updates hit stable after meeting cripath requirements.
Add a test_push_noncritpath_on_critpath_reqs unit test to validate the
Display a list of unapproved critpath updates in our testing digest (#456)
0.7.9 release
Steve 'Ashcrow' Milner (1):
use newstyle classes where possible
Till Maas (8):
Update current Fedora releases in client helptext
Update version in client to 0.7.8
Use all args to create new updates
Add bodhi-url command line option to client
Mark anonymous karma as ignored
Fix autokarma javascript disabling
set default (un)stable karma values if re-enabled
Link to gitweb instead of cvs viewvc
---
apache/bodhi.wsgi | 5 +
bodhi.egg-info/PKG-INFO | 2
bodhi.egg-info/SOURCES.txt | 3
bodhi.spec | 5 +
bodhi/buildsys.py | 19 +++-
bodhi/closure.py | 2
bodhi/config/f13-updates-testing.mash | 4 -
bodhi/controllers.py | 101 ++++++++++++++-----------
bodhi/jobs.py | 6 -
bodhi/masher.py | 47 ++++++++++-
bodhi/model.py | 135 +++++++++++++++++++++++-----------
bodhi/modifyrepo.py | 2
bodhi/release.py | 2
bodhi/static/images/i.gif |binary
bodhi/templates/pkg.kid | 2
bodhi/templates/show.kid | 24 +++++-
bodhi/tests/test_buildsystem.py | 4 -
bodhi/tests/test_client.py | 8 --
bodhi/tests/test_controllers.py | 128 +++++++++++++++++++++++++++-----
bodhi/tests/test_model.py | 4 -
bodhi/tests/test_util.py | 5 +
bodhi/tools/clean-testing.py | 99 ++++++++++++++++--------
bodhi/tools/client.py | 35 ++++++--
bodhi/tools/metrics.py | 52 +++++++++----
bodhi/widgets.py | 13 ++-
25 files changed, 516 insertions(+), 191 deletions(-)
---
13 years, 8 months
bodhi/masher.py
by Luke Macken
bodhi/masher.py | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
New commits:
commit d478e974a06beca89112f056b998b5fd3674615b
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Sep 10 18:32:32 2010 -0400
Display a list of unapproved critpath updates in our testing digest (#456)
diff --git a/bodhi/masher.py b/bodhi/masher.py
index 239ee75..4cd1b1f 100644
--- a/bodhi/masher.py
+++ b/bodhi/masher.py
@@ -23,9 +23,9 @@ import logging
import subprocess
import cPickle as pickle
-from sqlobject import SQLObjectNotFound
+from sqlobject import SQLObjectNotFound, AND
from threading import Thread, Lock
-from turbogears import config
+from turbogears import config, url
from os.path import exists, join, islink, isdir, dirname, basename
from time import sleep
@@ -723,13 +723,34 @@ class MashTask(Thread):
for i, subbody in enumerate(mail.get_template(update,use_template='maillist_template')):
self.testing_digest[prefix][update.builds[i].nvr] = subbody[1]
+ def get_unapproved_critpath_updates(self, release):
+ release = Release.select(Release.q.long_name==release)
+ updates = []
+ for update in PackageUpdate.select(
+ AND(PackageUpdate.q.releaseID == release.id,
+ PackageUpdate.q.status != 'stable',
+ PackageUpdate.q.request == None),
+ orderBy=PackageUpdate.q.date_submitted).reversed():
+ if update.critpath and not update.critpath_approved:
+ updates.append(update)
+ return updates
+
def send_digest_mail(self):
'''
Send digest mail to mailing lists
'''
for prefix, content in self.testing_digest.items():
log.debug("Sending digest for updates-testing %s" % prefix)
- maildata = u'The following builds have been pushed to %s updates-testing\n\n' % prefix
+ maildata = u''
+ try:
+ 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())
+ maildata += '\n\n'
+ except Exception, e:
+ log.exception(e)
+
+ maildata += u'The following builds have been pushed to %s updates-testing\n\n' % prefix
# get a list af all nvr's
updlist = content.keys()
# sort the list
13 years, 8 months
4 commits - bodhi/controllers.py bodhi/model.py bodhi/static bodhi/templates bodhi/tests
by Luke Macken
bodhi/controllers.py | 2 -
bodhi/model.py | 2 -
bodhi/static/css/layout.css | 37 -------------------------
bodhi/templates/master.html | 2 -
bodhi/tests/test_controllers.py | 59 ++++++++++++++++++++++++++++++++++++++++
5 files changed, 62 insertions(+), 40 deletions(-)
New commits:
commit 8aa508d898bec7a7e78956c2671eef4ca51da9ee
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Sep 10 18:08:27 2010 -0400
Add a test_push_noncritpath_on_critpath_reqs unit test to validate the
previous commit
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index 82ab882..a9c5cf3 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -2347,3 +2347,62 @@ class TestControllers(testutil.DBTest):
up = PackageUpdate.byTitle(params['builds'])
assert up.request == 'stable'
assert up.comments[-1].text == u'This update has been submitted for stable by guest. '
+
+ def test_push_noncritpath_on_critpath_reqs(self):
+ """
+ Make sure normal updates can meet the testing requirements after
+ achieving critpath-level approval.
+ """
+ session = login(username='admin', group='proventesters')
+ create_release()
+ f7 = Release.byName('F7')
+ assert f7.mandatory_days_in_testing, f7.mandatory_days_in_testing
+ params = {
+ 'builds' : 'nethack-2.6.31-1.fc7',
+ 'release' : 'Fedora 7',
+ 'type_' : 'bugfix',
+ 'bugs' : '',
+ 'notes' : '',
+ 'autokarma': True,
+ 'stable_karma' : 3,
+ 'request': 'stable',
+ 'unstable_karma' : -3,
+ }
+
+ #testutil.capture_log(['bodhi.controllers', 'bodhi.util', 'bodhi.model'])
+ self.save_update(params, session)
+ #logs = testutil.get_log()
+ update = PackageUpdate.byTitle(params['builds'])
+ assert update.request != 'stable', update.request
+
+ # proventester +1
+ testutil.create_request('/updates/comment?text=foobar&title=%s&karma=1' %
+ params['builds'], method='POST', headers=session)
+ update = PackageUpdate.byTitle(params['builds'])
+ assert update.karma == 1
+ assert update.request != 'stable'
+ assert len(update.comments) == 2
+ assert not update.critpath
+ assert not update.critpath_approved
+ assert update.num_admin_approvals == 1
+
+ # try to push, and fail
+ testutil.create_request('/updates/request/stable/%s' % params['builds'],
+ method='POST', headers=session)
+ update = PackageUpdate.byTitle(params['builds'])
+ assert update.request != 'stable'
+
+ # normal user +1
+ testutil.create_request('/updates/comment?text=bizbaz&title=%s&karma=1' %
+ params['builds'], method='POST',
+ headers=login())
+ update = PackageUpdate.byTitle(params['builds'])
+ assert update.karma == 2, update.karma
+ assert update.request != 'stable'
+ assert update.num_admin_approvals == 1
+
+ # currently: try to push fail... eventually, succeed
+ testutil.create_request('/updates/request/stable/%s' % params['builds'],
+ method='POST', headers=session)
+ update = PackageUpdate.byTitle(params['builds'])
+ assert update.request == 'stable'
commit 50e3c79180635b1a24479477963153b95b43d7b6
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Sep 10 18:07:18 2010 -0400
Allow for normal updates hit stable after meeting cripath requirements.
diff --git a/bodhi/model.py b/bodhi/model.py
index f88824f..c03e194 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -466,7 +466,7 @@ class PackageUpdate(SQLObject):
flash_notes = ''
if action == 'stable' and not self.critpath:
# Check if we've met the karma requirements
- if self.karma >= self.stable_karma:
+ if self.karma >= self.stable_karma or self.critpath_approved:
pass
else:
# If we haven't met the stable karma requirements, check if it has met
commit 06659f9ab3437d1b74f3cb3c466226923d14df58
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Sep 10 17:40:34 2010 -0400
Fix a bug in our suggest reboot checkbox
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 92282df..e0c6eda 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -557,7 +557,7 @@ class Root(controllers.RootController):
'autokarma' : autokarma,
'stable_karma': stable_karma,
'unstable_karma': unstable_karma,
- 'suggest_reboot': suggest_reboot,
+ 'suggest_reboot': suggest_reboot and 'True' or '',
}
# Basic sanity checks
commit d4414e2faed889aac1277f162549d4d775c57e41
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Sep 10 17:39:51 2010 -0400
Revert "Some initial tweaks to the CSS of the python-fedora login form"
This reverts commit 74749ac20792205ca90e1e4ada04f904aaf8f26c.
It broke more things than expected...
diff --git a/bodhi/static/css/layout.css b/bodhi/static/css/layout.css
index fdb1e94..f546154 100644
--- a/bodhi/static/css/layout.css
+++ b/bodhi/static/css/layout.css
@@ -495,43 +495,6 @@ p.padded {
padding-left: 10px;
}
-/* New python-fedora login form */
-
-label {
- text-align: right;
- vertical-align: top;
- background-color: #f1f1f1;
- float: left;
- clear: left;
- width: 100px;
- font-weight: bold;
- padding: 10px 10px 10px 100px;
-}
-
-#user_name {
- text-align: left;
- padding-top: 5px;
- padding-left: 5px;
- padding: 5px;
-}
-
-#password {
- text-align: left;
- padding-top: 5px;
- padding-left: 5px;
- padding: 5px;
-}
-
-#login-box form{
- border-collapse: collapse;
- border-bottom: 1px solid #bcbcbc;
- border-top: 1px solid #bcbcbc;
- width: 100%;
-}
-
-
-
-
/*
td.title {
text-align: right;
diff --git a/bodhi/templates/master.html b/bodhi/templates/master.html
index 3a55d03..6ee26c8 100644
--- a/bodhi/templates/master.html
+++ b/bodhi/templates/master.html
@@ -135,7 +135,7 @@ $(document).ready(function() {
<!-- footer BEGIN -->
<div id="fedora-footer">
Bodhi Version: ${version} -- Server: ${hostname}<br/>
- Copyright © 2007-2010 Red Hat, Inc. and others. All Rights Reserved.<br/>
+ Copyright © 2007-2008 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> ]
13 years, 8 months
2 commits - bodhi/controllers.py bodhi/tests
by Luke Macken
bodhi/controllers.py | 26 +++++++++++++++++++++++++-
bodhi/tests/test_controllers.py | 2 ++
2 files changed, 27 insertions(+), 1 deletion(-)
New commits:
commit 54ae5e1fe4bea5847f2a11758c0796f6ed4ce411
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Sep 10 17:07:38 2010 -0400
Update our test_edit unit test to look for the new edit comments
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index 98a4bac..82ab882 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -499,6 +499,8 @@ class TestControllers(testutil.DBTest):
for build in PackageBuild.select():
assert len(build.updates), "%s has no updates!" % build.nvr
+ assert update.comments[-1].text == u'guest has edited this update. New build(s): python-sqlobject-0.8.2-1.fc7. '
+
# Remove a build and bug
params = {
'builds' : 'python-sqlobject-0.8.2-1.fc7',
commit 4100581bf03feb85858acd0550e7d658532e26c6
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Sep 10 17:05:35 2010 -0400
Improve our editing workflow, only unpushing when necessary (#474).
Determine if any builds have been added/removed from the update upon
editing, and only unpush it if this is the case. This way, people can
easily edit their update adding new bugs/notes without having to deal it it
getting unpushed/pushed again.
This will also add a comment to the update mentioning which builds have
been added/removed from the update.
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 699a7ca..92282df 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -691,7 +691,31 @@ class Root(controllers.RootController):
edited.get_implied_build_tag(),
buildinfo[builds[0]]['tags']))
- edited.unpush()
+ # Determine which builds have been added or removed
+ edited_builds = [build.nvr for build in edited.builds]
+ new_builds = []
+ removed_builds = []
+ for build in builds:
+ if build not in edited_builds:
+ new_builds.append(build)
+ for build in edited_builds:
+ if build not in builds:
+ removed_builds.append(build)
+ if new_builds or removed_builds:
+ # Comment on the update with details of added/removed builds
+ comment = '%s has edited this update. ' % identity.current.user_name
+ if new_builds:
+ comment += 'New build(s): %s. ' % ', '.join(new_builds)
+ if removed_builds:
+ comment += 'Removed build(s): %s.' % ', '.join(removed_builds)
+ edited.comment(comment, karma=0, author='bodhi')
+
+ # Make sure all builds are tagged as updates-candidate
+ # and bring the update back to a pending state
+ edited.unpush()
+ else:
+ # No need to change the bodhi state or koji tag
+ pass
# Refresh the tags for these builds
for build in edited.builds:
13 years, 8 months
bodhi/tools
by Luke Macken
bodhi/tools/clean-testing.py | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
New commits:
commit 9336c8f89db6d4e8e2dec82badf54c8169fc3589
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Sep 10 16:52:42 2010 -0400
More clean-testing.py improvements
diff --git a/bodhi/tools/clean-testing.py b/bodhi/tools/clean-testing.py
index 18a3ae8..9ce6b69 100755
--- a/bodhi/tools/clean-testing.py
+++ b/bodhi/tools/clean-testing.py
@@ -13,11 +13,11 @@ import turbogears
from sqlobject import SQLObjectNotFound, AND
from turbogears.database import PackageHub
-from bodhi.util import load_config
+from bodhi.util import load_config, build_evr
from bodhi.model import Release, PackageBuild, PackageUpdate
from bodhi.buildsys import get_session
-def compare_builds(testing_build, stable_build, untag):
+def compare_builds(testing_build, stable_build, untag, tag):
if stable_build['package_name'] == testing_build['package_name']:
if rpm.labelCompare((str(testing_build['epoch']),
testing_build['version'],
@@ -42,9 +42,8 @@ def compare_builds(testing_build, stable_build, untag):
except SQLObjectNotFound:
if untag:
print "Untagging via koji"
- koji.untagBuild(release.testing_tag,
- testing_build['nvr'],
- force=True)
+ koji = get_session()
+ koji.untagBuild(tag, testing_build['nvr'], force=True)
else:
print "Need to untag koji build %s" % testing_build['nvr']
@@ -62,9 +61,9 @@ def clean_testing_builds(untag=False):
testing_nvrs = [build['nvr'] for build in testing_builds]
for testing_build in testing_builds:
for build in testing_builds:
- compare_builds(testing_build, build, untag)
+ compare_builds(testing_build, build, untag, release.testing_tag)
for build in stable_builds:
- compare_builds(testing_build, build, untag)
+ compare_builds(testing_build, build, untag, release.testing_tag)
# Find testing updates that aren't in the list of latest builds
for update in PackageUpdate.select(AND(PackageUpdate.q.releaseID==release.id,
@@ -82,12 +81,16 @@ def clean_testing_builds(untag=False):
if stable.startswith(build.package.name + '-'):
latest_stable = stable
break
- print "%s in testing, latest_testing = %s, latest_stable = %s" % (
- update.title, latest_testing, latest_stable)
- if untag:
- print "Obsoleting %s" % update.title
- assert latest_testing
- update.obsolete(newer=latest_testing)
+ if latest_testing:
+ koji_build = koji.getBuild(build.nvr)
+ latest_build = koji.getBuild(latest_testing)
+ if rpm.labelCompare(build_evr(koji_build),
+ build_evr(latest_build)) < 0:
+ print "%s in testing, latest_testing = %s, latest_stable = %s" % (
+ update.title, latest_testing, latest_stable)
+ if untag:
+ print "Obsoleting %s" % update.title
+ update.obsolete(newer=latest_testing)
if __name__ == '__main__':
13 years, 8 months
2 commits - bodhi/model.py bodhi/tools
by Luke Macken
bodhi/model.py | 32 ++++++++------
bodhi/tools/clean-testing.py | 96 ++++++++++++++++++++++++++++---------------
2 files changed, 83 insertions(+), 45 deletions(-)
New commits:
commit 861641fcbb3eba93e9a169f9634c92795e85a77e
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Sep 10 16:06:52 2010 -0400
Re-write our clean-testing script to catch more problems (#464)
This will now check all of the latest builds tagged as testing against
all other testing builds and stable builds. It will also look at all
testing updates to make sure they are the latest in the testing koji tag.
diff --git a/bodhi/tools/clean-testing.py b/bodhi/tools/clean-testing.py
index 25ad427..18a3ae8 100755
--- a/bodhi/tools/clean-testing.py
+++ b/bodhi/tools/clean-testing.py
@@ -10,55 +10,85 @@ import rpm
import turbomail
import turbogears
-from sqlobject import SQLObjectNotFound
+from sqlobject import SQLObjectNotFound, AND
from turbogears.database import PackageHub
from bodhi.util import load_config
-from bodhi.model import Release, PackageBuild
+from bodhi.model import Release, PackageBuild, PackageUpdate
from bodhi.buildsys import get_session
+def compare_builds(testing_build, stable_build, untag):
+ if stable_build['package_name'] == testing_build['package_name']:
+ if rpm.labelCompare((str(testing_build['epoch']),
+ testing_build['version'],
+ testing_build['release']),
+ (str(stable_build['epoch']),
+ stable_build['version'],
+ stable_build['release'])) < 0:
+ print "%s is older than %s" % (testing_build['nvr'],
+ stable_build['nvr'])
+ try:
+ build = PackageBuild.byNvr(testing_build['nvr'])
+ for update in build.updates:
+ if update.status != 'testing':
+ print "%s not testing in bodhi!" % update.title
+ raise SQLObjectNotFound
+ else:
+ if untag:
+ print "Obsoleting via bodhi"
+ update.obsolete(newer=stable_build['nvr'])
+ else:
+ print "Need to obsolete via bodhi"
+ except SQLObjectNotFound:
+ if untag:
+ print "Untagging via koji"
+ koji.untagBuild(release.testing_tag,
+ testing_build['nvr'],
+ force=True)
+ else:
+ print "Need to untag koji build %s" % testing_build['nvr']
+
+
def clean_testing_builds(untag=False):
koji = get_session()
for release in Release.select():
stable_builds = koji.listTagged(release.stable_tag, latest=True)
+ stable_nvrs = [build['nvr'] for build in stable_builds]
print "Fetched %d builds tagged with %s" % (
len(stable_builds), release.stable_tag)
testing_builds = koji.listTagged(release.testing_tag, latest=True)
print "Fetched %d builds tagged with %s" % (
len(testing_builds), release.testing_tag)
+ testing_nvrs = [build['nvr'] for build in testing_builds]
for testing_build in testing_builds:
- for stable_build in stable_builds:
- if stable_build['package_name'] == testing_build['package_name']:
- if rpm.labelCompare((str(testing_build['epoch']),
- testing_build['version'],
- testing_build['release']),
- (str(stable_build['epoch']),
- stable_build['version'],
- stable_build['release'])) < 0:
- print "%s is older than %s" % (testing_build['nvr'],
- stable_build['nvr'])
- try:
- build = PackageBuild.byNvr(testing_build['nvr'])
- for update in build.updates:
- if update.status != 'testing':
- print "%s not testing in bodhi!" % update.title
- raise SQLObjectNotFound
- else:
- if untag:
- print "Obsoleting via bodhi"
- update.obsolete(newer=stable_build['nvr'])
- else:
- print "Need to obsolete via bodhi"
- except SQLObjectNotFound:
- if untag:
- print "Untagging via koji"
- koji.untagBuild(release.testing_tag,
- testing_build['nvr'],
- force=True)
- else:
- print "Need to untag koji build %s" % testing_build['nvr']
+ for build in testing_builds:
+ compare_builds(testing_build, build, untag)
+ for build in stable_builds:
+ compare_builds(testing_build, build, untag)
+
+ # Find testing updates that aren't in the list of latest builds
+ for update in PackageUpdate.select(AND(PackageUpdate.q.releaseID==release.id,
+ PackageUpdate.q.status=='testing',
+ PackageUpdate.q.request==None)):
+ for build in update.builds:
+ if build.nvr not in testing_nvrs:
+ latest_testing = None
+ latest_stable = None
+ for testing in testing_nvrs:
+ if testing.startswith(build.package.name + '-'):
+ latest_testing = testing
+ break
+ for stable in stable_nvrs:
+ if stable.startswith(build.package.name + '-'):
+ latest_stable = stable
+ break
+ print "%s in testing, latest_testing = %s, latest_stable = %s" % (
+ update.title, latest_testing, latest_stable)
+ if untag:
+ print "Obsoleting %s" % update.title
+ assert latest_testing
+ update.obsolete(newer=latest_testing)
- print
if __name__ == '__main__':
load_config()
commit 6f085a0613c6daedb3062589c032332d4f5b4b7f
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Sep 10 13:57:32 2010 -0400
Refactor our PackageUpdate.unpush method.
This method will now handle adding a new candidate tag to builds
that have been untagged completely. It will also now query koji
for the actual tags of the builds, as opposed to guessing.
diff --git a/bodhi/model.py b/bodhi/model.py
index e721782..f88824f 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -841,22 +841,30 @@ class PackageUpdate(SQLObject):
def unpush(self):
""" Move this update back to its dist-fX-updates-candidate tag """
+ log.debug("Unpushing %s" % self.title)
koji = buildsys.get_session()
tasks = []
- newtag = self.release.candidate_tag
- curtag = self.get_build_tag()
- if curtag == self.release.candidate_tag:
- log.debug("%s already unpushed" % self.title)
- return
- log.debug("Unpushing %s" % self.title)
for build in self.builds:
- if build.inherited:
- log.debug("Removing %s tag from inherited build %s" % (
- curtag, build.nvr))
- koji.untagBuild(curtag, build.nvr, force=True)
+ curtag = build.get_tags()
+ if curtag:
+ if self.release.testing_tag in curtag:
+ curtag = self.release.testing_tag
+ if build.inherited:
+ 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,
+ self.release.candidate_tag))
+ task = koji.moveBuild(curtag, self.release.candidate_tag,
+ build.nvr, force=True)
+ tasks.append(task)
+ else:
+ # Could be stable or candidate already... so don't do anything
+ pass
else:
- log.debug("Moving %s from %s to %s" % (build.nvr, curtag, newtag))
- task = koji.moveBuild(curtag, newtag, build.nvr, force=True)
+ # Build is untagged
+ task = koji.tagBuild(self.release.candidate_tag,build.nvr,force=True)
tasks.append(task)
if tasks:
if buildsys.wait_for_tasks(tasks, sleep=1):
13 years, 8 months
7 commits - bodhi/buildsys.py bodhi/controllers.py bodhi/model.py bodhi/static bodhi/templates bodhi/tests bodhi/tools
by Luke Macken
bodhi/buildsys.py | 8 +++---
bodhi/controllers.py | 24 ++++++++++--------
bodhi/model.py | 7 +++++
bodhi/static/css/layout.css | 37 ++++++++++++++++++++++++++++
bodhi/templates/master.html | 2 -
bodhi/tests/test_controllers.py | 47 ++++++++++++++++++++++++++++++------
bodhi/tests/test_model.py | 4 ++-
bodhi/tools/metrics.py | 52 ++++++++++++++++++++++++++++++----------
8 files changed, 146 insertions(+), 35 deletions(-)
New commits:
commit 85d29f9b3fc98472306a1de94e7cbdd155d94277
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Sep 10 13:33:54 2010 -0400
Add a new test_duplicate_packages_for_different_releases unit test.
Ensure that bodhi allows submitting an update with two versions of the
same package to different releases.
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index ff8c365..98a4bac 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -2245,6 +2245,39 @@ class TestControllers(testutil.DBTest):
except SQLObjectNotFound, e:
pass
+ def test_duplicate_packages_for_different_releases(self):
+ """
+ Ensure that bodhi allows submitting an update with two versions of the
+ same package to different releases.
+ """
+ session = login()
+ create_release()
+ create_release('8', dist='dist-f')
+ params = {
+ 'builds' : 'TurboGears-1.0.8-1.fc7,TurboGears-1.0.8-2.fc8',
+ 'type_' : 'bugfix',
+ 'bugs' : '',
+ 'notes' : 'foobar',
+ 'request' : 'Stable',
+ 'suggest_reboot' : True,
+ 'autokarma' : True,
+ 'stable_karma' : 5,
+ 'unstable_karma' : -5
+ }
+ testutil.capture_log(['bodhi.controller', 'bodhi.util'])
+ self.save_update(params, session)
+ log = testutil.get_log()
+ try:
+ up = PackageUpdate.byTitle(params['builds'])
+ assert False, "Update created with 2 builds for 2 different releases!"
+ except SQLObjectNotFound:
+ pass
+ one, two = params['builds'].split(',')
+ up1 = PackageUpdate.byTitle(one)
+ assert up1.title == one
+ up2 = PackageUpdate.byTitle(two)
+ assert up2.title == two
+
def test_week_in_testing(self):
from bodhi.jobs import approve_testing_updates
session = login()
commit 4619fe1081927fe6fbd4eedc5bbf80b821db08c2
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Sep 10 01:03:16 2010 -0400
Get another unit test working again
diff --git a/bodhi/buildsys.py b/bodhi/buildsys.py
index fc4a2e8..29613bd 100644
--- a/bodhi/buildsys.py
+++ b/bodhi/buildsys.py
@@ -111,6 +111,8 @@ class DevBuildsys(Buildsystem):
'task_id': 127621,
'version': '2.6.31'}
else:
+ f = build.split('.')[-1].replace('fc', 'f')
+ release = build.split('.')[-1]
return {'build_id': 16058,
'completion_time': '2007-08-24 23:26:10.890319',
'creation_event_id': 151517,
@@ -118,15 +120,15 @@ class DevBuildsys(Buildsystem):
'epoch': None,
'id': 16058,
'name': 'TurboGears',
- 'nvr': 'TurboGears-1.0.2.2-2.fc8',
+ 'nvr': 'TurboGears-1.0.2.2-2.%s' % release,
'owner_id': 388,
'owner_name': 'lmacken',
'package_id': 8,
'package_name': 'TurboGears',
- 'release': '2.fc8',
+ 'release': '2.%s' % release,
'state': 1,
'tag_id': 19,
- 'tag_name': 'dist-f8-updates-testing',
+ 'tag_name': 'dist-%s-updates-testing' % f,
'task_id': 127621,
'version': '1.0.2.2'}
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index c0daa36..ff8c365 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -1218,7 +1218,7 @@ class TestControllers(testutil.DBTest):
create_release(num='9', dist='dist-f')
create_release(num='8', dist='dist-f')
params = {
- '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',
+ '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,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,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,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',
@@ -1230,12 +1230,12 @@ class TestControllers(testutil.DBTest):
assert PackageBuild.select().count() == len(params['builds'].split(','))
update.status = 'testing'
params = {
- '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',
+ '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,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,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,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_' : 'enhancement',
'bugs' : '',
'notes' : '',
- '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',
+ '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,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,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,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)
@@ -2238,7 +2238,7 @@ class TestControllers(testutil.DBTest):
testutil.capture_log(['bodhi.controller', 'bodhi.util'])
self.save_update(params, session)
log = testutil.get_log()
- assert u'Unable to save update with conflicting builds of the same package: TurboGears-1.0.8-1.fc7 and TurboGears-1.0.8-2.fc7. Please remove one and try again.' in log, log
+ assert u'Unable to save update with conflicting builds of the same package: TurboGears-1.0.8-1.fc7 and TurboGears-1.0.8-2.fc7. Please remove one and try again.' in log, log
try:
up = PackageUpdate.byTitle(params['builds'])
assert False, "Update with duplicate packages was saved!"
commit d431b7c3d979d41b087f4b018b5df5882a6ebccc
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Sep 10 00:20:04 2010 -0400
Get 2 unit tests working again.
The old_testing nagmail is now based on the PackageUpdate.time_in_testing,
so this test needed some tweaking.
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index 1a365ba..c0daa36 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -390,7 +390,7 @@ class TestControllers(testutil.DBTest):
up = PackageUpdate.select()[0]
assert len(up.builds) == 2, up.builds
assert up.title == params['edited']
- assert u'Unable to save update with conflicting builds of the same package: TurboGears-1.0.2.2-2.fc7 and TurboGears-1.0.2.2-1.fc7. Please remove one and try again.' in logs
+ assert u'Unable to save update with conflicting builds of the same package: TurboGears-1.0.2.2-2.fc7 and TurboGears-1.0.2.2-1.fc7. Please remove one and try again.' in logs
def test_add_newer_build_to_update(self):
""" Try adding a newer build an update (#385) """
@@ -422,7 +422,7 @@ class TestControllers(testutil.DBTest):
up = PackageUpdate.select()[0]
assert len(up.builds) == 2, up.builds
assert up.title == params['edited']
- assert u'Unable to save update with conflicting builds of the same package: TurboGears-1.0.2.2-2.fc7 and TurboGears-1.0.2.2-3.fc7. Please remove one and try again.' in logs
+ assert u'Unable to save update with conflicting builds of the same package: TurboGears-1.0.2.2-2.fc7 and TurboGears-1.0.2.2-3.fc7. Please remove one and try again.' in logs
def test_add_different_release_to_update(self):
"""
diff --git a/bodhi/tests/test_model.py b/bodhi/tests/test_model.py
index 6e60bcb..d4c36b2 100644
--- a/bodhi/tests/test_model.py
+++ b/bodhi/tests/test_model.py
@@ -462,14 +462,16 @@ class TestPackageUpdate(testutil.DBTest):
def test_old_testing_nagmail(self):
update = self.get_update()
update.status = 'testing'
+ update.status_comment()
assert not update.nagged
nagmail()
assert not update.nagged
+ update.comments[-1].timestamp = datetime.utcnow() - timedelta(days=20)
update.date_pushed = datetime.utcnow() - timedelta(days=20)
testutil.capture_log('bodhi.jobs')
nagmail()
log = testutil.get_log()
- assert "[old_testing] Nagging foo(a)bar.com about TurboGears-1.0.2.2-2.fc7" in log
+ assert "[old_testing] Nagging foo(a)bar.com about TurboGears-1.0.2.2-2.fc7" in log, log
assert update.nagged, update.nagged
assert update.nagged.has_key('old_testing')
commit 3157e238c8c78b2634cbfa6d4c2a8298e7a7d9b3
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Sep 9 14:02:08 2010 -0400
Prevent conflicting builds from being added to the same update (#385)
This ensures that an update cannot be pushed if it contains two different
versions of the same package for the same release in the same update.
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 5de5173..699a7ca 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -579,6 +579,20 @@ class Root(controllers.RootController):
flash_log("Stable karma must be higher than unstable karma.")
raise InvalidUpdateException(params)
+ # Check for conflicting builds
+ for build in builds:
+ build_nvr = get_nvr(build)
+ for other_build in builds:
+ other_build_nvr = get_nvr(other_build)
+ if build == other_build:
+ continue
+ if (build_nvr[0] == other_build_nvr[0] and
+ build_nvr[2].split('.')[-1] == other_build_nvr[2].split('.')[-1]):
+ flash_log("Unable to save update with conflicting builds of "
+ "the same package: %s and %s. Please remove one "
+ "and try again." % (build, other_build))
+ raise InvalidUpdateException(params)
+
# Make sure this update doesn't already exist
if not edited:
for build in builds:
@@ -660,16 +674,6 @@ class Root(controllers.RootController):
config.get('release_team_address'))
raise InvalidUpdateException(params)
- # Check for conflicting builds when editing
- for build in builds:
- for other_build in builds:
- if get_nvr(build)[0] == get_nvr(other_build)[0]:
- if build != other_build:
- flash_log("Unable to save update with conflicting builds of "
- "the same package: %s and %s. Please remove one "
- "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']:
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index eb50604..1a365ba 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -2216,7 +2216,7 @@ class TestControllers(testutil.DBTest):
update = PackageUpdate.byTitle(params['builds'])
assert update.request == 'stable', update.request
- def test_duplicate_packages(self):
+ def test_duplicate_packages_for_same_release(self):
"""
Ensure that bodhi disallows submitting an update with two versions
of the same package (#264).
@@ -2238,7 +2238,7 @@ class TestControllers(testutil.DBTest):
testutil.capture_log(['bodhi.controller', 'bodhi.util'])
self.save_update(params, session)
log = testutil.get_log()
- assert "You cannot submit an update containing multiple versions of TurboGears" in log, log
+ assert u'Unable to save update with conflicting builds of the same package: TurboGears-1.0.8-1.fc7 and TurboGears-1.0.8-2.fc7. Please remove one and try again.' in log, log
try:
up = PackageUpdate.byTitle(params['builds'])
assert False, "Update with duplicate packages was saved!"
commit 2982897063529060a9384e6dafa8a2b2ad9e292b
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Sep 8 15:50:57 2010 -0400
Update our metrics.py script to calculate more metrics
diff --git a/bodhi/tools/metrics.py b/bodhi/tools/metrics.py
index 57fe2a2..871fbe3 100755
--- a/bodhi/tools/metrics.py
+++ b/bodhi/tools/metrics.py
@@ -23,6 +23,7 @@ def main():
feedback = 0 # total number of updates that received feedback
karma = {} # {username: # of karma submissions}
num_updates = PackageUpdate.select().count()
+ proventesters = set()
for release in Release.select():
print header(release.long_name)
@@ -34,18 +35,24 @@ def main():
'num_feedback': 0,
'num_anon_feedback': 0,
'num_critpath': 0,
+ 'num_critpath_approved': 0,
+ 'num_critpath_unapproved': 0,
'critpath_without_karma': set(),
+ 'stable_with_negative_karma': PackageUpdate.select(
+ AND(PackageUpdate.q.releaseID==release.id,
+ PackageUpdate.q.status=='stable',
+ PackageUpdate.q.karma < 0)).count(),
'bugs': set(),
'karma': {},
'deltas': [],
'occurrences': {},
'accumulative': timedelta(),
'packages': defaultdict(int),
+ 'proventesters': set(),
# for tracking number of types of karma
'1': 0,
'0': 0,
'-1': 0,
- None: 0,
}
data = stats[release.name]
@@ -70,7 +77,12 @@ def main():
for comment in update.comments:
- data[str(comment.karma)] += 1 # Track the # of +1's, -1's, and +0's.
+ # Track the # of +1's, -1's, and +0's.
+ if comment.author_name != 'bodhi':
+ data[str(comment.karma)] += 1
+
+ if comment.author_group == 'proventesters':
+ data['proventesters'].add(comment.author_name)
# For figuring out if an update has received feedback or not
if not feedback_done:
@@ -95,6 +107,7 @@ def main():
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:
@@ -109,6 +122,11 @@ def main():
break
if update.critpath:
+ if update.critpath_approved or update.status == 'stable':
+ data['num_critpath_approved'] += 1
+ else:
+ if status in ('testing', 'pending'):
+ data['num_critpath_unapproved'] += 1
data['num_critpath'] += 1
if not feedback_done:
data['critpath_without_karma'].add(update)
@@ -127,29 +145,36 @@ def main():
float(data['num_%s' % type]) / data['num_updates'] * 100)
print " * %d critical path updates (%0.2f%%)" % (data['num_critpath'],
float(data['num_critpath']) / data['num_updates'] * 100)
+ print " * %d approved critical path updates" % (
+ data['num_critpath_approved'])
+ print " * %d unapproved critical path updates" % (
+ data['num_critpath_unapproved'])
print " * %d updates received feedback (%0.2f%%)" % (
data['num_feedback'], (float(data['num_feedback']) /
data['num_updates'] * 100))
print " * %d +0 comments" % data['0']
print " * %d +1 comments" % data['1']
print " * %d -1 comments" % data['-1']
- print " * %d None comments" % data[None]
print " * %d unique authenticated karma submitters" % (
len(data['karma']))
+ print " * %d proventesters" % len(data['proventesters'])
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)
- print " * %d out of %d updates went through testing (%0.2f%%)" % (
- data['num_tested'], data['num_updates'],
- float(data['num_tested']) / data['num_updates'] * 100)
- print " * %d testing updates were pushed *without* karma (%0.2f%%)" %(
+ print " * %d out of %d stable updates went through testing (%0.2f%%)" %(
+ data['num_tested'], data['num_stable'],
+ float(data['num_tested']) / data['num_stable'] * 100)
+ print " * %d went from testing to stable *without* karma (%0.2f%%)" %(
data['num_tested_without_karma'],
float(data['num_tested_without_karma']) /
data['num_tested'] * 100)
+ print " * %d updates were pushed to stable with negative karma (%0.2f%%)" % (
+ data['stable_with_negative_karma'], float(data['stable_with_negative_karma']) / data['num_stable'] * 100)
+ # TODO: pushed with negative karma
print " * %d critical path updates pushed *without* karma" % (
len(data['critpath_without_karma']))
- for update in data['critpath_without_karma']:
- print " * %s submitted by %s" % (update.title, update.submitter)
+ #for update in data['critpath_without_karma']:
+ # print " * %s submitted by %s" % (update.title, update.submitter)
print " * Time spent in testing:"
print " * mean = %d days" % (data['accumulative'].days /
len(data['deltas']))
@@ -158,17 +183,18 @@ def main():
print " * mode = %d days" % (
sorted(data['occurrences'].items(), key=itemgetter(1))[-1][0])
print " * %d packages updated" % (len(data['packages']))
- for package in sorted(data['packages'].items(), key=itemgetter(1), reverse=True):
- print " * %s: %d" % (package[0].name, package[1])
+ #for package in sorted(data['packages'].items(), key=itemgetter(1), reverse=True):
+ # print " * %s: %d" % (package[0].name, package[1])
print
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 30 are:" % (
+ print "Out of %d total unique karma submitters, the top 50 are:" % (
len(karma))
- for submitter in sorted(karma.iteritems(), key=itemgetter(1), reverse=True)[:30]:
+ for submitter in sorted(karma.iteritems(), key=itemgetter(1), reverse=True)[:50]:
print " * %s (%d)" % (submitter[0], submitter[1])
+
if __name__ == '__main__':
main()
commit 74749ac20792205ca90e1e4ada04f904aaf8f26c
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Sep 8 15:49:45 2010 -0400
Some initial tweaks to the CSS of the python-fedora login form
diff --git a/bodhi/static/css/layout.css b/bodhi/static/css/layout.css
index f546154..fdb1e94 100644
--- a/bodhi/static/css/layout.css
+++ b/bodhi/static/css/layout.css
@@ -495,6 +495,43 @@ p.padded {
padding-left: 10px;
}
+/* New python-fedora login form */
+
+label {
+ text-align: right;
+ vertical-align: top;
+ background-color: #f1f1f1;
+ float: left;
+ clear: left;
+ width: 100px;
+ font-weight: bold;
+ padding: 10px 10px 10px 100px;
+}
+
+#user_name {
+ text-align: left;
+ padding-top: 5px;
+ padding-left: 5px;
+ padding: 5px;
+}
+
+#password {
+ text-align: left;
+ padding-top: 5px;
+ padding-left: 5px;
+ padding: 5px;
+}
+
+#login-box form{
+ border-collapse: collapse;
+ border-bottom: 1px solid #bcbcbc;
+ border-top: 1px solid #bcbcbc;
+ width: 100%;
+}
+
+
+
+
/*
td.title {
text-align: right;
diff --git a/bodhi/templates/master.html b/bodhi/templates/master.html
index 6ee26c8..3a55d03 100644
--- a/bodhi/templates/master.html
+++ b/bodhi/templates/master.html
@@ -135,7 +135,7 @@ $(document).ready(function() {
<!-- footer BEGIN -->
<div id="fedora-footer">
Bodhi Version: ${version} -- Server: ${hostname}<br/>
- Copyright © 2007-2008 Red Hat, Inc. and others. All Rights Reserved.<br/>
+ 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> ]
commit 0e7f2bb3bb622916ae1365780cbb08e209e355e8
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Sep 8 15:45:45 2010 -0400
Handle 'rhbz#1234' bug links in the comments
diff --git a/bodhi/model.py b/bodhi/model.py
index 80f7f99..e721782 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -1120,6 +1120,13 @@ class Comment(SQLObject):
elif len(token) == 6 and isint(token):
text.append('<a href="%s">%s</a>' % (
config.get('bz_buglink') + token, token))
+ elif token.startswith('rhbz#'):
+ num = token.split('#')[1]
+ if isint(num):
+ text.append('<a href="%s">%s</a>' % (
+ config.get('bz_buglink') + num, num))
+ else:
+ text.append(token)
else:
text.append(token)
return XML(' '.join(text))
13 years, 8 months
apache/bodhi.wsgi
by Luke Macken
apache/bodhi.wsgi | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit 8f7f66275c3fa103ea2903fd218ad01e4f74e2c4
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Sep 2 14:30:16 2010 -0400
Add some more setuptools magic to our wsgi file to work with multiple version
of CherryPy installed
diff --git a/apache/bodhi.wsgi b/apache/bodhi.wsgi
index e2910dc..61655e0 100644
--- a/apache/bodhi.wsgi
+++ b/apache/bodhi.wsgi
@@ -1,7 +1,10 @@
import sys
sys.stdout = sys.stderr
+
+import __main__
+__main__.__requires__ = __requires__ = 'CherryPy<3.0'
import pkg_resources
-pkg_resources.require("CherryPy<3.0")
+pkg_resources.require(__requires__)
import os
os.environ['PYTHON_EGG_CACHE'] = '/var/www/.python-eggs'
13 years, 8 months