Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
dd0d8674
Commit
dd0d8674
authored
Jan 07, 2021
by
Vasilii Iakliushin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove feature flag for squash commit persistence
Feature flag:
https://gitlab.com/gitlab-org/gitlab/-/issues/294243
parent
d6ec8b7b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
26 deletions
+7
-26
app/services/merge_requests/merge_service.rb
app/services/merge_requests/merge_service.rb
+2
-6
changelogs/unreleased/21686_persist_squash_commit_sha.yml
changelogs/unreleased/21686_persist_squash_commit_sha.yml
+5
-0
config/feature_flags/development/persist_squash_commit_sha_for_squashes.yml
...gs/development/persist_squash_commit_sha_for_squashes.yml
+0
-8
spec/services/merge_requests/merge_service_spec.rb
spec/services/merge_requests/merge_service_spec.rb
+0
-12
No files found.
app/services/merge_requests/merge_service.rb
View file @
dd0d8674
...
...
@@ -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
...
...
changelogs/unreleased/21686_persist_squash_commit_sha.yml
0 → 100644
View file @
dd0d8674
---
title
:
Persist 'squash_commit_sha' when squashing
merge_request
:
51074
author
:
type
:
added
config/feature_flags/development/persist_squash_commit_sha_for_squashes.yml
deleted
100644 → 0
View file @
d6ec8b7b
---
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
spec/services/merge_requests/merge_service_spec.rb
View file @
dd0d8674
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment