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
6367fa99
Commit
6367fa99
authored
Mar 09, 2020
by
Fabio Pitino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle exception in PipelineBridgeStatusService
parent
67ada8d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
app/services/ci/pipeline_bridge_status_service.rb
app/services/ci/pipeline_bridge_status_service.rb
+7
-1
spec/services/ci/pipeline_bridge_status_service_spec.rb
spec/services/ci/pipeline_bridge_status_service_spec.rb
+18
-0
No files found.
app/services/ci/pipeline_bridge_status_service.rb
View file @
6367fa99
...
@@ -5,7 +5,13 @@ module Ci
...
@@ -5,7 +5,13 @@ module Ci
def
execute
(
pipeline
)
def
execute
(
pipeline
)
return
unless
pipeline
.
bridge_triggered?
return
unless
pipeline
.
bridge_triggered?
pipeline
.
source_bridge
.
inherit_status_from_downstream!
(
pipeline
)
begin
pipeline
.
source_bridge
.
inherit_status_from_downstream!
(
pipeline
)
rescue
StateMachines
::
InvalidTransition
=>
e
Gitlab
::
ErrorTracking
.
track_exception
(
e
,
bridge_id:
pipeline
.
source_bridge
.
id
,
downstream_pipeline_id:
pipeline
.
id
)
end
end
end
end
end
end
end
...
...
spec/services/ci/pipeline_bridge_status_service_spec.rb
View file @
6367fa99
...
@@ -22,6 +22,24 @@ describe Ci::PipelineBridgeStatusService do
...
@@ -22,6 +22,24 @@ describe Ci::PipelineBridgeStatusService do
subject
subject
end
end
context
'when bridge job status raises state machine errors'
do
before
do
pipeline
.
drop!
bridge
.
drop!
end
it
'tracks the exception'
do
expect
(
Gitlab
::
ErrorTracking
)
.
to
receive
(
:track_exception
)
.
with
(
instance_of
(
StateMachines
::
InvalidTransition
),
bridge_id:
bridge
.
id
,
downstream_pipeline_id:
pipeline
.
id
)
subject
end
end
end
end
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