Commit 48dc15c9 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre Committed by Nick Thomas

Geo - Reset the verification checksum after deployment refs are created

parent b28d7174
...@@ -51,3 +51,5 @@ class UpdateDeploymentService ...@@ -51,3 +51,5 @@ class UpdateDeploymentService
environment_options[:action] || 'start' environment_options[:action] || 'start'
end end
end end
UpdateDeploymentService.prepend(EE::UpdateDeploymentService)
# frozen_string_literal: true
module EE
module UpdateDeploymentService
extend ::Gitlab::Utils::Override
override :execute
def execute
super.tap do |deployment|
deployment.project.repository.log_geo_updated_event
end
end
end
end
---
title: Geo - Reset the verification checksum after deployment refs are created
merge_request: 10160
author:
type: fixed
# frozen_string_literal: true
require 'spec_helper'
describe UpdateDeploymentService do
include ::EE::GeoHelpers
let(:primary) { create(:geo_node, :primary) }
let(:project) { create(:project, :repository) }
let(:repository_state) { create(:repository_state, :repository_verified, project: project) }
let!(:deployment) { create(:deployment, :success, project: project) }
before do
stub_current_geo_node(primary)
end
subject { described_class.new(deployment) }
describe '#execute' do
it 'triggers a Geo event about the new deployment ref' do
expect_next_instance_of(Geo::RepositoryUpdatedService) do |service|
expect(service).to receive(:execute)
end
subject.execute
end
it 'resets the repository verification checksum' do
expect { subject.execute }.to change { repository_state.reload.repository_verification_checksum }.to(nil)
end
it 'returns the deployment' do
expect(subject.execute).to eq(deployment)
end
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