Skip to content
Snippets Groups Projects
Verified Commit c5182a55 authored by Imre Farkas's avatar Imre Farkas :three: Committed by GitLab
Browse files

Merge branch '336592-remove-ff' into 'master'

Remove specialized_worker_for_group_lock_update_auth_recalculation FF

See merge request gitlab-org/gitlab!174519



Merged-by: Imre Farkas's avatarImre Farkas <ifarkas@gitlab.com>
Approved-by: default avatarTiger Watson <twatson@gitlab.com>
Approved-by: Imre Farkas's avatarImre Farkas <ifarkas@gitlab.com>
Co-authored-by: Jarka Košanová's avatarJarka Košanová <jarka@gitlab.com>
parents a17e168f e52726b7
No related branches found
No related tags found
No related merge requests found
......@@ -832,22 +832,18 @@ def saved_change_to_path_or_parent?
end
def refresh_access_of_projects_invited_groups
if Feature.enabled?(:specialized_worker_for_group_lock_update_auth_recalculation, self)
Project
.where(namespace_id: id)
.joins(:project_group_links)
.distinct
.find_each do |project|
AuthorizedProjectUpdate::ProjectRecalculateWorker.perform_async(project.id)
end
# Until we compare the inconsistency rates of the new specialized worker and
# the old approach, we still run AuthorizedProjectsWorker
# but with some delay and lower urgency as a safety net.
enqueue_jobs_for_groups_requiring_authorizations_refresh(priority: UserProjectAccessChangedService::LOW_PRIORITY)
else
enqueue_jobs_for_groups_requiring_authorizations_refresh(priority: UserProjectAccessChangedService::HIGH_PRIORITY)
end
Project
.where(namespace_id: id)
.joins(:project_group_links)
.distinct
.find_each do |project|
AuthorizedProjectUpdate::ProjectRecalculateWorker.perform_async(project.id)
end
# Until we compare the inconsistency rates of the new specialized worker and
# the old approach, we still run AuthorizedProjectsWorker
# but with some delay and lower urgency as a safety net.
enqueue_jobs_for_groups_requiring_authorizations_refresh(priority: UserProjectAccessChangedService::LOW_PRIORITY)
end
def enqueue_jobs_for_groups_requiring_authorizations_refresh(priority:)
......
---
name: specialized_worker_for_group_lock_update_auth_recalculation
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/66525
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/336592
milestone: '14.2'
type: development
group: group::authorization
default_enabled: true
......@@ -1803,28 +1803,6 @@
execute_update
end
context 'when the feature flag `specialized_worker_for_group_lock_update_auth_recalculation` is disabled' do
before do
stub_feature_flags(specialized_worker_for_group_lock_update_auth_recalculation: false)
end
it 'updates authorizations leading to users from shared groups losing access', :sidekiq_inline do
expect { execute_update }
.to change { group_one_user.authorized_projects.include?(project) }.from(true).to(false)
.and change { group_two_user.authorized_projects.include?(project) }.from(true).to(false)
end
it 'updates the authorizations in a non-blocking manner' do
expect(AuthorizedProjectsWorker).to(
receive(:bulk_perform_async).with([[group_one_user.id]])).once
expect(AuthorizedProjectsWorker).to(
receive(:bulk_perform_async).with([[group_two_user.id]])).once
execute_update
end
end
end
describe '#share_with_group_lock with subgroups' do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment