[ARVADOS] updated: 2.1.0-1684-g26aa25c76
Git user
git at public.arvados.org
Mon Nov 29 21:35:32 UTC 2021
Summary of changes:
services/api/lib/update_permissions.rb | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
discards 69ff5df9ce5c4fc0a6a8cbf08e630f62bd16e746 (commit)
via 26aa25c76d3ea4285e724fe874c76aa9da03b4c9 (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 (69ff5df9ce5c4fc0a6a8cbf08e630f62bd16e746)
\
N -- N -- N (26aa25c76d3ea4285e724fe874c76aa9da03b4c9)
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 26aa25c76d3ea4285e724fe874c76aa9da03b4c9
Author: Peter Amstutz <peter.amstutz at curii.com>
Date: Mon Nov 29 16:15:23 2021 -0500
18490: Add a where clause to avoid updating identical rows.
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>
diff --git a/services/api/lib/update_permissions.rb b/services/api/lib/update_permissions.rb
index 23e60c8ed..f782ac5cd 100644
--- a/services/api/lib/update_permissions.rb
+++ b/services/api/lib/update_permissions.rb
@@ -131,7 +131,12 @@ delete from #{PERMISSION_VIEW} where
ActiveRecord::Base.connection.exec_query %{
insert into #{PERMISSION_VIEW} (user_uuid, target_uuid, perm_level, traverse_owned)
select user_uuid, target_uuid, val as perm_level, traverse_owned from #{temptable_perms} where val>0
-on conflict (user_uuid, target_uuid) do update set perm_level=EXCLUDED.perm_level, traverse_owned=EXCLUDED.traverse_owned;
+on conflict (user_uuid, target_uuid) do update
+set perm_level=EXCLUDED.perm_level, traverse_owned=EXCLUDED.traverse_owned
+where #{PERMISSION_VIEW}.user_uuid=EXCLUDED.user_uuid and
+ #{PERMISSION_VIEW}.target_uuid=EXCLUDED.target_uuid and
+ (#{PERMISSION_VIEW}.perm_level != EXCLUDED.perm_level or
+ #{PERMISSION_VIEW}.traverse_owned != EXCLUDED.traverse_owned);
},
"update_permissions.insert"
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list