Commit 30110a3a authored by Maxime Orefice's avatar Maxime Orefice Committed by Kerri Miller

Refresh ci minutes in ChangeNamespaceService

parent 97d7663d
...@@ -20,6 +20,7 @@ module Ci ...@@ -20,6 +20,7 @@ module Ci
Ci::Minutes::AdditionalPack.transaction do Ci::Minutes::AdditionalPack.transaction do
update_packs update_packs
reset_ci_minutes!
success success
end end
...@@ -53,6 +54,11 @@ module Ci ...@@ -53,6 +54,11 @@ module Ci
raise ChangeNamespaceError, 'Both namespaces must share the same owner' unless shared_ids.any? raise ChangeNamespaceError, 'Both namespaces must share the same owner' unless shared_ids.any?
end end
def reset_ci_minutes!
::Ci::Minutes::RefreshCachedDataService.new(namespace).execute
::Ci::Minutes::RefreshCachedDataService.new(target).execute
end
end end
end end
end end
......
...@@ -40,6 +40,18 @@ RSpec.describe Ci::Minutes::AdditionalPacks::ChangeNamespaceService do ...@@ -40,6 +40,18 @@ RSpec.describe Ci::Minutes::AdditionalPacks::ChangeNamespaceService do
expect(change_namespace[:status]).to eq :success expect(change_namespace[:status]).to eq :success
end end
it 'kicks off refresh ci minutes service for namespace and target' do
expect_next_instance_of(::Ci::Minutes::RefreshCachedDataService, namespace) do |instance|
expect(instance).to receive(:execute)
end
expect_next_instance_of(::Ci::Minutes::RefreshCachedDataService, target) do |instance|
expect(instance).to receive(:execute)
end
change_namespace
end
context 'when updating packs fails' do context 'when updating packs fails' do
before do before do
allow_next_instance_of(described_class) do |instance| allow_next_instance_of(described_class) do |instance|
......
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