Commit dd0d8674 authored by Vasilii Iakliushin's avatar Vasilii Iakliushin

Remove feature flag for squash commit persistence

Feature flag: https://gitlab.com/gitlab-org/gitlab/-/issues/294243
parent d6ec8b7b
......@@ -88,13 +88,9 @@ module MergeRequests
end
def try_merge
merge = repository.merge(current_user, source, merge_request, commit_message)
if merge_request.squash_on_merge? && Feature.enabled?(:persist_squash_commit_sha_for_squashes, project)
merge_request.update_column(:squash_commit_sha, source)
repository.merge(current_user, source, merge_request, commit_message).tap do
merge_request.update_column(:squash_commit_sha, source) if merge_request.squash_on_merge?
end
merge
rescue Gitlab::Git::PreReceiveError => e
raise MergeError,
"Something went wrong during merge pre-receive hook. #{e.message}".strip
......
---
title: Persist 'squash_commit_sha' when squashing
merge_request: 51074
author:
type: added
---
name: persist_squash_commit_sha_for_squashes
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50178
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/294243
milestone: '13.8'
type: development
group: group::source code
default_enabled: false
......@@ -19,12 +19,8 @@ RSpec.describe MergeRequests::MergeService do
{ commit_message: 'Awesome message', sha: merge_request.diff_head_sha }
end
let(:feature_flag_persist_squash) { true }
context 'valid params' do
before do
stub_feature_flags(persist_squash_commit_sha_for_squashes: feature_flag_persist_squash)
allow(service).to receive(:execute_hooks)
expect(merge_request).to receive(:update_and_mark_in_progress_merge_commit_sha).twice.and_call_original
......@@ -90,14 +86,6 @@ RSpec.describe MergeRequests::MergeService do
expect(merge_request.squash_commit_sha).to eq(squash_commit.id)
end
context 'when feature flag is disabled' do
let(:feature_flag_persist_squash) { false }
it 'does not populate squash_commit_sha' do
expect(merge_request.squash_commit_sha).to be_nil
end
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