[ARVADOS] updated: 2.1.0-1175-g89f817585
Git user
git at public.arvados.org
Wed Aug 11 14:18:06 UTC 2021
Summary of changes:
services/api/config/arvados_config.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
discards e8e61275deded009f08ebad6d85e29b02f4d45d8 (commit)
via 89f8175850a9279036053b2a6785980a479e08d8 (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 (e8e61275deded009f08ebad6d85e29b02f4d45d8)
\
N -- N -- N (89f8175850a9279036053b2a6785980a479e08d8)
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 89f8175850a9279036053b2a6785980a479e08d8
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..defe26283 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", Hash, ->(cfg, k, v) { arrayToHash cfg, "Users.UserNotifierEmailBcc", v }
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