bodhi/controllers.py
by Luke Macken
bodhi/controllers.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 3701e47d155b586e8e7bd3e5979db90e137c2f08
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jun 29 15:42:28 2010 -0400
Fix the logic in our /updates/critpath?untested=True method
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 0ba2a6d..d34739a 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -1310,7 +1310,7 @@ class Root(controllers.RootController):
for release in releases]))):
if update.critpath:
if untested:
- if update.critpath_approved:
+ if not update.critpath_approved:
updates.append(update)
else:
updates.append(update)
13 years, 10 months
bodhi/templates
by Luke Macken
bodhi/templates/critpath.kid | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 7c71874695a6c1c710c2ba7641fae78e9e14355b
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jun 29 15:41:35 2010 -0400
Update the title of our critpath updates table
diff --git a/bodhi/templates/critpath.kid b/bodhi/templates/critpath.kid
index 00296fe..8d1a7d2 100644
--- a/bodhi/templates/critpath.kid
+++ b/bodhi/templates/critpath.kid
@@ -8,7 +8,7 @@
</head>
<body>
- <b>${num_items} Pending Updates</b>
+ <b>${title}</b>
<div class="list">
<span py:for="page in tg.paginate.pages">
<a py:if="page != tg.paginate.current_page"
13 years, 10 months
5 commits - bodhi/controllers.py bodhi.egg-info/PKG-INFO bodhi.egg-info/requires.txt bodhi.egg-info/SOURCES.txt bodhi/model.py bodhi/modifyrepo.py bodhi/release.py bodhi.spec bodhi/templates bodhi/tests bodhi/tools
by Luke Macken
bodhi.egg-info/PKG-INFO | 2 -
bodhi.egg-info/SOURCES.txt | 1
bodhi.egg-info/requires.txt | 3 +-
bodhi.spec | 5 +++
bodhi/controllers.py | 51 +++++++++++++++++++++++++---------------
bodhi/model.py | 45 +++++++++++++++++++----------------
bodhi/modifyrepo.py | 10 +++----
bodhi/release.py | 4 +--
bodhi/templates/show.kid | 36 ++++++----------------------
bodhi/tests/test_controllers.py | 18 +++++++++-----
bodhi/tools/client.py | 8 +++++-
11 files changed, 100 insertions(+), 83 deletions(-)
New commits:
commit 570b250681d4a09a9d132fa094ee5b526bb90048
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jun 29 15:12:12 2010 -0400
Add an --untested argument to the bodhi client to display untested critpath
updates. Also pass in specific releases to the critpath controller as well.
diff --git a/bodhi/tools/client.py b/bodhi/tools/client.py
index fe1d8bf..2b47e3b 100755
--- a/bodhi/tools/client.py
+++ b/bodhi/tools/client.py
@@ -89,6 +89,9 @@ def get_parser():
parser.add_option("", "--critpath", action="store_true",
help="Display a list of pending critical path updates",
dest="critpath")
+ parser.add_option("", "--untested", action="store_true",
+ help="Display a list of untested critical path updates",
+ dest="untested", default=False)
## Details
parser.add_option("-s", "--status", action="store", type="string",
@@ -310,7 +313,10 @@ def main():
elif opts.critpath:
log.info("Getting a list of critical path updates...")
- data = bodhi.send_request('critpath')
+ data = bodhi.send_request('critpath', req_params={
+ 'untested': opts.untested,
+ 'release': opts.release,
+ })
if data['tg_flash']:
log.info(data['tg_flash'])
for update in data['updates']:
commit 1032ac2d04160fd94c0ac7574bf262eeaecd2a9b
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jun 29 15:11:53 2010 -0400
Use the new hashlib module instead of `sha`
diff --git a/bodhi/modifyrepo.py b/bodhi/modifyrepo.py
index e8593ec..5be6400 100644
--- a/bodhi/modifyrepo.py
+++ b/bodhi/modifyrepo.py
@@ -26,9 +26,9 @@
import os
import sys
-import sha
import gzip
+from hashlib import sha1 as sha
from xml.dom import minidom
from bodhi.exceptions import RepositoryNotFound
@@ -98,17 +98,17 @@ class RepoMetadata:
self._insert_element(data, 'location',
attrs={ 'href' : 'repodata/' + mdname })
self._insert_element(data, 'checksum', attrs={ 'type' : 'sha' },
- text=sha.new(newmd).hexdigest())
+ text=sha(newmd).hexdigest())
self._insert_element(data, 'timestamp',
text=str(os.stat(destmd).st_mtime))
self._insert_element(data, 'open-checksum', attrs={ 'type' : 'sha' },
- text=sha.new(md.encode('utf-8')).hexdigest())
+ text=sha(md.encode('utf-8')).hexdigest())
#print " type =", mdtype
#print " location =", 'repodata/' + mdname
- #print " checksum =", sha.new(newmd).hexdigest()
+ #print " checksum =", sha(newmd).hexdigest()
#print " timestamp =", str(os.stat(destmd).st_mtime)
- #print " open-checksum =", sha.new(md).hexdigest()
+ #print " open-checksum =", sha(md).hexdigest()
## Write the updated repomd.xml
outmd = file(self.repomdxml, 'w')
commit d988cd2dd629e6f4b839c8d70612a214a33fc54c
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jun 29 15:09:09 2010 -0400
Improve our critpath controller method.
Give it a 'release' argument, as well as an 'untested' argument to see
what critical path updates need to be tested
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 9e12e95..0ba2a6d 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -1296,16 +1296,25 @@ class Root(controllers.RootController):
return builds
@expose(template='bodhi.templates.critpath', allow_json=True)
+ @validate(validators={'untested': validators.StringBool()})
@paginate('updates', limit=1000, max_limit=1000)
- def critpath(self, *args, **kw):
+ def critpath(self, untested=False, release=None, *args, **kw):
updates = []
- releases = Release.select(Release.q.locked==True)
+ if release:
+ releases = [Release.byName(release)]
+ else:
+ releases = Release.select()
for update in PackageUpdate.select(
AND(PackageUpdate.q.status != 'stable',
OR(*[PackageUpdate.q.releaseID == release.id
for release in releases]))):
if update.critpath:
- updates.append(update)
+ if untested:
+ if update.critpath_approved:
+ updates.append(update)
+ else:
+ updates.append(update)
num_items = len(updates)
return dict(updates=updates, num_items=num_items,
- title='%d Critical Path Updates' % num_items)
+ title='%d %sCritical Path Updates' % (num_items,
+ untested and 'Untested ' or ''))
commit 1656abac9ebee027d848e51a224a5a48e5de6c07
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jun 29 15:09:05 2010 -0400
Prep for 0.7.5 release
diff --git a/bodhi.egg-info/PKG-INFO b/bodhi.egg-info/PKG-INFO
index d0e55cc..e0c55ca 100644
--- a/bodhi.egg-info/PKG-INFO
+++ b/bodhi.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: bodhi
-Version: 0.7.1
+Version: 0.7.5
Summary: Bodhi is a modular web-system that facilitates the process of publishing updates for a Fedora-based software distribution
Home-page: https://fedorahosted.org/bodhi
Author: Luke Macken
diff --git a/bodhi.egg-info/SOURCES.txt b/bodhi.egg-info/SOURCES.txt
index 30292b4..9fcd46b 100644
--- a/bodhi.egg-info/SOURCES.txt
+++ b/bodhi.egg-info/SOURCES.txt
@@ -178,6 +178,7 @@ bodhi/tools/client.py
bodhi/tools/dev_init.py
bodhi/tools/fix_dupe_ids.py
bodhi/tools/init.py
+bodhi/tools/log_stats.py
bodhi/tools/metrics.py
bodhi/tools/pickledb.py
bodhi/tools/rmrelease.py
diff --git a/bodhi.egg-info/requires.txt b/bodhi.egg-info/requires.txt
index 79d655b..053d119 100644
--- a/bodhi.egg-info/requires.txt
+++ b/bodhi.egg-info/requires.txt
@@ -1,3 +1,4 @@
TurboGears >= 1.0
TurboMail
-python_fedora
\ No newline at end of file
+python_fedora
+markdown
\ No newline at end of file
diff --git a/bodhi.spec b/bodhi.spec
index a9eb7c0..9f84ce9 100644
--- a/bodhi.spec
+++ b/bodhi.spec
@@ -2,7 +2,7 @@
%{!?pyver: %define pyver %(%{__python} -c "import sys ; print sys.version[:3]")}
Name: bodhi
-Version: 0.7.4
+Version: 0.7.5
Release: 1%{?dist}
Summary: A modular framework that facilitates publishing software updates
Group: Applications/Internet
@@ -117,6 +117,9 @@ rm -rf bodhi/tests bodhi/tools/test-bodhi.py
%changelog
+* Tue Jun 29 2010 Luke Macken <lmacken(a)redhat.com> - 0.7.5-1
+- 0.7.5 release
+
* Thu Mar 04 2010 Luke Macken <lmacken(a)redhat.com> - 0.7.4-1
- 0.7.4
diff --git a/bodhi/release.py b/bodhi/release.py
index ff270ef..1313e39 100644
--- a/bodhi/release.py
+++ b/bodhi/release.py
@@ -1,9 +1,9 @@
-VERSION = '0.7.4'
+VERSION = '0.7.5'
NAME = 'bodhi'
DESCRIPTION = 'Bodhi is a modular web-system that facilitates the process of publishing updates for a Fedora-based software distribution'
AUTHOR = 'Luke Macken'
EMAIL = 'lmacken(a)redhat.com'
-COPYRIGHT = '2007-2009 Red Hat, Inc.'
+COPYRIGHT = '2007-2010 Red Hat, Inc.'
URL = 'https://fedorahosted.org/bodhi'
DOWNLOAD_URL = 'https://fedorahosted.org/releases/b/o/bodhi/'
LICENSE = 'GPLv2'
commit cc0325c1531c7b3affbe22ce98c55c64a20b91f2
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jun 29 15:02:43 2010 -0400
Enable strict critical path update policy across all releases.
This requires that all critical path updates get 2 admin approvals, along with
one other 1+ from the community. These values are configurable, and this
feature can be completely disabled by setting `critpath.num_admin_approvals =
0` in the bodhi configuration.
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index ac10b22..9e12e95 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -930,20 +930,26 @@ class Root(controllers.RootController):
flash_log(str(e))
raise InvalidUpdateException(params)
- # Politely discourage devs from pushing critpath straight to stable
- if (update.request == 'stable' and update.critpath 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 "
- "stable, which is strongly discouraged. Please "
- "consider pushing to testing first!")
- # Discourage devs from pushing directly to stable for pending releases
- elif update.request == 'stable' and update.release.locked:
- note.append("This update is bypassing testing for an "
- "upcoming release, which is strongly discouraged. "
- "Please ensure that it is properly tested, or "
- "consider pushing it to testing first.")
+ # Disable pushing critpath updates straight to stable
+ # XXX: This block shouldn't be necessary, as the set_request call
+ # above should handle this logic. Keeping it here for another
+ # release to see if this gets hit.
+ if config.get('critpath.num_admin_approvals'):
+ if (update.request == 'stable' and update.critpath and
+ not update.critpath_approved):
+ update.request = 'testing'
+ log.error("Unapproved critpath request is 'stable'. "
+ "This shouldn't happen!")
+ note.append('This critical path update has not '
+ 'yet been approved for pushing to the stable '
+ 'repository. It must first reach a karma '
+ 'of %d, consisting of %d positive karma from '
+ 'proventesters, along with %d additional '
+ 'karma from the community.' % (
+ config.get('critpath.min_karma'),
+ config.get('critpath.num_admin_approvals'),
+ config.get('critpath.min_karma') -
+ config.get('critpath.num_admin_approvals')))
flash_log('. '.join(note))
diff --git a/bodhi/model.py b/bodhi/model.py
index 2f848d9..a63caa4 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -420,20 +420,26 @@ class PackageUpdate(SQLObject):
# [No Frozen Rawhide] Disable pushing critical path updates for
# pending releases directly to stable.
- if action == 'stable' and self.release.locked and self.critpath:
- if not self.critpath_approved:
- if self.status != 'testing':
- action = 'testing'
- log.info('Forcing critical path update into testing')
- notes.append('This critical path update has not '
- 'yet been approved. It must reach a karma '
- 'of %d, consisting of %d positive karma from '
- 'releng/qa, along with %d additional karma from '
- 'the community.' % (
- config.get('critpath.min_karma'),
- config.get('critpath.num_admin_approvals'),
- config.get('critpath.min_karma') -
- config.get('critpath.num_admin_approvals')))
+ if action == 'stable' and self.critpath:
+ if config.get('critpath.num_admin_approvals'):
+ if not self.critpath_approved:
+ notes.append('This critical path update has not '
+ 'yet been approved for pushing to the stable '
+ 'repository. It must first reach a karma '
+ 'of %d, consisting of %d positive karma from '
+ 'proventesters, along with %d additional '
+ 'karma from the community.' % (
+ config.get('critpath.min_karma'),
+ config.get('critpath.num_admin_approvals'),
+ config.get('critpath.min_karma') -
+ config.get('critpath.num_admin_approvals')))
+ if self.status == 'testing':
+ self.request = None
+ flash_log('. '.join(notes))
+ return
+ else:
+ log.info('Forcing critical path update into testing')
+ action = 'testing'
self.request = action
self.pushed = False
@@ -738,11 +744,10 @@ class PackageUpdate(SQLObject):
# If we're a criticalpath update to a pending release that is
# not yet approved, ensure that this karma can't cause it
# to go to stable.
- if (self.critpath and self.release.locked and
- not self.critpath_approved):
+ if self.critpath and not self.critpath_approved:
pass
else:
- if self.status != 'stable':
+ if 'stable' not in (self.status, self.request):
log.info("Automatically marking %s as stable" % self.title)
self.request = 'stable'
self.pushed = False
@@ -757,8 +762,8 @@ class PackageUpdate(SQLObject):
'being unpushed and marked as unstable' % self.karma)
mail.send(self.submitter, 'unstable', self)
- # If we're a Critical Path update for a pending release
- if self.critpath and self.release.locked:
+ # If we're a Critical Path update
+ if self.critpath:
# If we weren't approved before, and now are, push to stable
if not critpath_approved and self.critpath_approved:
self.comment('Critical path update approved', author='bodhi')
@@ -898,7 +903,7 @@ class PackageUpdate(SQLObject):
# Hack, to get this working for F13 w/o changing the DB
if comment.author.endswith(')'):
group = comment.author[:-1].split('(')[-1]
- if group in config.get('admin_groups', 'qa releng').split():
+ if group in config.get('admin_groups').split():
approvals += 1
return approvals
diff --git a/bodhi/templates/show.kid b/bodhi/templates/show.kid
index 19c0c3d..6592e41 100644
--- a/bodhi/templates/show.kid
+++ b/bodhi/templates/show.kid
@@ -77,27 +77,17 @@ karma = "<img src=\"%s\" align=\"top\" /> <b>%d</b>" % (tg.url('/static/images/k
</span>
<span py:if="update.status != 'stable'">
- <span py:if="update.release.locked">
- <span py:if="update.critpath">
- <span py:if="update.critpath_approved">
- <td>
- <a href="${util.url('/request/stable/%s' % update.title)}" class="list">
- <img src="${tg.url('/static/images/submit.png')}" border="0"/>
- Push Critical Path update to Stable
- </a>
- </td>
- </span>
- </span>
- <span py:if="not update.critpath">
+ <span py:if="update.critpath">
+ <span py:if="update.critpath_approved">
<td>
<a href="${util.url('/request/stable/%s' % update.title)}" class="list">
<img src="${tg.url('/static/images/submit.png')}" border="0"/>
- Push to Stable
+ Push Critical Path update to Stable
</a>
</td>
</span>
</span>
- <span py:if="not update.release.locked">
+ <span py:if="not update.critpath">
<td>
<a href="${util.url('/request/stable/%s' % update.title)}" class="list">
<img src="${tg.url('/static/images/submit.png')}" border="0"/>
@@ -129,27 +119,17 @@ karma = "<img src=\"%s\" align=\"top\" /> <b>%d</b>" % (tg.url('/static/images/k
</td>
<span py:if="update.status == 'testing'">
<span py:if="update.request == None">
- <span py:if="update.release.locked">
- <span py:if="update.critpath">
- <span py:if="update.critpath_approved">
- <td>
- <a href="${util.url('/request/stable/%s' % update.title)}" class="list">
- <img src="${tg.url('/static/images/submit.png')}" border="0"/>
- Mark Critical Path update as Stable
- </a>
- </td>
- </span>
- </span>
- <span py:if="not update.critpath">
+ <span py:if="update.critpath">
+ <span py:if="update.critpath_approved">
<td>
<a href="${util.url('/request/stable/%s' % update.title)}" class="list">
<img src="${tg.url('/static/images/submit.png')}" border="0"/>
- Mark as Stable
+ Mark Critical Path update as Stable
</a>
</td>
</span>
</span>
- <span py:if="not update.release.locked">
+ <span py:if="not update.critpath">
<td>
<a href="${util.url('/request/stable/%s' % update.title)}" class="list">
<img src="${tg.url('/static/images/submit.png')}" border="0"/>
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index 1ca20f9..bb068a1 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -1350,7 +1350,11 @@ class TestControllers(testutil.DBTest):
except SQLObjectNotFound:
pass
- def test_push_critpath_to_release(self):
+ def test_push_untested_critpath_to_release(self):
+ """
+ Ensure that we cannot push an untested critpath update directly to
+ stable.
+ """
session = login()
create_release()
params = {
@@ -1366,9 +1370,9 @@ class TestControllers(testutil.DBTest):
testutil.capture_log(["bodhi.util", "bodhi.controllers", "bodhi.model"])
self.save_update(params, session)
log = testutil.get_log()
- assert "Update successfully created. You're pushing a critical path package directly to stable, which is strongly discouraged. Please consider pushing to testing first!" in log, log
+ assert "Forcing critical path update into testing" in log, log
update = PackageUpdate.byTitle(params['builds'])
- assert update.request == 'stable'
+ assert update.request == 'testing'
def test_critpath_actions_in_normal_release(self):
session = login()
@@ -1389,16 +1393,18 @@ class TestControllers(testutil.DBTest):
testutil.create_request('/updates/%s' % params['builds'],
method='GET', headers=session)
- assert "Push to Stable" in cherrypy.response.body[0]
+ assert "Push to Stable" not in cherrypy.response.body[0]
assert "Push to Testing" in cherrypy.response.body[0]
testutil.create_request('/updates/request/stable/%s' % params['builds'],
method='GET', headers=session)
update = PackageUpdate.byTitle(params['builds'])
- # We're allowing devs to still request critpath updates to stable
+ # We're no longer allowing devs to request critpath updates to stable
# without a karma prerequisite for non-pending releases.
- assert update.request == 'stable'
+ # This feature can be disabled by setting
+ #`critpath.num_admin_approvals = 0` in your configuration
+ assert update.request == 'testing'
def test_non_critpath_actions_in_normal_release(self):
session = login()
13 years, 10 months
bodhi/controllers.py
by Luke Macken
bodhi/controllers.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 7058f4e6363b6b36b414dca706e7e74ff00c9a92
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Jun 26 23:09:16 2010 -0400
Gracefully handle private bugs when they are added to existing updates (#442)
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 72d849c..ac10b22 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -899,10 +899,13 @@ class Root(controllers.RootController):
bug = bugzilla.getbug(bug).bug_id
if bug not in original_bugs:
log.debug("Updating newly added bug: %s" % bug)
- Bugzilla.byBz_id(bug).add_comment(update,
- "%s has been submitted as an update for %s.\n%s" %
- (update.title, release.long_name,
- config.get('base_address') + tg_url(update.get_url())))
+ try:
+ Bugzilla.byBz_id(bug).add_comment(update,
+ "%s has been submitted as an update for %s.\n%s" %
+ (update.title, release.long_name,
+ config.get('base_address') + tg_url(update.get_url())))
+ except SQLObjectNotFound:
+ log.debug('Bug #%d not found in our database' % bug)
else:
# Notify security team of newly submitted security updates
if update.type == 'security':
13 years, 10 months
bodhi/controllers.py
by Luke Macken
bodhi/controllers.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 0937f501d8336d3426bd1dae6e7d53a2238d1ef8
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Jun 10 12:23:31 2010 -0400
Look for the start_date/end_date arguments in our list method
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index f2cf08a..72d849c 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -248,7 +248,7 @@ class Root(controllers.RootController):
# If no arguments are specified, return the most recent updates
if not release and not bugs and not cves and not status and not type_ \
and not package and not mine and not username and not created_since \
- and not pushed_since and not request:
+ and not pushed_since and not request and not start_date and not end_date:
log.debug("No arguments, returning latest")
updates = PackageUpdate.select(orderBy=orderBy).reversed()
num_items = updates.count()
13 years, 11 months
3 commits - bodhi/tools
by Luke Macken
bodhi/tools/log_stats.py | 8 ++++++++
bodhi/tools/metrics.py | 33 ++++++++++++++++++++++++++-------
2 files changed, 34 insertions(+), 7 deletions(-)
New commits:
commit 870391744e74058ee858c9ef6cc538f7ef783132
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jun 8 10:30:23 2010 -0400
Track the number of +0's, +1's, and -1's.
diff --git a/bodhi/tools/metrics.py b/bodhi/tools/metrics.py
index 07e684a..57fe2a2 100755
--- a/bodhi/tools/metrics.py
+++ b/bodhi/tools/metrics.py
@@ -41,6 +41,11 @@ def main():
'occurrences': {},
'accumulative': timedelta(),
'packages': defaultdict(int),
+ # for tracking number of types of karma
+ '1': 0,
+ '0': 0,
+ '-1': 0,
+ None: 0,
}
data = stats[release.name]
@@ -64,16 +69,26 @@ def main():
testingtime_done = False
for comment in update.comments:
- if not feedback_done and (not comment.author.startswith('bodhi')
- and comment.karma != 0 and '@' not in comment.author):
- data['num_feedback'] += 1
- feedback += 1
- feedback_done = True
+
+ data[str(comment.karma)] += 1 # Track the # of +1's, -1's, and +0's.
+
+ # For figuring out if an update has received feedback or not
+ if not feedback_done:
+ if (not comment.author.startswith('bodhi')
+ and comment.karma != 0
+ and not comment.anonymous):
+ data['num_feedback'] += 1 # per-release tracking of feedback
+ feedback += 1 # total number of updates that have received feedback
+ feedback_done = True # so we don't run this for each comment
+
+ # Tracking per-author karma & anonymous feedback
if not comment.author.startswith('bodhi'):
- if comment.anonymous or '@' in comment.author:
+ if comment.anonymous:
+ # @@: should we track anon +0 comments as "feedback"?
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
@@ -115,6 +130,10 @@ def main():
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 anonymous users gave feedback (%0.2f%%)" % (
commit 7e1f181e280b7bef6848b95c56a37aa2fc5ec584
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jun 8 10:29:40 2010 -0400
update log_stats.py to show the length of time in testing for updates
that are automatically *unpushed*
diff --git a/bodhi/tools/log_stats.py b/bodhi/tools/log_stats.py
index d8b3109..a2f4fad 100755
--- a/bodhi/tools/log_stats.py
+++ b/bodhi/tools/log_stats.py
@@ -95,6 +95,14 @@ def main():
print " * mode = %d days" % sorted(stable_occur.items(),
key=itemgetter(1))[-1][0]
+ print " * Time spent in testing of updates that were unpushed by karma:"
+ print " * mean = %d days" % (unstable_accum.days / len(unstable_deltas))
+ print " * median = %d days" % unstable_deltas[len(unstable_deltas)/2].days
+ print " * mode = %d days" % sorted(unstable_occur.items(),
+ key=itemgetter(1))[-1][0]
+
+
+
if __name__ == '__main__':
load_config()
commit ef58e8234426624b9b537b22e5bf39f5166710a7
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue May 25 11:44:27 2010 -0400
strip() the username after we remove the admin group
diff --git a/bodhi/tools/metrics.py b/bodhi/tools/metrics.py
index 9968d99..07e684a 100755
--- a/bodhi/tools/metrics.py
+++ b/bodhi/tools/metrics.py
@@ -74,7 +74,7 @@ def main():
if comment.karma != 0:
data['num_anon_feedback'] += 1
else:
- author = comment.author.split('(')[0]
+ author = comment.author.split('(')[0].strip()
if author not in data['karma']:
data['karma'][author] = 0
karma[author] = 0
13 years, 11 months