bodhi/model.py
by Luke Macken
bodhi/model.py | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit 5f45207b8cd944492db463c616dbf6b61f09f7b4
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Aug 12 12:23:41 2010 -0400
Make our Comment.html_text handle None comments
diff --git a/bodhi/model.py b/bodhi/model.py
index a4baaef..739851c 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -1088,6 +1088,8 @@ class Comment(SQLObject):
@property
def html_text(self):
text = []
+ if not self.text:
+ return ''
for token in encode_entity(self.text).split():
if token.startswith('http'):
text.append('<a href="%s">%s</a>' % (token, token))
13 years, 9 months
bodhi/model.py
by Luke Macken
bodhi/model.py | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
New commits:
commit 8a1f00971d1a7fd4c10e6a1f82684e0e970f270d
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 10 17:20:03 2010 -0400
More bugfixing with our new html comment code
diff --git a/bodhi/model.py b/bodhi/model.py
index 453d8b3..a4baaef 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -1087,18 +1087,19 @@ class Comment(SQLObject):
@property
def html_text(self):
- text = encode_entity(self.text)
- for token in text.split():
+ text = []
+ for token in encode_entity(self.text).split():
if token.startswith('http'):
- text = text.replace(token, '<a href="%s">%s</a>' % (
- token, token))
+ text.append('<a href="%s">%s</a>' % (token, token))
elif token.startswith('#') and isint(token[1:]):
- text = text.replace(token, '<a href="%s">%s</a>' % (
+ text.append('<a href="%s">%s</a>' % (
config.get('bz_buglink') + token[1:], token))
elif len(token) == 6 and isint(token):
- text = text.replace(token, '<a href="%s">%s</a>' % (
- config.get('bz_buglink') + token, token))
- return XML(text)
+ text.append('<a href="%s">%s</a>' % (
+ config.get('bz_buglink') + token, token))
+ else:
+ text.append(token)
+ return XML(' '.join(text))
def __str__(self):
karma = '0'
13 years, 9 months
bodhi/model.py
by Luke Macken
bodhi/model.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit ea3f5d17cfe54a3e1dc8808caa81ee5430652f31
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 10 16:40:20 2010 -0400
Don't inject the CSRF token for our stray comment links
diff --git a/bodhi/model.py b/bodhi/model.py
index dfcd395..453d8b3 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -1090,7 +1090,8 @@ class Comment(SQLObject):
text = encode_entity(self.text)
for token in text.split():
if token.startswith('http'):
- text = text.replace(token, link(token, token))
+ text = text.replace(token, '<a href="%s">%s</a>' % (
+ token, token))
elif token.startswith('#') and isint(token[1:]):
text = text.replace(token, '<a href="%s">%s</a>' % (
config.get('bz_buglink') + token[1:], token))
13 years, 9 months
bodhi/model.py
by Luke Macken
bodhi/model.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 1fbda5261acfb82dd455fb2a0d4ba087fb2f3112
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 10 16:35:12 2010 -0400
Link up https URLs as well...
diff --git a/bodhi/model.py b/bodhi/model.py
index d51762a..dfcd395 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -1089,7 +1089,7 @@ class Comment(SQLObject):
def html_text(self):
text = encode_entity(self.text)
for token in text.split():
- if token.startswith('http://'):
+ if token.startswith('http'):
text = text.replace(token, link(token, token))
elif token.startswith('#') and isint(token[1:]):
text = text.replace(token, '<a href="%s">%s</a>' % (
13 years, 9 months
bodhi/model.py
by Luke Macken
bodhi/model.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 3edcf0bf01186c6942201480a4f46452bee67b6d
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 10 16:34:34 2010 -0400
Don't inject csrf tokens into the bugzilla linkage
diff --git a/bodhi/model.py b/bodhi/model.py
index 3c43063..d51762a 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -1092,11 +1092,11 @@ class Comment(SQLObject):
if token.startswith('http://'):
text = text.replace(token, link(token, token))
elif token.startswith('#') and isint(token[1:]):
- text = text.replace(token,
- link(token, config.get('bz_buglink') + token[1:]))
+ text = text.replace(token, '<a href="%s">%s</a>' % (
+ config.get('bz_buglink') + token[1:], token))
elif len(token) == 6 and isint(token):
- text = text.replace(token,
- link(token, config.get('bz_buglink') + token))
+ text = text.replace(token, '<a href="%s">%s</a>' % (
+ config.get('bz_buglink') + token, token))
return XML(text)
def __str__(self):
13 years, 9 months
Branch 'refs/tags/0.7.7' - 17 commits - bodhi/buildsys.py bodhi/config bodhi/controllers.py bodhi/model.py bodhi/static bodhi/templates bodhi/tests bodhi/tools bodhi/util.py docs/bodhi.1
by Luke Macken
Rebased ref, commits from common ancestor:
commit 74678bd0a805fc086a660be151986d1a3233faa5
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 10 16:02:19 2010 -0400
Trivial 80-column tweak
diff --git a/bodhi/model.py b/bodhi/model.py
index bd9f785..3c43063 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -1092,9 +1092,11 @@ class Comment(SQLObject):
if token.startswith('http://'):
text = text.replace(token, link(token, token))
elif token.startswith('#') and isint(token[1:]):
- text = text.replace(token, link(token, config.get('bz_buglink') + token[1:]))
+ text = text.replace(token,
+ link(token, config.get('bz_buglink') + token[1:]))
elif len(token) == 6 and isint(token):
- text = text.replace(token, link(token, config.get('bz_buglink') + token))
+ text = text.replace(token,
+ link(token, config.get('bz_buglink') + token))
return XML(text)
def __str__(self):
commit 464646878f88dd83acbb6e0ef6434798e950670c
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 10 16:00:25 2010 -0400
Improve how we link up bug numbers and URLs in comments
diff --git a/bodhi/model.py b/bodhi/model.py
index ab58618..bd9f785 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -21,6 +21,7 @@ import turbomail
import xmlrpclib
from kid import XML
+from kid.element import encode_entity
from sqlobject import *
from datetime import datetime
@@ -39,7 +40,7 @@ except ImportError:
from bodhi import buildsys, mail
from bodhi.util import get_nvr, rpm_fileheader, header, get_age, get_age_in_days
from bodhi.util import Singleton, authorized_user, flash_log, build_evr, url
-from bodhi.util import link
+from bodhi.util import link, isint
from bodhi.exceptions import RPMNotFound, InvalidRequest
from bodhi.identity.tables import *
@@ -1086,12 +1087,14 @@ class Comment(SQLObject):
@property
def html_text(self):
- text = self.text
+ text = encode_entity(self.text)
for token in text.split():
if token.startswith('http://'):
text = text.replace(token, link(token, token))
- for bug in re.findall(r'bug #*(\d+)', text, re.I):
- text = text.replace(bug, link(bug, config.get('bz_buglink') + bug))
+ elif token.startswith('#') and isint(token[1:]):
+ text = text.replace(token, link(token, config.get('bz_buglink') + token[1:]))
+ elif len(token) == 6 and isint(token):
+ text = text.replace(token, link(token, config.get('bz_buglink') + token))
return XML(text)
def __str__(self):
diff --git a/bodhi/templates/show.kid b/bodhi/templates/show.kid
index cc2e12c..0729ec1 100644
--- a/bodhi/templates/show.kid
+++ b/bodhi/templates/show.kid
@@ -251,7 +251,6 @@ karma = "<img src=\"%s\" align=\"top\" /> <b>%d</b>" % (tg.url('/static/images/k
<b><a href="${tg.url('/user/%s' % comment.author.split(' (')[0])}">${comment.author}</a></b> - ${comment.timestamp}<br/>
</div>
<div class="comment-text" py:replace="comment.html_text">Comment</div>
- <br/><br/>
</div>
</div>
<div py:if="not update.comments">
diff --git a/bodhi/util.py b/bodhi/util.py
index ae70da6..508e3b4 100644
--- a/bodhi/util.py
+++ b/bodhi/util.py
@@ -522,3 +522,11 @@ def url(*args, **kw):
return csrf_url(*args, **kw)
else:
return tg_url(*args, **kw)
+
+
+def isint(num):
+ try:
+ int(num)
+ return True
+ except ValueError:
+ return False
commit fb2a815fdfe44721d3547f3360a5adfc91586ea8
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 10 15:30:23 2010 -0400
Link up bugzilla numbers and URLs in bodhi comments
diff --git a/bodhi/config/app.cfg b/bodhi/config/app.cfg
index e4f9e7a..7498ac0 100644
--- a/bodhi/config/app.cfg
+++ b/bodhi/config/app.cfg
@@ -138,6 +138,8 @@ bz_cookie = None
# Bodhi will avoid touching bugs that are not against the following products
bz_products = 'Fedora,Fedora EPEL'
+bz_buglink = 'https://bugzilla.redhat.com/show_bug.cgi?id='
+
##
## Packages that should suggest a reboot
##
diff --git a/bodhi/model.py b/bodhi/model.py
index 65f8ec3..ab58618 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -20,6 +20,7 @@ import bugzilla
import turbomail
import xmlrpclib
+from kid import XML
from sqlobject import *
from datetime import datetime
@@ -38,6 +39,7 @@ except ImportError:
from bodhi import buildsys, mail
from bodhi.util import get_nvr, rpm_fileheader, header, get_age, get_age_in_days
from bodhi.util import Singleton, authorized_user, flash_log, build_evr, url
+from bodhi.util import link
from bodhi.exceptions import RPMNotFound, InvalidRequest
from bodhi.identity.tables import *
@@ -1082,6 +1084,16 @@ class Comment(SQLObject):
text = UnicodeCol()
anonymous = BoolCol(default=False)
+ @property
+ def html_text(self):
+ text = self.text
+ for token in text.split():
+ if token.startswith('http://'):
+ text = text.replace(token, link(token, token))
+ for bug in re.findall(r'bug #*(\d+)', text, re.I):
+ text = text.replace(bug, link(bug, config.get('bz_buglink') + bug))
+ return XML(text)
+
def __str__(self):
karma = '0'
if self.karma != 0:
diff --git a/bodhi/templates/show.kid b/bodhi/templates/show.kid
index 2470e92..cc2e12c 100644
--- a/bodhi/templates/show.kid
+++ b/bodhi/templates/show.kid
@@ -250,7 +250,8 @@ karma = "<img src=\"%s\" align=\"top\" /> <b>%d</b>" % (tg.url('/static/images/k
<div py:if="not comment.anonymous">
<b><a href="${tg.url('/user/%s' % comment.author.split(' (')[0])}">${comment.author}</a></b> - ${comment.timestamp}<br/>
</div>
- <div class="comment-text" py:replace="comment.text">Comment</div>
+ <div class="comment-text" py:replace="comment.html_text">Comment</div>
+ <br/><br/>
</div>
</div>
<div py:if="not update.comments">
commit b72e177780c6494aea14d96effcc7d3da27e2435
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 10 15:11:00 2010 -0400
Show more update fields by default
diff --git a/bodhi/templates/show.kid b/bodhi/templates/show.kid
index ed49260..2470e92 100644
--- a/bodhi/templates/show.kid
+++ b/bodhi/templates/show.kid
@@ -172,13 +172,20 @@ karma = "<img src=\"%s\" align=\"top\" /> <b>%d</b>" % (tg.url('/static/images/k
<table class="show">
<tr py:for="field in (
- ['Release', XML(release)],
- ['Update ID', update.updateid],
- ['Builds', XML(buildinfo)],
- ['Date Released', update.date_pushed],
- ['Status', update.status],
- ['Submitter', XML(submitter)],
- ['Karma', XML(karma)],)">
+ ['Release', XML(release)],
+ ['Update ID', update.updateid],
+ ['Builds', XML(buildinfo)],
+ ['Status', update.status],
+ ['Requested', update.request],
+ ['Pushed', update.pushed],
+ ['Date Submitted', update.date_submitted],
+ ['Date Released', update.date_pushed],
+ ['Date Modified', update.date_modified],
+ ['Submitter', XML(submitter)],
+ ['Karma', XML(karma)],
+ ['Stable karma', update.builds[0].package.stable_karma],
+ ['Unstable karma', update.builds[0].package.unstable_karma],
+ )">
<div py:if="field[1] != None and field[1] != ''">
<td class="title"><b>${field[0]}:</b></td>
<td class="value">${field[1]}</td>
@@ -187,13 +194,8 @@ karma = "<img src=\"%s\" align=\"top\" /> <b>%d</b>" % (tg.url('/static/images/k
<div py:if="not tg.identity.anonymous and
util.authorized_user(update, identity)">
<tr py:for="title, value in (
- ['Stable karma', update.builds[0].package.stable_karma],
- ['Unstable karma', update.builds[0].package.unstable_karma],
- ['Requested', update.request],
- ['Pushed', update.pushed],
- ['Modified', update.date_modified],
['Close bugs', update.close_bugs],
- ['Date Submitted', update.date_submitted])">
+ )">
<div py:if="value and value != ''">
<td class="title"><b>${title}:</b></td>
<td class="value">${value}</td>
commit b631791a4360c509bf11f90a6175420eb6a80322
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 10 14:59:47 2010 -0400
Document the `newpackage` update type (#621828)
diff --git a/bodhi/tools/client.py b/bodhi/tools/client.py
index 61c45e3..8f8b490 100755
--- a/bodhi/tools/client.py
+++ b/bodhi/tools/client.py
@@ -108,7 +108,7 @@ def get_parser():
parser.add_option("-N", "--notes", action="store", type="string",
dest="notes", help="Update notes", default="")
parser.add_option("-t", "--type", action="store", type="string",
- help="Update type [bugfix|security|enhancement]",
+ help="Update type [bugfix|security|enhancement|newpackage]",
dest="type_", metavar="TYPE")
parser.add_option("-u", "--username", action="store", type="string",
dest="username", default=getuser(),
diff --git a/docs/bodhi.1 b/docs/bodhi.1
index e28fc58..0947350 100644
--- a/docs/bodhi.1
+++ b/docs/bodhi.1
@@ -22,7 +22,7 @@ Specify a release [F7|F8]
.IP "\fB\-N --notes\fP NOTES"
Update notes
.IP "\fB\-t --type\fP TYPE"
-Update type [bugfix|security|enhancement]
+Update type [bugfix|security|enhancement|newpackage]
.IP "\fB\-u --username\fP USERNAME"
Login username for bodhi
.IP "\fB\-d --delete\fP"
commit b2c8ab24f9813920cf74e0fb1faba3bd5456e8cd
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 10 14:59:37 2010 -0400
Only set bugs to ON_QA if they aren't already ON_QA
diff --git a/bodhi/model.py b/bodhi/model.py
index ae30713..65f8ec3 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -1226,7 +1226,8 @@ class Bugzilla(SQLObject):
if bug.product not in config.get('bz_products', '').split(','):
log.warning("Skipping %r bug" % bug.product)
return
- bug.setstatus('ON_QA', comment=comment)
+ if bug.bug_status != 'ON_QA':
+ bug.setstatus('ON_QA', comment=comment)
except Exception, e:
log.error("Unable to alter bug #%d\n%s" % (self.bz_id, str(e)))
else:
commit c9fa5b3b9bb9481404d0760041b133de71d43727
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 10 14:55:17 2010 -0400
Set bugs to MODIFIED upon submission (#343)
diff --git a/bodhi/model.py b/bodhi/model.py
index 04a2dcb..ae30713 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -688,6 +688,7 @@ class PackageUpdate(SQLObject):
newbug = bugzilla.getbug(bug)
bz = Bugzilla(bz_id=newbug.bug_id)
bz.fetch_details(newbug)
+ bz.modified()
else:
bz = Bugzilla(bz_id=int(bug))
if bz not in self.bugs:
@@ -1197,6 +1198,20 @@ class Bugzilla(SQLObject):
log.error("Unable to add comment to bug #%d\n%s" % (self.bz_id,
str(e)))
+ def modified(self):
+ """ Change the status of this bug to MODIFIED """
+ bz = Bugzilla.get_bz()
+ log.debug("Setting Bug #%d to MODIFIED" % self.bz_id)
+ try:
+ bug = bz.getbug(self.bz_id)
+ if bug.product not in config.get('bz_products', '').split(','):
+ log.warning("Skipping %r bug" % bug.product)
+ return
+ if bug.bug_status != 'MODIFIED':
+ bug.setstatus('MODIFIED')
+ except Exception, e:
+ log.error("Unable to alter bug #%d\n%s" % (self.bz_id, str(e)))
+
def testing(self, update):
"""
Change the status of this bug to ON_QA, and comment on the bug with
commit 3cf00f878eb4235bccfb45333fee11c2c85225b5
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Aug 9 18:34:59 2010 -0400
Get our metadata tests working again, since they broke when I removed the F7 mash configs :(
diff --git a/bodhi/buildsys.py b/bodhi/buildsys.py
index 28dcea8..176e169 100644
--- a/bodhi/buildsys.py
+++ b/bodhi/buildsys.py
@@ -171,16 +171,6 @@ class DevBuildsys(Buildsystem):
'name': 'dist-f8-updates-testing', 'perm': None, 'perm_id': None}]
def listTagged(self, tag, *args, **kw):
- if tag not in ('dist-rawhide', 'dist-fc7', 'dist-fc7-updates-candidate',
- 'dist-fc7-updates-testing', 'dist-fc7-updates',
- 'dist-f8', 'dist-f8-updates', 'dist-f8-updates-testing',
- 'dist-fc8', 'dist-fc8-updates',
- 'dist-fc8-updates-testing', 'dist-f8-updates-candidate',
- 'dist-f9', 'dist-f9-updates', 'dist-f9-updates-testing',
- 'dist-f9-updates-candidate',
- 'dist-5E-epel-testing-candidate', 'dist-5E-epel',
- 'dist-5E-epel-testing'):
- raise koji.GenericError
return [self.getBuild(),]
def getLatestBuilds(self, *args, **kw):
diff --git a/bodhi/tests/test_metadata.py b/bodhi/tests/test_metadata.py
index c0db24d..82ae232 100644
--- a/bodhi/tests/test_metadata.py
+++ b/bodhi/tests/test_metadata.py
@@ -22,11 +22,11 @@ class TestExtendedMetadata(testutil.DBTest):
def test_extended_metadata(self):
# grab the name of a build in updates-testing, and create it in our db
koji = get_session()
- builds = koji.listTagged('dist-fc7-updates-testing', latest=True)
+ builds = koji.listTagged('dist-f13-updates-testing', latest=True)
# Create all of the necessary database entries
- release = Release(name='fc7', long_name='Fedora 7', id_prefix='FEDORA',
- dist_tag='dist-fc7')
+ release = Release(name='F13', long_name='Fedora 13',
+ id_prefix='FEDORA', dist_tag='dist-f13')
package = Package(name=builds[0]['package_name'])
update = PackageUpdate(title=builds[0]['nvr'],
release=release,
@@ -45,7 +45,7 @@ class TestExtendedMetadata(testutil.DBTest):
print update
## Initialize our temporary repo
- temprepo = join(tempfile.mkdtemp('bodhi'), 'f7-updates-testing')
+ temprepo = join(tempfile.mkdtemp('bodhi'), 'f13-updates-testing')
print "Inserting updateinfo into temprepo: %s" % temprepo
mkmetadatadir(join(temprepo, 'i386'))
repodata = join(temprepo, 'i386', 'repodata')
@@ -62,7 +62,7 @@ class TestExtendedMetadata(testutil.DBTest):
## Read an verify the updateinfo.xml.gz
uinfo = UpdateMetadata()
uinfo.add(updateinfo)
- notice = uinfo.get_notice(('mutt', '1.5.14', '1.fc7'))
+ notice = uinfo.get_notice(('mutt', '1.5.14', '1.fc13'))
assert not notice
notice = uinfo.get_notice(get_nvr(update.title))
assert notice
@@ -95,11 +95,11 @@ class TestExtendedMetadata(testutil.DBTest):
def test_extended_metadata_updating(self):
# grab the name of a build in updates-testing, and create it in our db
koji = get_session()
- builds = koji.listTagged('dist-fc7-updates-testing', latest=True)
+ builds = koji.listTagged('dist-f13-updates-testing', latest=True)
# Create all of the necessary database entries
- release = Release(name='fc7', long_name='Fedora 7', id_prefix='FEDORA',
- dist_tag='dist-fc7')
+ release = Release(name='F13', long_name='Fedora 13', id_prefix='FEDORA',
+ dist_tag='dist-f13')
package = Package(name=builds[0]['package_name'])
update = PackageUpdate(title=builds[0]['nvr'],
release=release,
@@ -135,7 +135,7 @@ class TestExtendedMetadata(testutil.DBTest):
## Read an verify the updateinfo.xml.gz
uinfo = UpdateMetadata()
uinfo.add(updateinfo)
- notice = uinfo.get_notice(('mutt', '1.5.14', '1.fc7'))
+ notice = uinfo.get_notice(('mutt', '1.5.14', '1.fc13'))
assert not notice
notice = uinfo.get_notice(get_nvr(update.title))
assert notice
@@ -171,7 +171,7 @@ class TestExtendedMetadata(testutil.DBTest):
## Read an verify the updateinfo.xml.gz
uinfo = UpdateMetadata()
uinfo.add(updateinfo)
- notice = uinfo.get_notice(('mutt', '1.5.14', '1.fc7'))
+ notice = uinfo.get_notice(('mutt', '1.5.14', '1.fc13'))
assert not notice
notice = uinfo.get_notice(get_nvr(update.title))
assert notice
commit 0658abcd923d542bb6860375b26329cdb3fd41ea
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Aug 9 14:34:45 2010 -0400
Add a `bodhi --push-request={stable,testing}` command-line option
diff --git a/bodhi/tools/client.py b/bodhi/tools/client.py
index a56c370..61c45e3 100755
--- a/bodhi/tools/client.py
+++ b/bodhi/tools/client.py
@@ -59,6 +59,9 @@ def get_parser():
parser.add_option("--push-release", action="append", type="string",
dest="push_release",
help="Types of updates to push (releng only)")
+ parser.add_option("--push-request", action="append", type="string",
+ dest="push_request",
+ help="Requests of updates to push (stable or testing) (releng only)")
parser.add_option("--push-build", action="append", type="string",
dest="push_build", help="Push a specific builds (releng only)")
parser.add_option("--resume-push", action="store_true", dest="resume_push",
@@ -228,6 +231,13 @@ def main():
fupdates += fdata
data['updates'] = fupdates
+ if opts.push_request:
+ fupdates = []
+ for req in opts.push_request:
+ fdata = filter(lambda x: x['request'] == req,
+ data['updates'])
+ fupdates += fdata
+ data['updates'] = fupdates
if opts.push_release:
fupdates = []
for prel in opts.push_release:
commit b678a98a7c16050690d8ddd40df8e60a1c00ef8a
Author: Luke Macken <lmacken(a)redhat.com>
Date: Mon Aug 9 14:34:34 2010 -0400
Add a new /updates/releases JSON API
diff --git a/bodhi/controllers.py b/bodhi/controllers.py
index 1612bed..2b2f2ce 100644
--- a/bodhi/controllers.py
+++ b/bodhi/controllers.py
@@ -1374,3 +1374,7 @@ class Root(controllers.RootController):
'Unapproved ' or ''),
unapproved=unapproved or untested,
release_name=release_name)
+
+ @expose(allow_json=True)
+ def releases(self):
+ return dict(releases=[release.__json__() for release in Release.select()])
commit 7cfdc9297bf80fc0a9b65078da0ff0ed75afdd48
Merge: 91a0bdc... c51d5ef...
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 3 17:52:34 2010 -0400
Merge branch 'master' of git+ssh://git.fedorahosted.org/git/bodhi
commit 91a0bdc6a785875f671117709fe118fafba06b62
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 3 17:52:14 2010 -0400
Add links to the Bodhi and Proven Tester Guides on the front page
diff --git a/bodhi/static/images/hardhat.png b/bodhi/static/images/hardhat.png
new file mode 100644
index 0000000..39eff75
Binary files /dev/null and b/bodhi/static/images/hardhat.png differ
diff --git a/bodhi/static/images/info.png b/bodhi/static/images/info.png
new file mode 100644
index 0000000..751bd15
Binary files /dev/null and b/bodhi/static/images/info.png differ
diff --git a/bodhi/templates/welcome.kid b/bodhi/templates/welcome.kid
index 474d870..0ebed19 100644
--- a/bodhi/templates/welcome.kid
+++ b/bodhi/templates/welcome.kid
@@ -13,6 +13,8 @@
<script language="javascript">
$(document).ready(function(){
+ $('#testingtip').Tooltip( { delay: 0, track: true, opacity: 0.85, } );
+ $('#wikitip').Tooltip( { delay: 0, track: true, opacity: 0.85, } );
$('#bodhitip').Tooltip( { delay: 0, track: true, opacity: 0.85, } );
$('#wftip').Tooltip( { delay: 0, track: true, opacity: 0.85, } );
$('#clitip').Tooltip( { delay: 0, track: true, opacity: 0.85, } );
@@ -31,8 +33,13 @@
<table>
<tr>
<td>
- <span id="bodhitip" title="Bodhi Project Homepage">
- <a href="https://fedorahosted.org/bodhi"><img src="${tg.url('/static/images/bodhi-icon-36.png')}" border="0" height="36" width="36"/></a>
+ <span id="wikitip" title="Bodhi Guide">
+ <a href="https://fedoraproject.org/wiki/Bodhi"><img src="${tg.url('/static/images/info.png')}" border="0" height="36" width="36"/></a>
+ </span>
+ </td>
+ <td>
+ <span id="testingtip" title="Proven Testers Guide">
+ <a href="https://fedoraproject.org/wiki/Proventester"><img src="${tg.url('/static/images/hardhat.png')}" border="0" height="36" width="36"/></a>
</span>
</td>
<td>
@@ -52,6 +59,11 @@
</span>
</td>
<td>
+ <span id="bodhitip" title="Bodhi Project Homepage">
+ <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>
<span id="kojitip" title="Koji Buildsystem">
<a href="http://koji.fedoraproject.org/koji/" class="list"><font size="6">麹</font></a>
</span>
commit c51d5efc1b426bd96092c98ce9f3b1a19a8f5c05
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 3 17:29:17 2010 -0400
Fix a minor bug with the previous commit
diff --git a/bodhi/templates/show.kid b/bodhi/templates/show.kid
index dfc2d15..ed49260 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><a href="${tg.url('/user/%s' % comment.author.split('(')[0])}">${comment.author}</a></b> - ${comment.timestamp}<br/>
+ <b><a href="${tg.url('/user/%s' % comment.author.split(' (')[0])}">${comment.author}</a></b> - ${comment.timestamp}<br/>
</div>
<div class="comment-text" py:replace="comment.text">Comment</div>
</div>
commit 7c23c600bfe6eb546862c8319b4cb5c4e38f3966
Merge: a1c80d1... f15c6c4...
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 3 16:25:07 2010 -0400
Merge branch 'master' of git+ssh://git.fedorahosted.org/git/bodhi
commit a1c80d12b8834e8160f9cc0bd472779dce69b0bb
Merge: fb4f9d3... 4710963...
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 3 16:24:18 2010 -0400
Merge branch 'master' of git+ssh://git.fedorahosted.org/git/bodhi
commit fb4f9d31148ad2f8d234c0ce0d159a9b2c9ce332
Merge: f06b8a0... 0d18035...
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Jul 30 13:35:03 2010 -0400
Merge branch 'master' of git+ssh://git.fedorahosted.org/git/bodhi
commit f06b8a07fe19ef67fd922ee4432c8ff43b10df12
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Jul 15 15:45:26 2010 -0400
Revert "Calling bodhi.util.load_config in our client breaks the logger (#303)"
This reverts commit 3676bc978f6b30c1c29bf63f33c6a928e172c620.
Now that we are print()ing our client output, this should no longer cause
problems. Plus, we need this code on our masher servers so the bodhi-client
knows to send requests to 'localhost'
diff --git a/bodhi/tools/client.py b/bodhi/tools/client.py
index fb058b2..a56c370 100755
--- a/bodhi/tools/client.py
+++ b/bodhi/tools/client.py
@@ -29,7 +29,13 @@ from optparse import OptionParser
from fedora.client import AuthError, ServerError
from fedora.client.bodhi import BodhiClient
-BODHI_URL = 'https://admin.fedoraproject.org/updates/'
+try:
+ from turbogears import config
+ from bodhi.util import load_config
+ load_config()
+ BODHI_URL = config.get('bodhi_url', 'https://admin.fedoraproject.org/updates/')
+except:
+ BODHI_URL = 'https://admin.fedoraproject.org/updates/'
log = logging.getLogger(__name__)
13 years, 9 months
bodhi/model.py
by Luke Macken
bodhi/model.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 74678bd0a805fc086a660be151986d1a3233faa5
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 10 16:02:19 2010 -0400
Trivial 80-column tweak
diff --git a/bodhi/model.py b/bodhi/model.py
index bd9f785..3c43063 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -1092,9 +1092,11 @@ class Comment(SQLObject):
if token.startswith('http://'):
text = text.replace(token, link(token, token))
elif token.startswith('#') and isint(token[1:]):
- text = text.replace(token, link(token, config.get('bz_buglink') + token[1:]))
+ text = text.replace(token,
+ link(token, config.get('bz_buglink') + token[1:]))
elif len(token) == 6 and isint(token):
- text = text.replace(token, link(token, config.get('bz_buglink') + token))
+ text = text.replace(token,
+ link(token, config.get('bz_buglink') + token))
return XML(text)
def __str__(self):
13 years, 9 months
bodhi/model.py bodhi/templates bodhi/util.py
by Luke Macken
bodhi/model.py | 11 +++++++----
bodhi/templates/show.kid | 1 -
bodhi/util.py | 8 ++++++++
3 files changed, 15 insertions(+), 5 deletions(-)
New commits:
commit 464646878f88dd83acbb6e0ef6434798e950670c
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 10 16:00:25 2010 -0400
Improve how we link up bug numbers and URLs in comments
diff --git a/bodhi/model.py b/bodhi/model.py
index ab58618..bd9f785 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -21,6 +21,7 @@ import turbomail
import xmlrpclib
from kid import XML
+from kid.element import encode_entity
from sqlobject import *
from datetime import datetime
@@ -39,7 +40,7 @@ except ImportError:
from bodhi import buildsys, mail
from bodhi.util import get_nvr, rpm_fileheader, header, get_age, get_age_in_days
from bodhi.util import Singleton, authorized_user, flash_log, build_evr, url
-from bodhi.util import link
+from bodhi.util import link, isint
from bodhi.exceptions import RPMNotFound, InvalidRequest
from bodhi.identity.tables import *
@@ -1086,12 +1087,14 @@ class Comment(SQLObject):
@property
def html_text(self):
- text = self.text
+ text = encode_entity(self.text)
for token in text.split():
if token.startswith('http://'):
text = text.replace(token, link(token, token))
- for bug in re.findall(r'bug #*(\d+)', text, re.I):
- text = text.replace(bug, link(bug, config.get('bz_buglink') + bug))
+ elif token.startswith('#') and isint(token[1:]):
+ text = text.replace(token, link(token, config.get('bz_buglink') + token[1:]))
+ elif len(token) == 6 and isint(token):
+ text = text.replace(token, link(token, config.get('bz_buglink') + token))
return XML(text)
def __str__(self):
diff --git a/bodhi/templates/show.kid b/bodhi/templates/show.kid
index cc2e12c..0729ec1 100644
--- a/bodhi/templates/show.kid
+++ b/bodhi/templates/show.kid
@@ -251,7 +251,6 @@ karma = "<img src=\"%s\" align=\"top\" /> <b>%d</b>" % (tg.url('/static/images/k
<b><a href="${tg.url('/user/%s' % comment.author.split(' (')[0])}">${comment.author}</a></b> - ${comment.timestamp}<br/>
</div>
<div class="comment-text" py:replace="comment.html_text">Comment</div>
- <br/><br/>
</div>
</div>
<div py:if="not update.comments">
diff --git a/bodhi/util.py b/bodhi/util.py
index ae70da6..508e3b4 100644
--- a/bodhi/util.py
+++ b/bodhi/util.py
@@ -522,3 +522,11 @@ def url(*args, **kw):
return csrf_url(*args, **kw)
else:
return tg_url(*args, **kw)
+
+
+def isint(num):
+ try:
+ int(num)
+ return True
+ except ValueError:
+ return False
13 years, 9 months
bodhi/config bodhi/model.py bodhi/templates
by Luke Macken
bodhi/config/app.cfg | 2 ++
bodhi/model.py | 12 ++++++++++++
bodhi/templates/show.kid | 3 ++-
3 files changed, 16 insertions(+), 1 deletion(-)
New commits:
commit fb2a815fdfe44721d3547f3360a5adfc91586ea8
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 10 15:30:23 2010 -0400
Link up bugzilla numbers and URLs in bodhi comments
diff --git a/bodhi/config/app.cfg b/bodhi/config/app.cfg
index e4f9e7a..7498ac0 100644
--- a/bodhi/config/app.cfg
+++ b/bodhi/config/app.cfg
@@ -138,6 +138,8 @@ bz_cookie = None
# Bodhi will avoid touching bugs that are not against the following products
bz_products = 'Fedora,Fedora EPEL'
+bz_buglink = 'https://bugzilla.redhat.com/show_bug.cgi?id='
+
##
## Packages that should suggest a reboot
##
diff --git a/bodhi/model.py b/bodhi/model.py
index 65f8ec3..ab58618 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -20,6 +20,7 @@ import bugzilla
import turbomail
import xmlrpclib
+from kid import XML
from sqlobject import *
from datetime import datetime
@@ -38,6 +39,7 @@ except ImportError:
from bodhi import buildsys, mail
from bodhi.util import get_nvr, rpm_fileheader, header, get_age, get_age_in_days
from bodhi.util import Singleton, authorized_user, flash_log, build_evr, url
+from bodhi.util import link
from bodhi.exceptions import RPMNotFound, InvalidRequest
from bodhi.identity.tables import *
@@ -1082,6 +1084,16 @@ class Comment(SQLObject):
text = UnicodeCol()
anonymous = BoolCol(default=False)
+ @property
+ def html_text(self):
+ text = self.text
+ for token in text.split():
+ if token.startswith('http://'):
+ text = text.replace(token, link(token, token))
+ for bug in re.findall(r'bug #*(\d+)', text, re.I):
+ text = text.replace(bug, link(bug, config.get('bz_buglink') + bug))
+ return XML(text)
+
def __str__(self):
karma = '0'
if self.karma != 0:
diff --git a/bodhi/templates/show.kid b/bodhi/templates/show.kid
index 2470e92..cc2e12c 100644
--- a/bodhi/templates/show.kid
+++ b/bodhi/templates/show.kid
@@ -250,7 +250,8 @@ karma = "<img src=\"%s\" align=\"top\" /> <b>%d</b>" % (tg.url('/static/images/k
<div py:if="not comment.anonymous">
<b><a href="${tg.url('/user/%s' % comment.author.split(' (')[0])}">${comment.author}</a></b> - ${comment.timestamp}<br/>
</div>
- <div class="comment-text" py:replace="comment.text">Comment</div>
+ <div class="comment-text" py:replace="comment.html_text">Comment</div>
+ <br/><br/>
</div>
</div>
<div py:if="not update.comments">
13 years, 9 months
bodhi/templates
by Luke Macken
bodhi/templates/show.kid | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
New commits:
commit b72e177780c6494aea14d96effcc7d3da27e2435
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 10 15:11:00 2010 -0400
Show more update fields by default
diff --git a/bodhi/templates/show.kid b/bodhi/templates/show.kid
index ed49260..2470e92 100644
--- a/bodhi/templates/show.kid
+++ b/bodhi/templates/show.kid
@@ -172,13 +172,20 @@ karma = "<img src=\"%s\" align=\"top\" /> <b>%d</b>" % (tg.url('/static/images/k
<table class="show">
<tr py:for="field in (
- ['Release', XML(release)],
- ['Update ID', update.updateid],
- ['Builds', XML(buildinfo)],
- ['Date Released', update.date_pushed],
- ['Status', update.status],
- ['Submitter', XML(submitter)],
- ['Karma', XML(karma)],)">
+ ['Release', XML(release)],
+ ['Update ID', update.updateid],
+ ['Builds', XML(buildinfo)],
+ ['Status', update.status],
+ ['Requested', update.request],
+ ['Pushed', update.pushed],
+ ['Date Submitted', update.date_submitted],
+ ['Date Released', update.date_pushed],
+ ['Date Modified', update.date_modified],
+ ['Submitter', XML(submitter)],
+ ['Karma', XML(karma)],
+ ['Stable karma', update.builds[0].package.stable_karma],
+ ['Unstable karma', update.builds[0].package.unstable_karma],
+ )">
<div py:if="field[1] != None and field[1] != ''">
<td class="title"><b>${field[0]}:</b></td>
<td class="value">${field[1]}</td>
@@ -187,13 +194,8 @@ karma = "<img src=\"%s\" align=\"top\" /> <b>%d</b>" % (tg.url('/static/images/k
<div py:if="not tg.identity.anonymous and
util.authorized_user(update, identity)">
<tr py:for="title, value in (
- ['Stable karma', update.builds[0].package.stable_karma],
- ['Unstable karma', update.builds[0].package.unstable_karma],
- ['Requested', update.request],
- ['Pushed', update.pushed],
- ['Modified', update.date_modified],
['Close bugs', update.close_bugs],
- ['Date Submitted', update.date_submitted])">
+ )">
<div py:if="value and value != ''">
<td class="title"><b>${title}:</b></td>
<td class="value">${value}</td>
13 years, 9 months