This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new f2d971d5 Only send change emails from active node
f2d971d5 is described below

commit f2d971d530725b268d8e51cedb6e458822519d2d
Author: Sebb <[email protected]>
AuthorDate: Sun Mar 10 17:26:05 2024 +0000

    Only send change emails from active node
---
 tools/pubsub-ci-email.rb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/pubsub-ci-email.rb b/tools/pubsub-ci-email.rb
index eb7ac8c2..61ce7889 100755
--- a/tools/pubsub-ci-email.rb
+++ b/tools/pubsub-ci-email.rb
@@ -3,11 +3,13 @@
 $LOAD_PATH.unshift '/srv/whimsy/lib'
 
 # Script to detect changes to committee-info.txt and send emails to board and 
the PMC
+# Only sends change emails if it is the active Whimsy (or a test node, which 
is expected to use a dummy smtpserver)
 
 require 'mail'
 require 'net/http'
 require 'json'
 require 'whimsy/asf'
+require 'whimsy/asf/status'
 require 'whimsy/asf/json-utils'
 
 def stamp(*s)
@@ -197,7 +199,7 @@ def do_diff(initialhash, currenthash, triggerrev)
       subject subject
       body body
     end
-    mail.deliver!
+    mail.deliver! if Status.active? or Status.testnode?
   end
 end
 
@@ -281,7 +283,7 @@ if $0 == __FILE__
     subject subject
     body body
   end
-  mail.deliver!
+  mail.deliver! # Does it matter if this is sent from an inactive node?
 
   raise ArgumentError.new error if error
   

Reply via email to