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
5331a5d3
Commit
5331a5d3
authored
Nov 03, 2020
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove ci_always_refresh_merge_requests_from_beginning flag
This commit removes the feature flag.
parent
325aceb0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
69 deletions
+12
-69
changelogs/unreleased/remove-ci_always_refresh_merge_requests_from_beginning-flag.yml
...-ci_always_refresh_merge_requests_from_beginning-flag.yml
+6
-0
config/feature_flags/development/ci_always_refresh_merge_requests_from_beginning.yml
...pment/ci_always_refresh_merge_requests_from_beginning.yml
+0
-8
ee/app/services/merge_trains/refresh_merge_requests_service.rb
...p/services/merge_trains/refresh_merge_requests_service.rb
+6
-5
ee/spec/services/merge_trains/refresh_merge_requests_service_spec.rb
...vices/merge_trains/refresh_merge_requests_service_spec.rb
+0
-56
No files found.
changelogs/unreleased/remove-ci_always_refresh_merge_requests_from_beginning-flag.yml
0 → 100644
View file @
5331a5d3
---
title
:
Make the Merge Train process flow more resilient by always refreshing merge
requests from beginning
merge_request
:
46768
author
:
type
:
fixed
config/feature_flags/development/ci_always_refresh_merge_requests_from_beginning.yml
deleted
100644 → 0
View file @
325aceb0
---
name
:
ci_always_refresh_merge_requests_from_beginning
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45232
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/268215
milestone
:
'
13.5'
type
:
development
group
:
group::continuous integration
default_enabled
:
false
ee/app/services/merge_trains/refresh_merge_requests_service.rb
View file @
5331a5d3
...
...
@@ -42,12 +42,13 @@ module MergeTrains
attr_reader
:merge_request
# NOTE:
# As we changed the process flow to refresh merge requests from the begnning always,
# we don't use the `items` argument anymore.
# We should refactor the current logic to make this class more readable.
# See https://gitlab.com/gitlab-org/gitlab/-/issues/281065
def
get_first_in_train
(
items
)
if
Feature
.
enabled?
(
:ci_always_refresh_merge_requests_from_beginning
,
merge_request
.
target_project
)
MergeTrain
.
first_in_train
(
merge_request
.
target_project
,
merge_request
.
target_branch
)
else
MergeTrain
.
first_in_train_from
(
items
)
end
MergeTrain
.
first_in_train
(
merge_request
.
target_project
,
merge_request
.
target_branch
)
end
def
unsafe_refresh
(
first_merge_request
)
...
...
ee/spec/services/merge_trains/refresh_merge_requests_service_spec.rb
View file @
5331a5d3
...
...
@@ -181,62 +181,6 @@ RSpec.describe MergeTrains::RefreshMergeRequestsService do
subject
end
context
'when ci_always_refresh_merge_requests_from_beginning is disabled'
do
before
do
stub_feature_flags
(
ci_always_refresh_merge_requests_from_beginning:
false
)
end
it
'executes RefreshMergeRequestService to all the following merge requests'
do
expect
(
refresh_service_1
).
not_to
receive
(
:execute
).
with
(
merge_request_1
)
expect
(
refresh_service_2
).
to
receive
(
:execute
).
with
(
merge_request_2
)
subject
end
context
'when merge request 1 was tried to be refreshed while the system is refreshing merge request 2'
do
before
do
allow_any_instance_of
(
described_class
).
to
receive
(
:unsafe_refresh
).
with
(
merge_request_2
)
do
service
.
execute
(
merge_request_1
)
end
end
it
'refreshes the merge request 1 later with AutoMergeProcessWorker'
do
expect
(
AutoMergeProcessWorker
).
to
receive
(
:perform_async
).
with
(
merge_request_1
.
id
).
once
subject
end
context
'when ci_always_refresh_merge_requests_from_beginning is disabled'
do
before
do
stub_feature_flags
(
ci_always_refresh_merge_requests_from_beginning:
false
)
end
it
'refreshes the merge request 1 later with AutoMergeProcessWorker'
do
expect
(
AutoMergeProcessWorker
).
to
receive
(
:perform_async
).
with
(
merge_request_1
.
id
).
once
subject
end
end
it_behaves_like
'logging results'
,
4
context
'when merge request 1 has already been merged'
do
before
do
allow
(
merge_request_1
.
merge_train
).
to
receive
(
:cleanup_ref
)
merge_request_1
.
merge_train
.
update_column
(
:status
,
MergeTrain
.
state_machines
[
:status
].
states
[
:merged
].
value
)
end
it
'does not refresh the merge request 1'
do
expect
(
AutoMergeProcessWorker
).
not_to
receive
(
:perform_async
).
with
(
merge_request_1
.
id
)
subject
end
it_behaves_like
'logging results'
,
1
end
end
end
it_behaves_like
'logging results'
,
3
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