----- skvidal@fedoraproject.org wrote:
From: Seth Vidal skvidal@fedoraproject.org
lib/python/repoinfo.py | 3 ++- lib/python/util.py | 18 ++++++++++++++++++ repoinfo.conf | 14 ++++++++++++++ tests/rpmguard/rpmguard.py | 18 ++++++++++++++---- tests/rpmlint/rpmlint.py | 18 ++++++++++++++---- 5 files changed, 62 insertions(+), 9 deletions(-)
diff --git a/lib/python/repoinfo.py b/lib/python/repoinfo.py index f5d1044..de7332c 100644 --- a/lib/python/repoinfo.py +++ b/lib/python/repoinfo.py @@ -47,7 +47,8 @@ class RepoinfoConfig(object): 'tag': self.config.get(name,'tag'), 'url': self.config.get(name,'url'), 'path': self.config.get(name,'path'),
'name': name # kind of unnecessary
'name': name, # kind of unnecessary
'collection_name': self.config.get(name,
'collection_name'), } return repo def getrepo_by_tag(self, tag): diff --git a/lib/python/util.py b/lib/python/util.py index 4a533ec..67ae699 100644 --- a/lib/python/util.py +++ b/lib/python/util.py @@ -27,6 +27,8 @@ import datetime import urlgrabber.grabber import urlgrabber.progress import config +import urllib +import socket
def timestamp_to_compose_id(timestamp=None, serial=1): if not timestamp: @@ -91,6 +93,22 @@ def checkhash(filename, algo, hexdigest): hasher.hexdigest() == hexdigest) return r
+def check_opt_in(pkgname, release):
- """take a package name and release and check for an autoqa-optin
file"""
Maybe this would need a better name then 'release', because my first impression was that it means package release, and it means Fedora release. It maps to the "collection_name" we now have in repoinfo.conf. I'll try to think up something better.
- url = 'http://fedorapeople.org/packages/'
- fullurl = url + '%s/%s/%s/autoqa-optin' % (name[0].lower(), name,
release)
Are we ok with hardcoding the path of this short-time solution inside source code?
- tmout = socket.getdefaulttimeout()
'tmout' not used anywhere else, I believe you wanted to revert to default timeout after try-except code, Seth?
- socket.setdefaulttimeout(5) # if it takes more than
More than what? :) I would give 10 seconds for timeout, fedorapeople can be slow sometimes. Any other proposals?
- try:
h = urllib.urlopen(fullurl)
- except IOError, e:
return False
- if h.getcode() == 200:
return True
- return False
grabber = urlgrabber.grabber.URLGrabber() if hasattr(sys.stdout, "fileno") and os.isatty(sys.stdout.fileno()): grabber.opts.progress_obj = urlgrabber.progress.TextMeter() diff --git a/repoinfo.conf b/repoinfo.conf index d1dc535..a3ebed4 100644 --- a/repoinfo.conf +++ b/repoinfo.conf @@ -12,66 +12,80 @@ rawhideurl = %(baseurl)s/%(path)s/%(arch)s/os arches = i386, x86_64 path = development/rawhide url = %(rawhideurl)s +collection_name = devel
[branched] arches = i386, x86_64 # path will change when Fedora 13 is released path = development/13 url = %(rawhideurl)s +collection_name = F-13
[f13] # path will change when Fedora 13 is released path = development/13 url = %(rawhideurl)s +collection_name = F-13
[f13-updates] path = 13 url = %(updatesurl)s parents = f13 +collection_name = F-13
[f13-updates-testing] path = testing/13 url = %(updatesurl)s parents = f13-updates, f13 +collection_name = F-13
[f12] path = 12 url = %(goldurl)s +collection_name = F-12
[f12-updates] path = 12 url = %(updatesurl)s parents = f12 +collection_name = F-12
[f12-updates-testing] path = testing/12 url = %(updatesurl)s parents = f12-updates, f12 +collection_name = F-12
[f11] path = 11 url = %(goldurl)s +collection_name = F-11
[f11-updates] path = 11 url = %(updatesurl)s parents = f11 +collection_name = F-11
[f11-updates-testing] path = testing/11 url = %(updatesurl)s parents = f11-updates, f11 +collection_name = F-11
[f10] path = 10 url = %(goldurl)s +collection_name = F-10
[f10-updates] path = 10 url = %(updatesurl)s parents = f10 +collection_name = F-10
[f10-updates-testing] path = testing/10 url = %(updatesurl)s parents = f10-updates, f10 +collection_name = F-10 diff --git a/tests/rpmguard/rpmguard.py b/tests/rpmguard/rpmguard.py index 61eec64..e91b1bf 100644 --- a/tests/rpmguard/rpmguard.py +++ b/tests/rpmguard/rpmguard.py @@ -23,6 +23,7 @@ from autotest_lib.client.bin.test_config import config_loader from autotest_lib.client.common_lib import error import autoqa.koji_utils import autoqa.util +from autoqa.repoinfo import repoinfo import os import rpmUtils.miscutils
@@ -175,13 +176,22 @@ rpmlint | cut -d ' ' -f 1", retain_output=True) out.write(log) out.close()
# email results to mailing list
# email results to mailing list and to pkg owner if they
optin
send_to = [] result_email = self.config.get('test','result_email')
if result_email:
if result_email and isinstance(result_email, str):
Any reason why we should not get string instance in here? I never used this config stuff, just asking.
send_to = mail_to.split(',')
collection_name =
repoinfo.config.getrepo_by_tag(kojitag)['collection_name']
if collection_name and autoqa.util.check_opt_in(name,
collection_name):
#FIXME - hardcoded partial email address here - obviously
sub-par
send_to.append('%s-owner@fedoraproject.org') % name
if send_to:
This has the disadvantage that package owners will be emailed even from our local test runs, not just the main autoqa instance test run :) We should probably make another option in autoqa.conf or in case result_email is blank then don't send even to maintainers (supposing that main autoqa instance has always result_email filled in).
warning_count = len([line for line in log.splitlines() \ if line.startswith('W: ')])
print 'Sending email with results to %s ...' %
result_email
utils.send_email(mail_to=result_email,
print 'Sending email with results to %s ...' % ',
'.join(send_to)
utils.send_email(mail_to=send_to, mail_from=self.config.get('test','mail_from'), mail_server=self.config.get('test','smtpserver'), subject='rpmguard: %u warnings for package %s' % \
diff --git a/tests/rpmlint/rpmlint.py b/tests/rpmlint/rpmlint.py index 7ad6f90..304d42c 100644 --- a/tests/rpmlint/rpmlint.py +++ b/tests/rpmlint/rpmlint.py @@ -22,6 +22,7 @@ from autotest_lib.client.bin.test_config import config_loader from autotest_lib.client.common_lib import error import autoqa.koji_utils, autoqa.util import os +from autoqa.repoinfo import repoinfo
class rpmlint(test.test): version = 1 # increment if setup() changes @@ -60,13 +61,22 @@ class rpmlint(test.test): out.write(self.results) out.close()
# email results to mailing list
# email results to mailing list and to pkg owner if they
optin
send_to = [] result_email = self.config.get('test','result_email')
if result_email:
if result_email and isinstance(result_email, str):
send_to = mail_to.split(',')
collection_name =
repoinfo.config.getrepo_by_tag(kojitag)['collection_name']
if collection_name and autoqa.util.check_opt_in(name,
collection_name):
#FIXME - hardcoded partial email address here - obviously
sub-par
send_to.append('%s-owner@fedoraproject.org') % name
if send_to: # parse last line for summary ('N errors, N warnings') summary =
((self.results.splitlines()[-1]).split(';')[-1])[1:-1]
print 'Sending email with results to %s ...' %
result_email
utils.send_email(mail_to=result_email,
print 'Sending email with results to %s ...' % ',
'.join(send_to)
utils.send_email(mail_to=send_to, mail_from=self.config.get('test','mail_from'), mail_server=self.config.get('test','smtpserver'), subject='rpmlint: %s for package %s' % \
-- 1.7.0.1
autoqa-devel mailing list autoqa-devel@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/autoqa-devel
On Thu, 29 Apr 2010, Kamil Paral wrote:
----- skvidal@fedoraproject.org wrote:
I sent a new patch to my patch.
fixes a number of issues, I think. -sv
autoqa-devel@lists.fedorahosted.org