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
a4a75095
Commit
a4a75095
authored
Aug 16, 2021
by
Furkan Ayhan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the FF ci_reset_bridge_with_subsequent_jobs
Changelog: other
parent
21607dbf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
68 deletions
+3
-68
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+3
-15
config/feature_flags/development/ci_reset_bridge_with_subsequent_jobs.yml
...lags/development/ci_reset_bridge_with_subsequent_jobs.yml
+0
-8
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+0
-45
No files found.
app/models/ci/pipeline.rb
View file @
a4a75095
...
@@ -1216,24 +1216,12 @@ module Ci
...
@@ -1216,24 +1216,12 @@ module Ci
self
.
ci_ref
=
Ci
::
Ref
.
ensure_for
(
self
)
self
.
ci_ref
=
Ci
::
Ref
.
ensure_for
(
self
)
end
end
# We need `base_and_ancestors` in a specific order to "break" when needed.
# If we use `find_each`, then the order is broken.
# rubocop:disable Rails/FindEach
def
reset_source_bridge!
(
current_user
)
def
reset_source_bridge!
(
current_user
)
if
::
Feature
.
enabled?
(
:ci_reset_bridge_with_subsequent_jobs
,
project
,
default_enabled: :yaml
)
return
unless
bridge_waiting?
return
unless
bridge_waiting?
source_bridge
.
pending!
source_bridge
.
pending!
Ci
::
AfterRequeueJobService
.
new
(
project
,
current_user
).
execute
(
source_bridge
)
# rubocop:disable CodeReuse/ServiceClass
Ci
::
AfterRequeueJobService
.
new
(
project
,
current_user
).
execute
(
source_bridge
)
# rubocop:disable CodeReuse/ServiceClass
else
self_and_upstreams
.
includes
(
:source_bridge
).
each
do
|
pipeline
|
break
unless
pipeline
.
bridge_waiting?
pipeline
.
source_bridge
.
pending!
end
end
end
end
# rubocop:enable Rails/FindEach
# EE-only
# EE-only
def
merge_train_pipeline?
def
merge_train_pipeline?
...
...
config/feature_flags/development/ci_reset_bridge_with_subsequent_jobs.yml
deleted
100644 → 0
View file @
21607dbf
---
name
:
ci_reset_bridge_with_subsequent_jobs
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60376
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/329194
milestone
:
'
13.12'
type
:
development
group
:
group::pipeline authoring
default_enabled
:
true
spec/models/ci/pipeline_spec.rb
View file @
a4a75095
...
@@ -4504,51 +4504,6 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
...
@@ -4504,51 +4504,6 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
subject
(
:reset_bridge
)
{
pipeline
.
reset_source_bridge!
(
project
.
owner
)
}
subject
(
:reset_bridge
)
{
pipeline
.
reset_source_bridge!
(
project
.
owner
)
}
# This whole block will be removed by https://gitlab.com/gitlab-org/gitlab/-/issues/329194
# It contains some duplicate checks.
context
'when the FF ci_reset_bridge_with_subsequent_jobs is disabled'
do
before
do
stub_feature_flags
(
ci_reset_bridge_with_subsequent_jobs:
false
)
end
context
'when the pipeline is a child pipeline and the bridge is depended'
do
let!
(
:parent_pipeline
)
{
create
(
:ci_pipeline
)
}
let!
(
:bridge
)
{
create_bridge
(
parent_pipeline
,
pipeline
,
true
)
}
it
'marks source bridge as pending'
do
reset_bridge
expect
(
bridge
.
reload
).
to
be_pending
end
context
'when the parent pipeline has subsequent jobs after the bridge'
do
let!
(
:after_bridge_job
)
{
create
(
:ci_build
,
:skipped
,
pipeline:
parent_pipeline
,
stage_idx:
bridge
.
stage_idx
+
1
)
}
it
'does not touch subsequent jobs of the bridge'
do
reset_bridge
expect
(
after_bridge_job
.
reload
).
to
be_skipped
end
end
context
'when the parent pipeline has a dependent upstream pipeline'
do
let
(
:upstream_pipeline
)
{
create
(
:ci_pipeline
,
project:
create
(
:project
))
}
let!
(
:upstream_bridge
)
{
create_bridge
(
upstream_pipeline
,
parent_pipeline
,
true
)
}
let
(
:upstream_upstream_pipeline
)
{
create
(
:ci_pipeline
,
project:
create
(
:project
))
}
let!
(
:upstream_upstream_bridge
)
{
create_bridge
(
upstream_upstream_pipeline
,
upstream_pipeline
,
true
)
}
it
'marks all source bridges as pending'
do
reset_bridge
expect
(
bridge
.
reload
).
to
be_pending
expect
(
upstream_bridge
.
reload
).
to
be_pending
expect
(
upstream_upstream_bridge
.
reload
).
to
be_pending
end
end
end
end
context
'when the pipeline is a child pipeline and the bridge is depended'
do
context
'when the pipeline is a child pipeline and the bridge is depended'
do
let!
(
:parent_pipeline
)
{
create
(
:ci_pipeline
)
}
let!
(
:parent_pipeline
)
{
create
(
:ci_pipeline
)
}
let!
(
:bridge
)
{
create_bridge
(
parent_pipeline
,
pipeline
,
true
)
}
let!
(
:bridge
)
{
create_bridge
(
parent_pipeline
,
pipeline
,
true
)
}
...
...
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