[ARVADOS] updated: 2.1.0-1175-ge8e61275d

Git user git at public.arvados.org
Wed Aug 11 14:06:13 UTC 2021


Summary of changes:
 lib/config/config.default.yml                |  2 +-
 lib/config/export.go                         |  1 +
 lib/config/generated_config.go               |  2 +-
 sdk/go/arvados/config.go                     |  1 +
 services/api/app/mailers/user_notifier.rb    | 10 +++++++---
 services/api/test/unit/user_notifier_test.rb |  2 ++
 services/api/test/unit/user_test.rb          |  1 -
 7 files changed, 13 insertions(+), 6 deletions(-)

  discards  06c56872ee40bab39d606205239aeb457efda1e8 (commit)
       via  e8e61275deded009f08ebad6d85e29b02f4d45d8 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (06c56872ee40bab39d606205239aeb457efda1e8)
            \
             N -- N -- N (e8e61275deded009f08ebad6d85e29b02f4d45d8)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit e8e61275deded009f08ebad6d85e29b02f4d45d8
Author: Ward Vandewege <ward at curii.com>
Date:   Tue Aug 10 11:00:02 2021 -0400

    18001: add Users/UserNotifierEmailBcc configuration option, which is the
           e-mail address that will be bcc'd on the new user welcome e-mail.
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>

diff --git a/lib/config/config.default.yml b/lib/config/config.default.yml
index 8640e7141..ec3261390 100644
--- a/lib/config/config.default.yml
+++ b/lib/config/config.default.yml
@@ -273,6 +273,7 @@ Clusters:
       AdminNotifierEmailFrom: arvados at example.com
       EmailSubjectPrefix: "[ARVADOS] "
       UserNotifierEmailFrom: arvados at example.com
+      UserNotifierEmailBcc: {}
       NewUserNotificationRecipients: {}
       NewInactiveUserNotificationRecipients: {}
 
diff --git a/lib/config/export.go b/lib/config/export.go
index 2a3d0e173..065011cc2 100644
--- a/lib/config/export.go
+++ b/lib/config/export.go
@@ -227,6 +227,7 @@ var whitelist = map[string]bool{
 	"Users.NewUsersAreActive":                             false,
 	"Users.PreferDomainForUsername":                       false,
 	"Users.UserNotifierEmailFrom":                         false,
+	"Users.UserNotifierEmailBcc":                          false,
 	"Users.UserProfileNotificationAddress":                false,
 	"Users.UserSetupMailText":                             false,
 	"Volumes":                                             true,
diff --git a/lib/config/generated_config.go b/lib/config/generated_config.go
index 55e8ba8f3..36a21d4c3 100644
--- a/lib/config/generated_config.go
+++ b/lib/config/generated_config.go
@@ -279,6 +279,7 @@ Clusters:
       AdminNotifierEmailFrom: arvados at example.com
       EmailSubjectPrefix: "[ARVADOS] "
       UserNotifierEmailFrom: arvados at example.com
+      UserNotifierEmailBcc: {}
       NewUserNotificationRecipients: {}
       NewInactiveUserNotificationRecipients: {}
 
diff --git a/sdk/go/arvados/config.go b/sdk/go/arvados/config.go
index cc1de1be4..4a7c18b3e 100644
--- a/sdk/go/arvados/config.go
+++ b/sdk/go/arvados/config.go
@@ -234,6 +234,7 @@ type Cluster struct {
 		NewUserNotificationRecipients         StringSet
 		NewUsersAreActive                     bool
 		UserNotifierEmailFrom                 string
+		UserNotifierEmailBcc                  StringSet
 		UserProfileNotificationAddress        string
 		PreferDomainForUsername               string
 		UserSetupMailText                     string
diff --git a/services/api/app/mailers/user_notifier.rb b/services/api/app/mailers/user_notifier.rb
index ad887d035..03000a373 100644
--- a/services/api/app/mailers/user_notifier.rb
+++ b/services/api/app/mailers/user_notifier.rb
@@ -9,7 +9,12 @@ class UserNotifier < ActionMailer::Base
 
   def account_is_setup(user)
     @user = user
-    mail(to: user.email, subject: 'Welcome to Arvados - account enabled')
+    if not Rails.configuration.Users.UserNotifierEmailBcc.empty? then
+      @bcc = Rails.configuration.Users.UserNotifierEmailBcc.keys
+      mail(to: user.email, subject: 'Welcome to Arvados - account enabled', bcc: @bcc)
+    else
+      mail(to: user.email, subject: 'Welcome to Arvados - account enabled')
+    end
   end
 
 end
diff --git a/services/api/config/arvados_config.rb b/services/api/config/arvados_config.rb
index 1b3c96a8a..ec7eca97a 100644
--- a/services/api/config/arvados_config.rb
+++ b/services/api/config/arvados_config.rb
@@ -96,6 +96,7 @@ arvcfg.declare_config "Users.UserProfileNotificationAddress", String, :user_prof
 arvcfg.declare_config "Users.AdminNotifierEmailFrom", String, :admin_notifier_email_from
 arvcfg.declare_config "Users.EmailSubjectPrefix", String, :email_subject_prefix
 arvcfg.declare_config "Users.UserNotifierEmailFrom", String, :user_notifier_email_from
+arvcfg.declare_config "Users.UserNotifierEmailBcc", String, :user_notifier_email_bcc
 arvcfg.declare_config "Users.NewUserNotificationRecipients", Hash, :new_user_notification_recipients, ->(cfg, k, v) { arrayToHash cfg, "Users.NewUserNotificationRecipients", v }
 arvcfg.declare_config "Users.NewInactiveUserNotificationRecipients", Hash, :new_inactive_user_notification_recipients, method(:arrayToHash)
 arvcfg.declare_config "Login.LoginCluster", String
diff --git a/services/api/test/unit/user_notifier_test.rb b/services/api/test/unit/user_notifier_test.rb
index c288786c1..e58c273a6 100644
--- a/services/api/test/unit/user_notifier_test.rb
+++ b/services/api/test/unit/user_notifier_test.rb
@@ -10,6 +10,7 @@ class UserNotifierTest < ActionMailer::TestCase
   test "account is setup" do
     user = users :active
 
+    Rails.configuration.Users.UserNotifierEmailBcc = ConfigLoader.to_OrderedOptions({"bcc-notify at example.com"=>{},"bcc-notify2 at example.com"=>{}})
     Rails.configuration.Users.UserSetupMailText = %{
 <% if not @user.full_name.empty? -%>
 <%= @user.full_name %>,
@@ -33,6 +34,7 @@ The Arvados team.
 
     # Test the body of the sent email contains what we expect it to
     assert_equal Rails.configuration.Users.UserNotifierEmailFrom, email.from.first
+    assert_equal Rails.configuration.Users.UserNotifierEmailBcc.stringify_keys.keys, email.bcc
     assert_equal user.email, email.to.first
     assert_equal 'Welcome to Arvados - account enabled', email.subject
     assert (email.body.to_s.include? 'Your Arvados shell account has been set up'),

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list