Commit 15460cc8 authored by Dmitry Gruzd's avatar Dmitry Gruzd

Merge branch 'mmj-new-worker-for-project-create' into 'master'

Use `AuthorizedProjectUpdate::ProjectRecalculateWorker` to refresh authorizations when a project is created

See merge request gitlab-org/gitlab!73615
parents 2c9c0564 0ce2e9bb
......@@ -136,7 +136,7 @@ module Projects
access_level: group_access_level)
end
AuthorizedProjectUpdate::ProjectCreateWorker.perform_async(@project.id)
AuthorizedProjectUpdate::ProjectRecalculateWorker.perform_async(@project.id)
# AuthorizedProjectsWorker uses an exclusive lease per user but
# specialized workers might have synchronization issues. Until we
# compare the inconsistency rates of both approaches, we still run
......
......@@ -810,11 +810,11 @@ RSpec.describe Projects::CreateService, '#execute' do
).to be_truthy
end
it 'schedules authorization update for users with access to group' do
it 'schedules authorization update for users with access to group', :sidekiq_inline do
expect(AuthorizedProjectsWorker).not_to(
receive(:bulk_perform_async)
)
expect(AuthorizedProjectUpdate::ProjectCreateWorker).to(
expect(AuthorizedProjectUpdate::ProjectRecalculateWorker).to(
receive(:perform_async).and_call_original
)
expect(AuthorizedProjectUpdate::UserRefreshFromReplicaWorker).to(
......@@ -825,7 +825,11 @@ RSpec.describe Projects::CreateService, '#execute' do
.and_call_original
)
create_project(user, opts)
project = create_project(user, opts)
expect(
Ability.allowed?(other_user, :developer_access, project)
).to be_truthy
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment