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
a7ac3f84
Commit
a7ac3f84
authored
Oct 05, 2020
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove branch_push_merge_commit_analyze flag
This has been stable
parent
fd4c5bcc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
39 deletions
+5
-39
app/services/merge_requests/refresh_service.rb
app/services/merge_requests/refresh_service.rb
+5
-10
config/feature_flags/development/branch_push_merge_commit_analyze.yml
...re_flags/development/branch_push_merge_commit_analyze.yml
+0
-7
spec/services/merge_requests/refresh_service_spec.rb
spec/services/merge_requests/refresh_service_spec.rb
+0
-22
No files found.
app/services/merge_requests/refresh_service.rb
View file @
a7ac3f84
...
@@ -85,18 +85,13 @@ module MergeRequests
...
@@ -85,18 +85,13 @@ module MergeRequests
return
if
merge_requests
.
empty?
return
if
merge_requests
.
empty?
commit_analyze_enabled
=
Feature
.
enabled?
(
:branch_push_merge_commit_analyze
,
@project
,
default_enabled:
true
)
if
commit_analyze_enabled
analyzer
=
Gitlab
::
BranchPushMergeCommitAnalyzer
.
new
(
analyzer
=
Gitlab
::
BranchPushMergeCommitAnalyzer
.
new
(
@commits
.
reverse
,
@commits
.
reverse
,
relevant_commit_ids:
merge_requests
.
map
(
&
:diff_head_sha
)
relevant_commit_ids:
merge_requests
.
map
(
&
:diff_head_sha
)
)
)
end
merge_requests
.
each
do
|
merge_request
|
merge_requests
.
each
do
|
merge_request
|
if
commit_analyze_enabled
merge_request
.
merge_commit_sha
=
analyzer
.
get_merge_commit
(
merge_request
.
diff_head_sha
)
merge_request
.
merge_commit_sha
=
analyzer
.
get_merge_commit
(
merge_request
.
diff_head_sha
)
end
MergeRequests
::
PostMergeService
MergeRequests
::
PostMergeService
.
new
(
merge_request
.
target_project
,
@current_user
)
.
new
(
merge_request
.
target_project
,
@current_user
)
...
...
config/feature_flags/development/branch_push_merge_commit_analyze.yml
deleted
100644 → 0
View file @
fd4c5bcc
---
name
:
branch_push_merge_commit_analyze
introduced_by_url
:
rollout_issue_url
:
group
:
type
:
development
default_enabled
:
true
spec/services/merge_requests/refresh_service_spec.rb
View file @
a7ac3f84
...
@@ -796,10 +796,6 @@ RSpec.describe MergeRequests::RefreshService do
...
@@ -796,10 +796,6 @@ RSpec.describe MergeRequests::RefreshService do
subject
{
service
.
execute
(
oldrev
,
newrev
,
'refs/heads/merge-commit-analyze-before'
)
}
subject
{
service
.
execute
(
oldrev
,
newrev
,
'refs/heads/merge-commit-analyze-before'
)
}
context
'feature enabled'
do
context
'feature enabled'
do
before
do
stub_feature_flags
(
branch_push_merge_commit_analyze:
true
)
end
it
"updates merge requests' merge_commits"
do
it
"updates merge requests' merge_commits"
do
expect
(
Gitlab
::
BranchPushMergeCommitAnalyzer
).
to
receive
(
:new
).
and_wrap_original
do
|
original_method
,
commits
|
expect
(
Gitlab
::
BranchPushMergeCommitAnalyzer
).
to
receive
(
:new
).
and_wrap_original
do
|
original_method
,
commits
|
expect
(
commits
.
map
(
&
:id
)).
to
eq
(
%w{646ece5cfed840eca0a4feb21bcd6a81bb19bda3 29284d9bcc350bcae005872d0be6edd016e2efb5 5f82584f0a907f3b30cfce5bb8df371454a90051 8a994512e8c8f0dfcf22bb16df6e876be7a61036 689600b91aabec706e657e38ea706ece1ee8268f db46a1c5a5e474aa169b6cdb7a522d891bc4c5f9}
)
expect
(
commits
.
map
(
&
:id
)).
to
eq
(
%w{646ece5cfed840eca0a4feb21bcd6a81bb19bda3 29284d9bcc350bcae005872d0be6edd016e2efb5 5f82584f0a907f3b30cfce5bb8df371454a90051 8a994512e8c8f0dfcf22bb16df6e876be7a61036 689600b91aabec706e657e38ea706ece1ee8268f db46a1c5a5e474aa169b6cdb7a522d891bc4c5f9}
)
...
@@ -816,24 +812,6 @@ RSpec.describe MergeRequests::RefreshService do
...
@@ -816,24 +812,6 @@ RSpec.describe MergeRequests::RefreshService do
expect
(
merge_request_side_branch
.
merge_commit
.
id
).
to
eq
(
'29284d9bcc350bcae005872d0be6edd016e2efb5'
)
expect
(
merge_request_side_branch
.
merge_commit
.
id
).
to
eq
(
'29284d9bcc350bcae005872d0be6edd016e2efb5'
)
end
end
end
end
context
'when feature is disabled'
do
before
do
stub_feature_flags
(
branch_push_merge_commit_analyze:
false
)
end
it
"does not trigger analysis"
do
expect
(
Gitlab
::
BranchPushMergeCommitAnalyzer
).
not_to
receive
(
:new
)
subject
merge_request
.
reload
merge_request_side_branch
.
reload
expect
(
merge_request
.
merge_commit
).
to
eq
(
nil
)
expect
(
merge_request_side_branch
.
merge_commit
).
to
eq
(
nil
)
end
end
end
end
describe
'#abort_ff_merge_requests_with_when_pipeline_succeeds'
do
describe
'#abort_ff_merge_requests_with_when_pipeline_succeeds'
do
...
...
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