Commit 6455974a authored by Igor Drozdov's avatar Igor Drozdov

Merge branch 'pb-clear-merge-ref-sha-reopen' into 'master'

Clear cached merge_ref_sha on reopen

See merge request gitlab-org/gitlab!47747
parents 6c504c83 0923ef93
......@@ -16,6 +16,7 @@ module MergeRequests
merge_request.update_project_counter_caches
merge_request.cache_merge_request_closes_issues!(current_user)
merge_request.cleanup_schedule&.destroy
merge_request.update_column(:merge_ref_sha, nil)
end
merge_request
......
---
title: Clear cached merge_ref_sha on reopen
merge_request: 47747
author:
type: fixed
......@@ -24,6 +24,7 @@ RSpec.describe MergeRequests::ReopenService do
before do
allow(service).to receive(:execute_hooks)
merge_request.create_cleanup_schedule(scheduled_at: Time.current)
merge_request.update_column(:merge_ref_sha, 'abc123')
perform_enqueued_jobs do
service.execute(merge_request)
......@@ -48,6 +49,10 @@ RSpec.describe MergeRequests::ReopenService do
expect(merge_request.reload.cleanup_schedule).to be_nil
end
it 'clears the cached merge_ref_sha' do
expect(merge_request.reload.merge_ref_sha).to be_nil
end
context 'note creation' do
it 'creates resource state event about merge_request reopen' do
event = merge_request.resource_state_events.last
......
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