Greetings Seth,
Thank you for the patches! Will, Kamil and Josef can provide more
targeted feedback, but I thought I'd tip my hat for contributing.
One thing I wasn't sure about is listed below.
Thanks,
James
On Tue, 2010-04-27 at 15:02 -0400, skvidal(a)fedoraproject.org wrote:
From: Seth Vidal <skvidal(a)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(-)
<snip>
--- 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):
+ send_to = mail_to.split(',')
^^^^^^^^^
I couldn't find out where mail_to was set. Should the above read ...
send_to = result_email.split(',') ?
Should we also be splitting on a regexp that accepts spaces or commas?
send_to = re.split("[, ]+", result_email)
+
+ 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(a)fedoraproject.org') % name
+
+ if send_to:
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(',')
Same as above?
+ 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(a)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' % \