[arvados] updated: 2.7.0-5091-g60542dcecb

git repository hosting git at public.arvados.org
Fri Oct 27 18:00:09 UTC 2023


Summary of changes:
 services/api/app/controllers/arvados/v1/users_controller.rb      | 9 +++++++--
 services/api/test/functional/arvados/v1/users_controller_test.rb | 6 +++---
 2 files changed, 10 insertions(+), 5 deletions(-)

       via  60542dcecbffe14a43098d9e68ee6ae05868df1e (commit)
      from  9c9c2ba3eb1b7c3a411348f373abcdc308aec0bb (commit)

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 60542dcecbffe14a43098d9e68ee6ae05868df1e
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Fri Oct 27 13:59:56 2023 -0400

    20284: Fix test and update code comment.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/services/api/app/controllers/arvados/v1/users_controller.rb b/services/api/app/controllers/arvados/v1/users_controller.rb
index 59de9d488e..2353f67c1a 100644
--- a/services/api/app/controllers/arvados/v1/users_controller.rb
+++ b/services/api/app/controllers/arvados/v1/users_controller.rb
@@ -35,8 +35,13 @@ class Arvados::V1::UsersController < ApplicationController
           loginCluster = Rails.configuration.Login.LoginCluster
           if u.uuid[0..4] == loginCluster && !needupdate[:username].nil?
             local_user = User.find_by_username(needupdate[:username])
-            # A cached user record from the LoginCluster is stale, reset its username
-            # and retry the update operation.
+            # The username of this record conflicts with an existing,
+            # different user record.  This can happen because the
+            # username changed upstream on the login cluster, or
+            # because we're federated with another cluster with a user
+            # by the same username.  The login cluster is the source
+            # of truth, so change the username on the conflicting
+            # record and retry the update operation.
             if local_user.uuid != u.uuid
               new_username = "#{needupdate[:username]}#{rand(99999999)}"
               Rails.logger.warn("cached username '#{needupdate[:username]}' collision with user '#{local_user.uuid}' - renaming to '#{new_username}' before retrying")
diff --git a/services/api/test/functional/arvados/v1/users_controller_test.rb b/services/api/test/functional/arvados/v1/users_controller_test.rb
index fd1674a05a..6a9cb74195 100644
--- a/services/api/test/functional/arvados/v1/users_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/users_controller_test.rb
@@ -1043,8 +1043,8 @@ The Arvados team.
     existinguuid = 'remot-tpzed-foobarbazwazqux'
     newuuid = 'remot-tpzed-newnarnazwazqux'
     unchanginguuid = 'remot-tpzed-nochangingattrs'
-    conflictinguuid1 = 'remot-tpzed-conflictingname'
-    conflictinguuid2 = 'remot-tpzed-conflictingname'
+    conflictinguuid1 = 'remot-tpzed-conflictingnam1'
+    conflictinguuid2 = 'remot-tpzed-conflictingnam2'
     act_as_system_user do
       User.create!(uuid: existinguuid, email: 'root at existing.example.com')
       User.create!(uuid: unchanginguuid, email: 'root at unchanging.example.com', prefs: {'foo' => {'bar' => 'baz'}})
@@ -1077,7 +1077,7 @@ The Arvados team.
                 'email' => 'root at conflictingname1.example.com',
                 'username' => 'active'
               },
-              conflictinguuid1 => {
+              conflictinguuid2 => {
                 'email' => 'root at conflictingname2.example.com',
                 'username' => 'federatedactive'
               },

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list