bodhi/tools
by Luke Macken
bodhi/tools/tagcheck.py | 46 ++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 44 insertions(+), 2 deletions(-)
New commits:
commit 62b73d99adb297d8556331a50cb386c07b2eb372
Author: Luke Macken <lmacken(a)redhat.com>
Date: Fri Feb 13 02:34:31 2009 -0500
Add a --fix flag to the bodhi-tagcheck script
diff --git a/bodhi/tools/tagcheck.py b/bodhi/tools/tagcheck.py
index e0f05f3..3794f78 100755
--- a/bodhi/tools/tagcheck.py
+++ b/bodhi/tools/tagcheck.py
@@ -5,25 +5,32 @@ Verify that all builds that are tagged as updates in koji have the
correct status within bodhi
"""
+import sys
+
from sqlobject import SQLObjectNotFound
from turbogears.database import PackageHub
from bodhi.util import load_config
from bodhi.model import PackageBuild, PackageUpdate, Release
-from bodhi.buildsys import get_session
+from bodhi.buildsys import get_session, wait_for_tasks
def main():
load_config()
__connection__ = hub = PackageHub("bodhi")
koji = get_session()
+ tasks = []
+ broke = set()
# Check for testing updates that aren't tagged properly
for update in PackageUpdate.select(PackageUpdate.q.status=='testing'):
for build in update.builds:
tags = [tag['name'] for tag in koji.listTags(build=build.nvr)]
- if '%s-updates-testing' % update.release.dist_tag not in tags:
+ dest_tag = '%s-updates-testing' % update.release.dist_tag
+ if dest_tag not in tags:
print "%s marked as testing, but tagged with %s" % (build.nvr,
tags)
+ if '--fix' in sys.argv:
+ broke.add((tags[0], dest_tag, build.nvr))
# Check all candidate updates to see if they are in a different bodhi state
for release in Release.select():
@@ -37,6 +44,13 @@ def main():
print "%s %s but tagged as %s" % (nvr,
update.status,
tag)
+ if '--fix' in sys.argv:
+ dest = '%s-updates-testing' % release.dist_tag
+ if update.status == 'stable':
+ dest = '%s-updates' % release.dist_tag
+ elif update.status == 'obsolete':
+ dest = '%s-updates-candidate' % release.dist_tag
+ broke.add((tag, dest, nvr))
except SQLObjectNotFound:
pass
@@ -59,6 +73,34 @@ def main():
if update.status != status:
print "%s is %s in bodhi but tagged as %s in koji" % (
update.title, update.status, tag)
+ if '--fix' in sys.argv:
+ dest = '%s-updates-testing' % release.dist_tag
+ if update.status == 'stable':
+ dest = '%s-updates' % release.dist_tag
+ elif update.status == 'obsolete':
+ dest = '%s-updates-candidate' % release.dist_tag
+ for b in update.builds:
+ broke.add((tag, dest, b.nvr))
+
+ if broke:
+ print " ** Fixing broken tags! **"
+ koji.multicall = True
+ for tag, dest, build in broke:
+ print "Moving %s from %s to %s" % (build, tag, dest)
+ koji.moveBuild(tag, dest, build, force=True)
+ print "Running koji.multiCall()"
+ results = koji.multiCall()
+ success = False
+ print "Waiting for tasks"
+ bad_tasks = wait_for_tasks([task[0] for task in results])
+ if bad_tasks == 0:
+ success = True
+ if success:
+ print "Tags successfully moved!"
+ else:
+ print "Error moving tags!"
+ print "bad_tasks = %r" % bad_tasks
+
if __name__ == '__main__':
15 years, 2 months
bodhi/tools
by Luke Macken
bodhi/tools/client.py | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit a4d172d9ef69ce75aa499890e3f0bc7881c69dbf
Author: Luke Macken <lmacken(a)redhat.com>
Date: Wed Feb 11 14:55:59 2009 -0500
Apply a patch from jwb to make pushing updates a bit easier
diff --git a/bodhi/tools/client.py b/bodhi/tools/client.py
index 2a2bbfb..e06b841 100755
--- a/bodhi/tools/client.py
+++ b/bodhi/tools/client.py
@@ -200,10 +200,16 @@ def main():
if len(updates):
log.info("\n" + status.title() + "\n========")
for release in releases:
+ f = open(status.title() + '-' + release, 'w')
log.info(release)
for update in releases[release]:
log.info("%s" % update['title'])
+ s = "%s" % update['title']
+ s = s.replace(',','\n')
+ f.write(s + "\n")
log.info('')
+ f.write('')
+ f.close()
## Confirm that we actually want to push these updates
sys.stdout.write("\nPush these updates? [n]")
15 years, 2 months
bodhi/util.py
by Luke Macken
bodhi/util.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit c92d586f4195129d3505a1895c04e1fa22a43cba
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Feb 10 21:34:43 2009 -0500
Stop making dumb typos
diff --git a/bodhi/util.py b/bodhi/util.py
index 73b19f5..598c05c 100644
--- a/bodhi/util.py
+++ b/bodhi/util.py
@@ -451,7 +451,7 @@ def reset_date_pushed(status='testing'):
from bodhi.model import PackageUpdate
from sqlobject import AND
for update in PackageUpdate.select(AND(PackageUpdate.q.date_pushed==None,
- PackageUpdate.q.status==testing)):
+ PackageUpdate.q.status==status)):
date = None
for comment in update.comments:
if comment.author == 'bodhi':
15 years, 2 months
bodhi/util.py
by Luke Macken
bodhi/util.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 9173150b07adcdc737f96bf64695cccff0334a50
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Feb 10 21:34:09 2009 -0500
Make the status configurable in bodhi.util.reset_date_pushed
diff --git a/bodhi/util.py b/bodhi/util.py
index d8bea86..73b19f5 100644
--- a/bodhi/util.py
+++ b/bodhi/util.py
@@ -440,7 +440,7 @@ def json_redirect(f, *args, **kw):
Misc iPython hacks that I've had to write at one point or another
"""
-def reset_date_pushed():
+def reset_date_pushed(status='testing'):
"""
Reset the date_pushed on all testing updates with the most recent bodhi
comment that relates to it's current status.
@@ -451,7 +451,7 @@ def reset_date_pushed():
from bodhi.model import PackageUpdate
from sqlobject import AND
for update in PackageUpdate.select(AND(PackageUpdate.q.date_pushed==None,
- PackageUpdate.q.status=='testing')):
+ PackageUpdate.q.status==testing)):
date = None
for comment in update.comments:
if comment.author == 'bodhi':
15 years, 2 months
bodhi/util.py
by Luke Macken
bodhi/util.py | 1 +
1 file changed, 1 insertion(+)
New commits:
commit 805c30bba0e457fa21cc90700aeff7fc735796bd
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Feb 10 21:31:20 2009 -0500
Import a SQLObject construct in our utils
diff --git a/bodhi/util.py b/bodhi/util.py
index 0561455..d8bea86 100644
--- a/bodhi/util.py
+++ b/bodhi/util.py
@@ -449,6 +449,7 @@ def reset_date_pushed():
a date_pushed field, so we had to recreate it based on bodhi's comments.
"""
from bodhi.model import PackageUpdate
+ from sqlobject import AND
for update in PackageUpdate.select(AND(PackageUpdate.q.date_pushed==None,
PackageUpdate.q.status=='testing')):
date = None
15 years, 2 months
bodhi/util.py
by Luke Macken
bodhi/util.py | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit 0b13cd230a9925f0d267aff8edaca94e3c5e8d32
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Feb 10 21:30:25 2009 -0500
Import the PackageUpdate model where necessary in our utils module
diff --git a/bodhi/util.py b/bodhi/util.py
index cc1da5c..0561455 100644
--- a/bodhi/util.py
+++ b/bodhi/util.py
@@ -448,6 +448,7 @@ def reset_date_pushed():
This needed to happen when a few batches of updates were pushed without
a date_pushed field, so we had to recreate it based on bodhi's comments.
"""
+ from bodhi.model import PackageUpdate
for update in PackageUpdate.select(AND(PackageUpdate.q.date_pushed==None,
PackageUpdate.q.status=='testing')):
date = None
@@ -465,6 +466,7 @@ def reset_date_pushed():
def testing_statistics():
""" Calculate and display various testing statistics """
from datetime import timedelta
+ from bodhi.model import PackageUpdate
deltas = []
occurrences = {}
15 years, 2 months
bodhi/util.py
by Luke Macken
bodhi/util.py | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)
New commits:
commit 65e1b14b70d4de305563e1a2cd9726f1d507c78c
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Feb 10 21:28:06 2009 -0500
Add a couple of new methods to bodhi.util that I've written in the past,
that may be useful in the future.
diff --git a/bodhi/util.py b/bodhi/util.py
index 77b692a..cc1da5c 100644
--- a/bodhi/util.py
+++ b/bodhi/util.py
@@ -434,3 +434,60 @@ def json_redirect(f, *args, **kw):
return dict()
else:
raise redirect('/new', **e.args[0])
+
+
+"""
+Misc iPython hacks that I've had to write at one point or another
+"""
+
+def reset_date_pushed():
+ """
+ Reset the date_pushed on all testing updates with the most recent bodhi
+ comment that relates to it's current status.
+
+ This needed to happen when a few batches of updates were pushed without
+ a date_pushed field, so we had to recreate it based on bodhi's comments.
+ """
+ for update in PackageUpdate.select(AND(PackageUpdate.q.date_pushed==None,
+ PackageUpdate.q.status=='testing')):
+ date = None
+ for comment in update.comments:
+ if comment.author == 'bodhi':
+ if comment.text == 'This update has been pushed to %s' % update.status:
+ if date and comment.timestamp < date:
+ print "Skipping older push %s for %s" % (comment.timestamp, update.title)
+ else:
+ date = comment.timestamp
+ print "Setting %s to %s" % (update.title, comment.timestamp)
+ update.date_pushed = date
+
+
+def testing_statistics():
+ """ Calculate and display various testing statistics """
+ from datetime import timedelta
+
+ deltas = []
+ occurrences = {}
+ accumulative = timedelta()
+
+ for update in PackageUpdate.select():
+ for comment in update.comments:
+ if comment.text == 'This update has been pushed to testing':
+ for othercomment in update.comments:
+ if othercomment.text == 'This update has been pushed to stable':
+ delta = othercomment.timestamp - comment.timestamp
+ deltas.append(delta)
+ occurrences[delta.days] = occurrences.setdefault(delta.days, 0) + 1
+ accumulative += deltas[-1]
+ break
+ break
+
+ deltas.sort()
+ all = PackageUpdate.select().count()
+ percentage = int(float(len(deltas)) / float(all) * 100)
+ mode = sorted(occurrences.items(), cmp=lambda x, y: cmp(x[1], y[1]))[-1][0]
+
+ print "%d out of %d updates went through testing (%d%%)" % (len(deltas), all, percentage)
+ print "mean = %d days" % (accumulative.days / len(deltas))
+ print "median = %d days" % deltas[len(deltas) / 2].days
+ print "mode = %d days" % mode
15 years, 2 months
3 commits - bodhi/admin.py bodhi.egg-info/PKG-INFO bodhi/release.py bodhi.spec
by Luke Macken
bodhi.egg-info/PKG-INFO | 2 +-
bodhi.spec | 8 +++++++-
bodhi/admin.py | 2 +-
bodhi/release.py | 2 +-
4 files changed, 10 insertions(+), 4 deletions(-)
New commits:
commit 94edaafb7777e425adc2f64fafb8fcac56f3cfbc
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Feb 10 16:17:28 2009 -0500
0.5.18
diff --git a/bodhi.egg-info/PKG-INFO b/bodhi.egg-info/PKG-INFO
index 9582266..a59ce73 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.5.17
+Version: 0.5.18
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.spec b/bodhi.spec
index 7fb44c5..a46e547 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.5.17
+Version: 0.5.18
Release: 1%{?dist}
Summary: A modular framework that facilitates publishing software updates
Group: Applications/Internet
@@ -113,6 +113,9 @@ rm -rf bodhi/tests bodhi/tools/test-bodhi.py
%changelog
+* Tue Feb 10 2009 Luke Macken <lmacken(a)redhat.com> - 0.5.18-1
+- Bugfix release, and to stop using deprecated python-fedora APIs.
+
* Thu Jan 22 2009 Luke Macken <lmacken(a)redhat.com> - 0.5.17-1
- Latest upstream bugfix release.
diff --git a/bodhi/release.py b/bodhi/release.py
index f239dd0..7804add 100644
--- a/bodhi/release.py
+++ b/bodhi/release.py
@@ -1,4 +1,4 @@
-VERSION = '0.5.17'
+VERSION = '0.5.18'
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'
commit f090bea5b5b142716d3c37af1ac6eafdaae12384
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Feb 10 16:15:31 2009 -0500
Pass ProxyClient.send_message a `session_id` in the auth_params instead of the
deprecated `cookie` argument. This fixes a bug that prevents releng from
fetching a list of pending updates from the masher.
diff --git a/bodhi/admin.py b/bodhi/admin.py
index 70f68a9..a176313 100644
--- a/bodhi/admin.py
+++ b/bodhi/admin.py
@@ -189,7 +189,7 @@ class AdminController(Controller, SecureResource):
client = ProxyClient(config.get('masher'), debug=True)
cookie = SimpleCookie(cherrypy.request.headers.get('Cookie'))
session, data = client.send_request(method,
- auth_params={'cookie': cookie},
+ auth_params={'session_id': cookie.get('tg-visit')},
req_params=kwargs)
log.debug("Remote method returned %s" % repr(data))
if data.get('tg_flash'):
commit 5453bd0308e22cb001913c02806a91570960915c
Author: Luke Macken <lmacken(a)redhat.com>
Date: Thu Jan 22 15:04:15 2009 -0500
0.5.17
diff --git a/bodhi.egg-info/PKG-INFO b/bodhi.egg-info/PKG-INFO
index c3b551b..9582266 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.5.16
+Version: 0.5.17
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.spec b/bodhi.spec
index b554c21..7fb44c5 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.5.16
+Version: 0.5.17
Release: 1%{?dist}
Summary: A modular framework that facilitates publishing software updates
Group: Applications/Internet
@@ -113,6 +113,9 @@ rm -rf bodhi/tests bodhi/tools/test-bodhi.py
%changelog
+* Thu Jan 22 2009 Luke Macken <lmacken(a)redhat.com> - 0.5.17-1
+- Latest upstream bugfix release.
+
* Mon Jan 05 2009 Luke Macken <lmacken(a)redhat.com> - 0.5.16-1
- Latest upstream bugfix release.
diff --git a/bodhi/release.py b/bodhi/release.py
index 9d75bcc..f239dd0 100644
--- a/bodhi/release.py
+++ b/bodhi/release.py
@@ -1,4 +1,4 @@
-VERSION = '0.5.16'
+VERSION = '0.5.17'
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'
15 years, 2 months