bodhi-client query issues
by Roberto Sassu
Hi all
i'm using Fedora 12 and i have bodhi-client-0.7.4-1 installed.
I'm trying to execute this query:
bodhi -t bugfix -r F12 --status stable
to obtain the complete list of bugfix updates since release.
The problem is that i cannot disable the limit option and i'm only able
to receive the first 1000 records. Specifying the option -l 5000 doesn't
work for me.
Further i have another issue when executing:
bodhi kdenetwork -r F12
The program displays not only the history of the requested package but it includes
some other packages. I report a small output:
kdeaccessibility-4.4.2-1.fc12 security stable 2010-04-09
kdeadmin-4.4.2-1.fc12
kdeartwork-4.4.2-1.fc12
kdebase-4.4.2-1.fc12
kdebase-runtime-4.4.2-1.fc12
kdebindings-4.4.2-1.fc12
.....
konq-plugins-4.4.0-3.fc12
kdebase-workspace-4.4.2-5.fc12
kdelibs-4.4.2-2.fc12
kde-l10n-4.4.1-2.fc12 bugfix stable 2010-03-09
kdeaccessibility-4.4.1-1.fc12
kdeadmin-4.4.1-1.fc12
kdeartwork-4.4.1-1.fc12
.....
Thanks in advance for replies.
13 years, 6 months
bodhi/templates
by Luke Macken
bodhi/templates/master.kid | 2 +-
bodhi/templates/welcome.kid | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 15edfba566088639f8c4387646b28f2935c8f866
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri May 21 05:38:38 2010 -0400
Force https on our links to bodhi's fedorahosted (#430)
diff --git a/bodhi/templates/master.kid b/bodhi/templates/master.kid
index 930fc9b..5b6c789 100644
--- a/bodhi/templates/master.kid
+++ b/bodhi/templates/master.kid
@@ -142,7 +142,7 @@ $(document).ready(function() {
Copyright © 2007-2010 Red Hat, Inc. and others. All Rights Reserved.<br/>
Licensed under the GNU Public License v2 or later.<br />
The Fedora Project is maintained and driven by the community and sponsored by Red Hat.<br/>This is a community maintained site. Red Hat is not responsible for content.<br/>
- [ <a href="http://fedoraproject.org/wiki/Legal">Legal</a>, <a href="http://fedoraproject.org/wiki/Legal/TrademarkGuidelines">Trademark Guidelines</a>, <a href="http://bodhi.fedorahosted.org">Source Code</a> ]
+ [ <a href="http://fedoraproject.org/wiki/Legal">Legal</a>, <a href="http://fedoraproject.org/wiki/Legal/TrademarkGuidelines">Trademark Guidelines</a>, <a href="https://fedorahosted.org/bodhi">Source Code</a> ]
</div>
<!-- footer END -->
diff --git a/bodhi/templates/welcome.kid b/bodhi/templates/welcome.kid
index 62c602a..474d870 100644
--- a/bodhi/templates/welcome.kid
+++ b/bodhi/templates/welcome.kid
@@ -32,7 +32,7 @@
<tr>
<td>
<span id="bodhitip" title="Bodhi Project Homepage">
- <a href="http://fedorahosted.org/bodhi"><img src="${tg.url('/static/images/bodhi-icon-36.png')}" border="0" height="36" width="36"/></a>
+ <a href="https://fedorahosted.org/bodhi"><img src="${tg.url('/static/images/bodhi-icon-36.png')}" border="0" height="36" width="36"/></a>
</span>
</td>
<td>
13 years, 7 months
Build failed in Hudson: bodhi-py2.4 #74
by Luke Macken
See <http://ci.csh.rit.edu/job/bodhi-py2.4/74/changes>
Changes:
[Luke Macken] Link to submitter page in testing updates list
[Luke Macken] link to submitter and release on home page
[Luke Macken] print query results to stdout instead of stderr
[Luke Macken] Add a unit test to ensure we don't allow updates with
------------------------------------------
Started by an SCM change
Checkout:workspace / <http://ci.csh.rit.edu/job/bodhi-py2.4/ws/> - hudson.remoting.LocalChannel@15bf0c5
Last Built Revision: Revision 0eb028d58b1e9d2ccac509c90f92c4255e01964e (origin/master)
Checkout:workspace / <http://ci.csh.rit.edu/job/bodhi-py2.4/ws/> - hudson.remoting.LocalChannel@15bf0c5
GitAPI created
Env: _=/usr/bin/java
Env: BUILD_ID=2010-07-13_18-01-34
Env: BUILD_NUMBER=74
Env: BUILD_TAG=hudson-bodhi-py2.4-74
Env: BUILD_URL=http://ci.csh.rit.edu/job/bodhi-py2.4/74/
Env: CLASSPATH=
Env: EXECUTOR_NUMBER=0
Env: G_BROKEN_FILENAMES=1
Env: HISTSIZE=1000
Env: HOME=/home/hudson
Env: HOSTNAME=ci
Env: HUDSON_HOME=/home/hudson/.hudson
Env: HUDSON_URL=http://ci.csh.rit.edu/
Env: INPUTRC=/etc/inputrc
Env: JOB_NAME=bodhi-py2.4
Env: JOB_URL=http://ci.csh.rit.edu/job/bodhi-py2.4/
Env: LANG=en_US.UTF-8
Env: LD_LIBRARY_PATH=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/../lib/i386
Env: LESSOPEN=|/usr/bin/lesspipe.sh %s
Env: LOGNAME=hudson
Env: LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
Env: MAIL=/var/spool/mail/hudson
Env: NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat
Env: NODE_NAME=
Env: PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/hudson/bin
Env: PWD=/home/hudson
Env: SHELL=/bin/bash
Env: SHLVL=1
Env: TERM=screen
Env: USER=hudson
Env: WORKSPACE=<http://ci.csh.rit.edu/job/bodhi-py2.4/ws/>
Env: XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt
Fetching changes from the remote Git repository
Fetching upstream changes from git://git.fedorahosted.org/git/bodhi
[workspace] $ git fetch -t git://git.fedorahosted.org/git/bodhi +refs/heads/*:refs/remotes/origin/*
[workspace] $ git ls-tree HEAD
[workspace] $ git tag -l master
[workspace] $ git rev-parse origin/master
Commencing build of Revision 3c6d2b61d714dc158286d70e01b6e1518310613b (origin/master)
GitAPI created
Env: _=/usr/bin/java
Env: BUILD_ID=2010-07-13_18-01-34
Env: BUILD_NUMBER=74
Env: BUILD_TAG=hudson-bodhi-py2.4-74
Env: BUILD_URL=http://ci.csh.rit.edu/job/bodhi-py2.4/74/
Env: CLASSPATH=
Env: EXECUTOR_NUMBER=0
Env: G_BROKEN_FILENAMES=1
Env: HISTSIZE=1000
Env: HOME=/home/hudson
Env: HOSTNAME=ci
Env: HUDSON_HOME=/home/hudson/.hudson
Env: HUDSON_URL=http://ci.csh.rit.edu/
Env: INPUTRC=/etc/inputrc
Env: JOB_NAME=bodhi-py2.4
Env: JOB_URL=http://ci.csh.rit.edu/job/bodhi-py2.4/
Env: LANG=en_US.UTF-8
Env: LD_LIBRARY_PATH=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/../lib/i386
Env: LESSOPEN=|/usr/bin/lesspipe.sh %s
Env: LOGNAME=hudson
Env: LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
Env: MAIL=/var/spool/mail/hudson
Env: NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat
Env: NODE_NAME=
Env: PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/hudson/bin
Env: PWD=/home/hudson
Env: SHELL=/bin/bash
Env: SHLVL=1
Env: TERM=screen
Env: USER=hudson
Env: WORKSPACE=<http://ci.csh.rit.edu/job/bodhi-py2.4/ws/>
Env: XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt
Checking out Revision 3c6d2b61d714dc158286d70e01b6e1518310613b (origin/master)
[workspace] $ git checkout -f 3c6d2b61d714dc158286d70e01b6e1518310613b
[workspace] $ git tag -a -f -m "Hudson Build #74" hudson-bodhi-py2.4-74
Recording changes in branch origin/master
[workspace] $ git log --pretty=format:%H 0eb028d58b1e9d2ccac509c90f92c4255e01964e..3c6d2b61d714dc158286d70e01b6e1518310613b
[workspace] $ git log -M --summary --pretty=raw -n 1 3c6d2b61d714dc158286d70e01b6e1518310613b
[workspace] $ git diff-tree -M -r 3c6d2b61d714dc158286d70e01b6e1518310613b
[workspace] $ git log -M --summary --pretty=raw -n 1 44f5d5a0ab0e6a638ac0b9722d773f388057a8e8
[workspace] $ git diff-tree -M -r 44f5d5a0ab0e6a638ac0b9722d773f388057a8e8
[workspace] $ git log -M --summary --pretty=raw -n 1 902da8129903a0390a8f591e1ab7b3dedf10a776
[workspace] $ git diff-tree -M -r 902da8129903a0390a8f591e1ab7b3dedf10a776
[workspace] $ git log -M --summary --pretty=raw -n 1 0dc7352d1b67d1545a61912ec0c5e6dea365501f
[workspace] $ git diff-tree -M -r 0dc7352d1b67d1545a61912ec0c5e6dea365501f
[workspace] $ /bin/sh -xe /tmp/hudson1717225346754875356.sh
+ python setup.py egg_info
running egg_info
writing requirements to bodhi.egg-info/requires.txt
writing bodhi.egg-info/PKG-INFO
writing top-level names to bodhi.egg-info/top_level.txt
writing dependency_links to bodhi.egg-info/dependency_links.txt
writing entry points to bodhi.egg-info/entry_points.txt
reading manifest file 'bodhi.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files found matching 'start-bodhi'
warning: no files found matching 'ChangeLog'
writing manifest file 'bodhi.egg-info/SOURCES.txt'
+ nosetests
........................................F.........................Exception in thread VisitManager:
Traceback (most recent call last):
File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
self.run()
File "/usr/lib/python2.4/site-packages/turbogears/visit/api.py", line 352, in run
self.update_queued_visits(queue)
File "/usr/lib/python2.4/site-packages/turbogears/visit/sovisit.py", line 86, in update_queued_visits
conn.query(conn.sqlrepr(u))
File "/usr/lib/python2.4/site-packages/sqlobject/dbconnection.py", line 846, in query
return self._dbConnection._query(self._connection, s)
File "/usr/lib/python2.4/site-packages/sqlobject/dbconnection.py", line 349, in _query
self._executeRetry(conn, conn.cursor(), s)
File "/usr/lib/python2.4/site-packages/sqlobject/sqlite/sqliteconnection.py", line 178, in _executeRetry
raise OperationalError(ErrorMessage(e))
OperationalError: no such table: visit
.......................................................
======================================================================
FAIL: Ensure that bodhi disallows submitting an update with two versions
----------------------------------------------------------------------
Traceback (most recent call last):
File "<http://ci.csh.rit.edu/job/bodhi-py2.4/ws/bodhi/tests/test_controllers.py",> line 2241, in test_duplicate_packages
assert "You cannot submit an update containing multiple versions of TurboGears" in log, log
AssertionError: [u'TurboGears-1.0.8-1.fc7,TurboGears-1.0.8-2.fc7 has been submitted for stable. ', 'Update successfully created']
-------------------- >> begin captured stdout << ---------------------
/updates/save?stable_karma=5&builds=TurboGears-1.0.8-1.fc7%2CTurboGears-1.0.8-2.fc7&autokarma=True&suggest_reboot=True¬es=foobar&request=Stable&bugs=&unstable_karma=-5&type_=bugfix&release=Fedora+7
Got record: <LogRecord: bodhi.util, 20, <http://ci.csh.rit.edu/job/bodhi-py2.4/ws/bodhi/util.py,> 204, "TurboGears-1.0.8-1.fc7,TurboGears-1.0.8-2.fc7 has been submitted for stable. ">
formatted as: TurboGears-1.0.8-1.fc7,TurboGears-1.0.8-2.fc7 has been submitted for stable.
Got record: <LogRecord: bodhi.util, 20, <http://ci.csh.rit.edu/job/bodhi-py2.4/ws/bodhi/util.py,> 204, "Update successfully created">
formatted as: Update successfully created
--------------------- >> end captured stdout << ----------------------
----------------------------------------------------------------------
Ran 121 tests in 248.892s
FAILED (failures=1)
13 years, 7 months
3 commits - bodhi/controllers.py bodhi/templates
by Luke Macken
bodhi/controllers.py | 9 ++++++++-
bodhi/templates/show.kid | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
New commits:
commit 0d1803571b4b65e5d18a075152e37ca1b97a2f09
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Jul 22 23:45:58 2010 -0400
Link up the usernames for authenticated comments
diff --git a/bodhi/templates/show.kid b/bodhi/templates/show.kid
index 6592e41..f376b43 100644
--- a/bodhi/templates/show.kid
+++ b/bodhi/templates/show.kid
@@ -246,7 +246,7 @@ karma = "<img src=\"%s\" align=\"top\" /> <b>%d</b>" % (tg.url('/static/images/k
</div>
</div>
<div py:if="not comment.anonymous">
- <b>${comment.author}</b> - ${comment.timestamp}<br/>
+ <b><a href="${tg.url('/user/%s' % comment.author)}">${comment.author}</a></b> - ${comment.timestamp}<br/>
</div>
<div class="comment-text" py:replace="comment.text">Comment</div>
</div>
commit 40d6381611af911dc65c77e4a449da87887507ce
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Jul 22 23:45:27 2010 -0400
Make our list() API handle release names like EL-5 and el5 properly.
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 43516d2..1612bed 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -270,10 +270,11 @@ class Root(controllers.RootController):
try:
rel = Release.byName(release.upper())
except SQLObjectNotFound:
- try:
- rel = Release.byName(release.replace('-', '').upper())
- except SQLObjectNotFound:
- return dict(error="Unknown release %r" % release)
+ # Make names like EL-5 and el5 both find the right release
+ for r in Release.select():
+ if r.name.upper().replace('-', '') == release.replace('-', '').upper():
+ rel = r
+ return dict(error="Unknown release %r" % release)
query.append(PackageUpdate.q.releaseID == rel.id)
if status:
query.append(PackageUpdate.q.status == status)
commit 72fc83efe28158e0ba824bf2379576bdb7efb5ee
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Jul 21 13:18:02 2010 -0400
Return an error message if the specified release doesn't exist.
Also, look for the release again without the '-' just in case.
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 357dc44..43516d2 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -267,7 +267,13 @@ class Root(controllers.RootController):
# another value to the output which indicates if the.
# logged in user is allowed to create a new update for.
# this package
- rel = Release.byName(release.upper())
+ try:
+ rel = Release.byName(release.upper())
+ except SQLObjectNotFound:
+ try:
+ rel = Release.byName(release.replace('-', '').upper())
+ except SQLObjectNotFound:
+ return dict(error="Unknown release %r" % release)
query.append(PackageUpdate.q.releaseID == rel.id)
if status:
query.append(PackageUpdate.q.status == status)
13 years, 9 months
2 commits - bodhi/new.py bodhi/tests
by Luke Macken
bodhi/new.py | 65 +++++++++++++++++++++++++---------------
bodhi/tests/test_controllers.py | 2 -
2 files changed, 43 insertions(+), 24 deletions(-)
New commits:
commit e2e8864dd8dc3a4293135b1c9371b5e3ee8d9278
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Jul 21 02:40:31 2010 -0400
Update a unit test to work with our recent grid tweaks
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index 6c06242..4a86638 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -2026,7 +2026,7 @@ class TestControllers(testutil.DBTest):
assert '100 updates found' in cherrypy.response.body[0], cherrypy.response.body[0]
json = simplejson.loads(cherrypy.response.body[0])
assert json['num_items'] == 100, json['num_items']
- assert len(json['updates']) == 20, len(json['updates'])
+ assert len(json['updates']) == 25, len(json['updates'])
## Try getting all 100
testutil.create_request('/updates/list?tg_format=json&tg_paginate_limit=100',
commit 8c90438f7257af7241d4c89d7017361cf7a9ed0b
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Jul 21 02:33:57 2010 -0400
Have our build auto-completion field query koji for potential candidates.
This fixes tickets #173, #457, and most of #312.
diff --git a/bodhi/new.py b/bodhi/new.py
index a628032..cc47db5 100644
--- a/bodhi/new.py
+++ b/bodhi/new.py
@@ -1,4 +1,3 @@
-# $Id: new.py,v 1.8 2007/01/06 08:03:21 lmacken Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
@@ -16,25 +15,37 @@ import os
import logging
from os.path import join
+from operator import itemgetter
from turbogears import expose, controllers, identity, config, flash
from bodhi.widgets import NewUpdateForm
+from bodhi.buildsys import get_session
+from bodhi.model import Release
from bodhi.util import url
log = logging.getLogger(__name__)
update_form = NewUpdateForm()
-class NewUpdateController(controllers.Controller):
+packages = []
+
+# Load the list of packages from koji
+if config.get('buildsystem') == 'koji':
+ try:
+ koji = get_session()
+ packages = [pkg['package_name'] for pkg in koji.listPackages()]
+ log.debug("%d packages loaded from koji" % len(packages))
+ except Exception, e:
+ log.exception(e)
+ log.error("There was a problem loading the package list from koji")
+else:
+ # Resort to looking on the filesystem for the package names
+ try:
+ packages = os.listdir(config.get('build_dir'))
+ except (OSError, TypeError):
+ log.warning("Warning: build_dir either invalid or not set in app.cfg")
- build_dir = config.get('build_dir')
- packages = []
- def build_pkglist(self):
- """ Cache a list of packages used for the package AutoCompleteField """
- try:
- self.packages = os.listdir(self.build_dir)
- except (OSError, TypeError):
- log.warning("Warning: build_dir either invalid or not set in app.cfg")
+class NewUpdateController(controllers.Controller):
@identity.require(identity.not_anonymous())
@expose(template="bodhi.templates.form")
@@ -42,7 +53,6 @@ class NewUpdateController(controllers.Controller):
notice = config.get('newupdate_notice')
if notice:
flash(notice)
- self.build_pkglist()
return dict(form=update_form, values=kw, action=url("/save"),
title='New Update Form')
@@ -55,21 +65,30 @@ class NewUpdateController(controllers.Controller):
"""
if not name: return dict()
matches = []
- if not self.packages: self.build_pkglist()
- if name[-1] == '-' and name[:-1] and name[:-1] in self.packages:
- name = name[:-1]
- for version in os.listdir(join(self.build_dir, name)):
- for release in os.listdir(join(self.build_dir, name, version)):
- matches.append('-'.join((name, version, release)))
+ pkgname = name[:-1]
+ if name[-1] == '-' and pkgname and pkgname in packages:
+ name = pkgname
+ matches.extend(self._fetch_candidate_builds(pkgname))
else:
- for pkg in self.packages:
+ for pkg in packages:
if name == pkg:
- for version in os.listdir(join(self.build_dir, name)):
- for release in os.listdir(join(self.build_dir, name,
- version)):
- matches.append('-'.join((name, version, release)))
+ matches.extend(self._fetch_candidate_builds(pkg))
break
elif pkg.startswith(name):
matches.append(pkg)
- matches.reverse()
return dict(pkgs=matches)
+
+ def _fetch_candidate_builds(self, pkg):
+ """ Return all candidate builds for a given package """
+ matches = {}
+ koji = get_session()
+ koji.multicall = True
+ for tag in [r.candidate_tag for r in Release.select()]:
+ koji.getLatestBuilds(tag, package=pkg)
+ results = koji.multiCall()
+ for result in results:
+ for entries in result:
+ for entry in entries:
+ matches[entry['nvr']] = entry['completion_time']
+ return [build[0] for build in
+ sorted(matches.items(), key=itemgetter(1), reverse=True)]
13 years, 9 months
bodhi/controllers.py
by Luke Macken
bodhi/controllers.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit 0b1002bfb60896ebc0a21b76f7774290310d36ff
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jul 20 17:13:43 2010 -0400
Show 5 more updates per page, since our menu is already longer than the grid
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 082c90f..357dc44 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -218,7 +218,7 @@ class Root(controllers.RootController):
return updates
@expose(template="bodhi.templates.list", allow_json=True)
- @paginate('updates', limit=20, max_limit=1000)
+ @paginate('updates', limit=25, max_limit=1000)
@validate(validators={
'release': validators.UnicodeString(),
'bugs': validators.UnicodeString(),
@@ -386,7 +386,7 @@ class Root(controllers.RootController):
@expose(template="bodhi.templates.mine", allow_json=True)
@identity.require(identity.not_anonymous())
- @paginate('updates', limit=20, max_limit=20)
+ @paginate('updates', limit=25, max_limit=25)
def mine(self):
""" List all updates submitted by the current user """
updates = PackageUpdate.select(
@@ -996,7 +996,7 @@ class Root(controllers.RootController):
raise redirect('/')
@expose(template='bodhi.templates.list')
- @paginate('updates', limit=20, max_limit=20)
+ @paginate('updates', limit=25, max_limit=25)
def default(self, *args, **kw):
"""
This method allows for the following requests
@@ -1217,7 +1217,7 @@ class Root(controllers.RootController):
raise redirect('/')
@expose(template='bodhi.templates.comments')
- @paginate('comments', limit=20, max_limit=20)
+ @paginate('comments', limit=25, max_limit=25)
def comments(self, user=None):
if user:
data = Comment.select(Comment.q.author == user,
@@ -1305,7 +1305,7 @@ class Root(controllers.RootController):
return dict(updates=updates)
@expose(template="bodhi.templates.user")
- @paginate('updates', limit=25, max_limit=20)
+ @paginate('updates', limit=25, max_limit=25)
def user(self, username):
""" Return a list of updates submitted by a given person """
updates = PackageUpdate.select(PackageUpdate.q.submitter == username,
13 years, 9 months
2 commits - bodhi/model.py bodhi/rss.py
by Luke Macken
bodhi/model.py | 18 ++++++++++++++++++
bodhi/rss.py | 7 +++++--
2 files changed, 23 insertions(+), 2 deletions(-)
New commits:
commit 5e1876f05fc0f2da400d611ba20194880d5c0b69
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jul 20 17:07:44 2010 -0400
Add support for filtering our feeds by package and release (#427)
diff --git a/bodhi/rss.py b/bodhi/rss.py
index d763660..a147aae 100644
--- a/bodhi/rss.py
+++ b/bodhi/rss.py
@@ -43,7 +43,7 @@ class Feed(FeedController):
if comments:
return self.get_latest_comments(user=user)
if package:
- return self.get_package_updates(package)
+ return self.get_package_updates(package, release)
if release:
try:
rel = Release.byName(release.upper())
@@ -141,7 +141,7 @@ class Feed(FeedController):
entries = entries,
)
- def get_package_updates(self, package):
+ def get_package_updates(self, package, release):
entries = []
pkg = Package.byName(package)
base = config.get('base_address')
@@ -151,6 +151,9 @@ class Feed(FeedController):
if len(entries) >= config.get('feeds.max_entries'):
break
+ if release and not update.release.name == release:
+ continue
+
entries.append({
'id' : base + url(update.get_url()),
'summary' : update.notes,
commit 402d0b6257a081bf5e978d15aa4594c8c2b58389
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jul 20 17:07:21 2010 -0400
Add a PackageUpdate.time_in_testing property that returns a timedelta
diff --git a/bodhi/model.py b/bodhi/model.py
index d1334a8..1bdff4b 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -984,6 +984,24 @@ class PackageUpdate(SQLObject):
return self.status != 'obsolete' and 'stable' not in (self.request,
self.status)
+ @property
+ def time_in_testing(self):
+ """ Return the number of days that this update has been in testing """
+ timestamp = None
+ for comment in self.comments:
+ if comment.text == 'This update has been pushed to testing':
+ timestamp = comment.timestamp
+ if self.status == 'testing':
+ return datetime.utcnow() - timestamp
+ else:
+ break
+ if not timestamp:
+ return
+ for comment in self.comments:
+ if comment.text == 'This update has been pushed to stable':
+ return comment.timestamp - timestamp
+ return datetime.utcnow() - timestamp
+
class Comment(SQLObject):
timestamp = DateTimeCol(default=datetime.utcnow)
13 years, 9 months
bodhi/config bodhi/rss.py
by Luke Macken
bodhi/config/app.cfg | 4 ++++
bodhi/rss.py | 31 ++++++++++++++++++++++++-------
2 files changed, 28 insertions(+), 7 deletions(-)
New commits:
commit f8999e34bebaeb25f37bde7c86f78dfcc229b6c1
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Jul 20 16:56:03 2010 -0400
Show the past `feeds.num_days_to_show` worth of updates. If that number is less
than `feeds.max_entries`, then backfill the rest.
This addresses Till's concerns in [ticket:339]
diff --git a/bodhi/config/app.cfg b/bodhi/config/app.cfg
index d85c9d7..419bcb1 100644
--- a/bodhi/config/app.cfg
+++ b/bodhi/config/app.cfg
@@ -173,6 +173,10 @@ critpath.min_karma = 2
# The commented out values below are the defaults
+# The number of days worth of updates/comments to display
+feeds.num_days_to_show = 7
+feeds.max_entries = 20
+
# VIEW
# which view (template engine) to use if one is not specified in the
diff --git a/bodhi/rss.py b/bodhi/rss.py
index fb4849e..d763660 100644
--- a/bodhi/rss.py
+++ b/bodhi/rss.py
@@ -13,6 +13,7 @@
import logging
+from datetime import datetime
from turbogears.feed import FeedController
from turbogears import config, url
from sqlobject import SQLObjectNotFound
@@ -74,9 +75,13 @@ class Feed(FeedController):
query.append(PackageUpdate.q.builds == builds)
title.append("for %s" % builds)
- updates = PackageUpdate.select(AND(*query), orderBy=order).reversed()[:20]
+ updates = PackageUpdate.select(AND(*query), orderBy=order).reversed()
for update in updates:
+ delta = datetime.utcnow() - update.date_submitted
+ if delta and delta.days > config.get('feeds.num_days_to_show'):
+ if len(entries) >= config.get('feeds.max_entries'):
+ break
entries.append({
'id' : config.get('base_address') + url(update.get_url()),
'summary' : update.notes,
@@ -108,11 +113,16 @@ class Feed(FeedController):
entries = []
if user:
comments = Comment.select(Comment.q.author == user,
- orderBy=Comment.q.timestamp).reversed()[:20]
+ orderBy=Comment.q.timestamp).reversed()
else:
comments = Comment.select(Comment.q.author != 'bodhi',
- orderBy=Comment.q.timestamp).reversed()[:20]
+ orderBy=Comment.q.timestamp).reversed()
for comment in comments:
+ delta = datetime.utcnow() - comment.update.date_submitted
+ if delta and delta.days > config.get('feeds.num_days_to_show'):
+ if len(entries) >= config.get('feeds.max_entries'):
+ break
+
entries.append({
'id' : config.get('base_address') + \
url(comment.update.get_url()),
@@ -136,8 +146,11 @@ class Feed(FeedController):
pkg = Package.byName(package)
base = config.get('base_address')
for i, update in enumerate(pkg.updates()):
- if i >= 20:
- break
+ delta = datetime.utcnow() - update.date_submitted
+ if delta and delta.days > config.get('feeds.num_days_to_show'):
+ if len(entries) >= config.get('feeds.max_entries'):
+ break
+
entries.append({
'id' : base + url(update.get_url()),
'summary' : update.notes,
@@ -172,8 +185,12 @@ class Feed(FeedController):
for release in releases]),
*query),
orderBy=PackageUpdate.q.date_submitted).reversed():
- if i >= 20:
- break
+
+ delta = datetime.utcnow() - update.date_submitted
+ if delta and delta.days > config.get('feeds.num_days_to_show'):
+ if len(entries) >= config.get('feeds.max_entries'):
+ break
+
if update.critpath:
if unapproved:
if update.critpath_approved:
13 years, 9 months
2 commits - bodhi/controllers.py bodhi/model.py bodhi/tests
by Luke Macken
bodhi/controllers.py | 37 ++++++++++++++++++++++++-------------
bodhi/model.py | 26 ++++++++++++++++++++++++++
bodhi/tests/test_client.py | 8 +++++---
bodhi/tests/test_controllers.py | 20 +++++++++++---------
4 files changed, 66 insertions(+), 25 deletions(-)
New commits:
commit c517276af64bc1df4b628b63cd28e7bc401e2f1a
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Jul 19 16:05:58 2010 -0400
Add a PackageBuild.get_tags method that fetches the tag names from koji
diff --git a/bodhi/model.py b/bodhi/model.py
index e7c6c58..d1334a8 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -244,6 +244,11 @@ class PackageBuild(SQLObject):
""" Return a the url to details about this build """
return '/' + self.nvr
+ def get_tags(self):
+ """ Return the koji tags for this build """
+ koji = buildsys.get_session()
+ return [tag['name'] for tag in koji.listTags(build=self.nvr)]
+
def __json__(self):
return dict(nvr=self.nvr, package=self.package.__json__())
commit a83245afb74d2ccf23e326d26e82a490eb51951f
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Jul 19 16:05:19 2010 -0400
Obsolete updates when they are deleted, as opposed to destroying them.
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 7635c08..082c90f 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -443,19 +443,30 @@ class Root(controllers.RootController):
flash_log("Cannot delete an update you did not submit")
if request_format() == 'json': return dict()
raise redirect(update.get_url())
- if not update.pushed:
- msg = "Deleted %s" % update.title
- map(lambda x: x.destroySelf(), update.comments)
- for build in update.builds:
- if len(build.updates) == 1:
- build.destroySelf()
- update.untag()
- update.destroySelf()
- flash_log(msg)
- mail.send_admin('deleted', update)
- mail.send(update.people_to_notify(), 'deleted', update)
- else:
- flash_log("Cannot delete a pushed update")
+
+ # We're no longer deleting anything from our database
+ # "Deleting" an update will now obsolete it
+ # In the TG2 port, we should have a seperate state for this
+
+ update.move_to_candidate()
+ update.status = 'obsolete'
+ update.comment("This update has been obsoleted")
+ flash_log('Obsoleted <a href="%s">%s</a>' % (update.get_url(),
+ update.title))
+
+ #if not update.pushed:
+ # msg = "Deleted %s" % update.title
+ # map(lambda x: x.destroySelf(), update.comments)
+ # for build in update.builds:
+ # if len(build.updates) == 1:
+ # build.destroySelf()
+ # update.untag()
+ # update.destroySelf()
+ # flash_log(msg)
+ # mail.send_admin('deleted', update)
+ # mail.send(update.people_to_notify(), 'deleted', update)
+ #else:
+ # flash_log("Cannot delete a pushed update")
except SQLObjectNotFound:
flash_log("Update %s does not exist" % update)
if request_format() == 'json': return dict()
diff --git a/bodhi/model.py b/bodhi/model.py
index 187bec1..e7c6c58 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -812,6 +812,27 @@ class PackageUpdate(SQLObject):
self.status = 'pending'
mail.send_admin('unpushed', self)
+ def move_to_candidate(self):
+ """ Move this update back to the candidate tag """
+ log.info("Moving %s back to %s" % (self.title,
+ self.release.candidate_tag))
+ koji = buildsys.get_session()
+ known_tags = (self.release.candidate_tag, self.release.testing_tag)
+ for build in self.builds:
+ for tag in build.get_tags():
+ if tag in known_tags:
+ try:
+ koji.moveBuild(tag, self.release.candidate_tag,
+ build.nvr, force=True)
+ break
+ except Exception, e:
+ log.exception(e)
+ log.error('There was a problem moving %s' % build.nvr)
+ else:
+ log.warning("Not moving tag: %s" % tag)
+ if self.pushed:
+ self.pushed = False
+
def untag(self):
""" Untag all of the builds in this update """
log.info("Untagging %s" % self.title)
diff --git a/bodhi/tests/test_client.py b/bodhi/tests/test_client.py
index a46f3bf..2213e6b 100644
--- a/bodhi/tests/test_client.py
+++ b/bodhi/tests/test_client.py
@@ -114,11 +114,13 @@ class TestClient(testutil.DBTest):
bodhi = self.__get_bodhi_client()
opts = self.__get_opts()
self.__save_update(self.build, opts, bodhi)
- assert PackageUpdate.byTitle(self.build)
+ up = PackageUpdate.byTitle(self.build)
+ assert up.status == 'pending'
data = bodhi.delete(update=self.build)
try:
- PackageUpdate.byTitle(self.build)
- assert False, "Update not deleted properly"
+ up = PackageUpdate.byTitle(self.build)
+ assert up.status == 'obsolete'
+ #assert False, "Update not deleted properly"
except SQLObjectNotFound:
pass
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index 8151317..6c06242 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -573,18 +573,20 @@ class TestControllers(testutil.DBTest):
headers=session)
try:
update = PackageUpdate.byTitle(params['builds'])
- print update
- assert False, "Update never deleted!"
+ assert update.status == 'obsolete', update.status
+ #print update
+ #assert False, "Update never deleted!"
except SQLObjectNotFound:
pass
- for build in params['builds'].split(','):
- try:
- build = PackageBuild.byNvr(build)
- print build
- assert False, "Build never deleted!"
- except SQLObjectNotFound:
- pass
+ # We're not deleting any builds or updates anymore...
+ #for build in params['builds'].split(','):
+ # try:
+ # build = PackageBuild.byNvr(build)
+ # print build
+ # assert False, "Build never deleted!"
+ # except SQLObjectNotFound:
+ # pass
def test_requests(self):
session = login()
13 years, 9 months
bodhi/templates
by Luke Macken
bodhi/templates/critpath.kid | 9 ---------
bodhi/templates/testing.kid | 2 +-
2 files changed, 1 insertion(+), 10 deletions(-)
New commits:
commit ed434b5c900dcd4b949dd0d4ef17fb002d472573
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Jul 15 14:51:46 2010 -0400
Some critpath link tweakage.
Remove the links to the entire critpath list -- this call is currently
way too expensive.
diff --git a/bodhi/templates/critpath.kid b/bodhi/templates/critpath.kid
index 4a42506..d0d3e87 100644
--- a/bodhi/templates/critpath.kid
+++ b/bodhi/templates/critpath.kid
@@ -9,15 +9,6 @@
<body>
<b>${title}</b> <a href="${tg.url('/rss/rss2.0?critpath=True%s' % (release_name and '&release=%s' % release_name or ''))}"><img src="${tg.url('/static/images/rss.png')}" border="0"/></a>
- <ul>
- <li py:if="release_name"><a href="${tg.url('/critpath?release=' + release_name)}">Show all critical path updates for ${release_name}</a></li>
- <!--
- <li py:if="not release_name"><a href="${tg.url('/critpath')}">Show all critical path updates</a></li>
- <li py:if="unapproved">
- <a href="${tg.url('/critpath')}">Show all critical path updates</a>
- </li>
- -->
- </ul>
<div class="list">
<span py:for="page in tg.paginate.pages">
<a py:if="page != tg.paginate.current_page"
diff --git a/bodhi/templates/testing.kid b/bodhi/templates/testing.kid
index 8363af1..4c00c2a 100644
--- a/bodhi/templates/testing.kid
+++ b/bodhi/templates/testing.kid
@@ -10,7 +10,7 @@
<body>
<b>${title}</b>
<ul>
- <li><a href="${tg.url('/critpath?untested=True&release=' + updates[0].release.name)}">Show unapproved ${updates[0].release.name} Critical Path updates</a> <a href="${tg.url('/rss/rss2.0?critpath=True&release=' + updates[0].release.name)}"><img src="${tg.url('/static/images/rss.png')}" border="0"/></a></li>
+ <li><a href="${tg.url('/critpath?unapproved=True&release=' + updates[0].release.name)}">Show unapproved ${updates[0].release.name} Critical Path updates</a> <a href="${tg.url('/rss/rss2.0?critpath=True&release=' + updates[0].release.name)}"><img src="${tg.url('/static/images/rss.png')}" border="0"/></a></li>
</ul>
<div class="list">
<span py:for="page in tg.paginate.pages">
13 years, 10 months