[Tools] testbot/bin: Make sure WineSendLog does not spam anyone by default.

Francois Gouget fgouget at codeweavers.com
Mon Sep 3 17:12:38 CDT 2012


This adds a $WinePatchToOverride configuration option and sets it to the WineTestBot administrator email address by default. So as the name implies any test result will be sent to him instead of to the patch authors until he decides the WineTestBot to be worthy.
This also adds a $WinePatchCc configuration option to set who should be CC-ed the results. By default this is empty.
---
 testbot/bin/WineSendLog.pl                     |    4 ++--
 testbot/lib/WineTestBot/Config.pm              |    6 ++++--
 testbot/lib/WineTestBot/ConfigLocalTemplate.pl |   11 ++++++++++-
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/testbot/bin/WineSendLog.pl b/testbot/bin/WineSendLog.pl
index c4147a6..c8c2dce 100755
--- a/testbot/bin/WineSendLog.pl
+++ b/testbot/bin/WineSendLog.pl
@@ -173,7 +173,7 @@ sub CompareLogs
 sub SendLog
 {
   my $Job = shift;
-  my $To = $Job->GetEMailRecipient();
+  my $To = $WinePatchToOverride || $Job->GetEMailRecipient();
   if (! defined($To))
   {
     return;
@@ -420,7 +420,7 @@ EOF
     open (SENDMAIL, "|/usr/sbin/sendmail -oi -t -odq");
     print SENDMAIL "From: Marvin <$RobotEMail>\n";
     print SENDMAIL "To: $To\n";
-    print SENDMAIL "Cc: wine-devel\@winehq.org\n";
+    print SENDMAIL "Cc: $WinePatchCc\n";
     print SENDMAIL "Subject: Re: ", $Job->Patch->Subject, "\n";
     print SENDMAIL <<"EOF";
 
diff --git a/testbot/lib/WineTestBot/Config.pm b/testbot/lib/WineTestBot/Config.pm
index 4299b32..df40a0c 100644
--- a/testbot/lib/WineTestBot/Config.pm
+++ b/testbot/lib/WineTestBot/Config.pm
@@ -28,7 +28,8 @@ use vars qw (@ISA @EXPORT @EXPORT_OK $UseSSL $LogDir $DataDir $BinDir
              $VixHostType $VixHostUsername $VixHostPassword
              $VixGuestUsername $VixGuestPassword $DbDataSource $DbUsername
              $DbPassword $MaxRevertingVMs $MaxRunningVMs $MaxExtraPoweredOnVms $SleepAfterRevert
-             $AdminEMail $RobotEMail $SuiteTimeout $SingleTimeout
+             $AdminEMail $RobotEMail $WinePatchToOverride $WinePatchCc
+             $SuiteTimeout $SingleTimeout
              $BuildTimeout $ReconfigTimeout $OverheadTimeout $TagPrefix
              $ProjectName $PatchesMailingList $PatchResultsEMail $LDAPServer
              $LDAPBindDN $LDAPSearchBase $LDAPSearchFilter
@@ -40,7 +41,8 @@ require Exporter;
 @EXPORT = qw($UseSSL $LogDir $DataDir $BinDir $VixHostType
              $VixHostUsername $VixHostPassword $VixGuestUsername
              $VixGuestPassword $MaxRevertingVMs $MaxRunningVMs $MaxExtraPoweredOnVms
-             $SleepAfterRevert $AdminEMail $RobotEMail $SuiteTimeout
+             $SleepAfterRevert $AdminEMail $RobotEMail $WinePatchToOverride
+             $WinePatchCc $SuiteTimeout
              $SingleTimeout $BuildTimeout $ReconfigTimeout $OverheadTimeout
              $TagPrefix $ProjectName $PatchesMailingList $PatchResultsEMail
              $LDAPServer $LDAPBindDN $LDAPSearchBase $LDAPSearchFilter
diff --git a/testbot/lib/WineTestBot/ConfigLocalTemplate.pl b/testbot/lib/WineTestBot/ConfigLocalTemplate.pl
index bb7684a..9469784 100644
--- a/testbot/lib/WineTestBot/ConfigLocalTemplate.pl
+++ b/testbot/lib/WineTestBot/ConfigLocalTemplate.pl
@@ -62,8 +62,17 @@ $WineTestBot::Config::AdminEMail = undef;
 # From address of mails sent by WineTestBot to users
 $WineTestBot::Config::RobotEMail = undef;
 
+# If set, sends the results to the specified email address instead of the
+# patch author. Set it to undef once your WineTestBot installation works and
+# can provide useful results to Wine developers.
+$WineTestBot::Config::WinePatchToOverride = $WineTestBot::Config::AdminEMail;
+
+# If set, CC the results to the specified email address, for instance the
+# wine-devel mailing list.
+$WineTestBot::Config::WinePatchCc = "";
+
 # Email address to send the results to for integration with the Wine Patches
-# site
+# web site
 $WineTestBot::Config::PatchResultsEMail = undef;
 
 # Host name of the web interface
-- 
1.7.10.4




More information about the wine-patches mailing list