Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9679d2f4
Commit
9679d2f4
authored
May 03, 2021
by
Imre Farkas
Committed by
Adam Hegyi
May 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make RecalculateProjectAuthorizations background migration no-op
parent
2c4abf28
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
272 deletions
+6
-272
changelogs/unreleased/if-remove_recalculate_project_auth_migration.yml
...released/if-remove_recalculate_project_auth_migration.yml
+5
-0
lib/gitlab/background_migration/recalculate_project_authorizations.rb
...ackground_migration/recalculate_project_authorizations.rb
+1
-31
spec/lib/gitlab/background_migration/recalculate_project_authorizations_spec.rb
...ound_migration/recalculate_project_authorizations_spec.rb
+0
-241
No files found.
changelogs/unreleased/if-remove_recalculate_project_auth_migration.yml
0 → 100644
View file @
9679d2f4
---
title
:
Make RecalculateProjectAuthorizations background migration no-op
merge_request
:
60825
author
:
type
:
other
lib/gitlab/background_migration/recalculate_project_authorizations.rb
View file @
9679d2f4
...
@@ -5,37 +5,7 @@ module Gitlab
...
@@ -5,37 +5,7 @@ module Gitlab
# rubocop:disable Style/Documentation
# rubocop:disable Style/Documentation
class
RecalculateProjectAuthorizations
class
RecalculateProjectAuthorizations
def
perform
(
user_ids
)
def
perform
(
user_ids
)
user_ids
.
each
do
|
user_id
|
# no-op
user
=
User
.
find_by
(
id:
user_id
)
next
unless
user
service
=
Users
::
RefreshAuthorizedProjectsService
.
new
(
user
,
incorrect_auth_found_callback:
->
(
project_id
,
access_level
)
do
logger
.
info
(
message:
'Removing ProjectAuthorizations'
,
user_id:
user
.
id
,
project_id:
project_id
,
access_level:
access_level
)
end
,
missing_auth_found_callback:
->
(
project_id
,
access_level
)
do
logger
.
info
(
message:
'Creating ProjectAuthorizations'
,
user_id:
user
.
id
,
project_id:
project_id
,
access_level:
access_level
)
end
)
service
.
execute
end
end
private
def
logger
@logger
||=
Gitlab
::
BackgroundMigration
::
Logger
.
build
end
end
end
end
end
end
...
...
spec/lib/gitlab/background_migration/recalculate_project_authorizations_spec.rb
deleted
100644 → 0
View file @
2c4abf28
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment