Commit 58bb1393 authored by Jan Provaznik's avatar Jan Provaznik

Ignore customer sync for project namespaces

Project namespace will exist for each project, so probably no need
to sync these as other namespaces.
parent 1ac8a9d1
......@@ -105,7 +105,7 @@ module EE
# Changing the plan or other details may invalidate this cache
before_save :clear_feature_available_cache
after_commit :sync_name_with_customers_dot, on: :update, if: -> { name_previously_changed? }
after_commit :sync_name_with_customers_dot, on: :update, if: -> { name_previously_changed? && !project_namespace? }
end
# Only groups can be marked for deletion
......
......@@ -391,6 +391,12 @@ RSpec.describe Namespace do
include_examples 'no sync'
end
context 'when project namespace' do
let(:namespace) { create(:project_namespace) }
include_examples 'no sync'
end
it 'triggers a name sync with CustomersDot' do
expect(::Namespaces::SyncNamespaceNameWorker).to receive(:perform_async)
.with(namespace.id).once
......
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