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
3566fb4b
Commit
3566fb4b
authored
Mar 11, 2020
by
Fabio Pitino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a shared error class
parent
6367fa99
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
5 deletions
+6
-5
app/models/ci/bridge.rb
app/models/ci/bridge.rb
+1
-0
app/services/ci/create_cross_project_pipeline_service.rb
app/services/ci/create_cross_project_pipeline_service.rb
+1
-2
app/services/ci/pipeline_bridge_status_service.rb
app/services/ci/pipeline_bridge_status_service.rb
+2
-1
spec/services/ci/create_cross_project_pipeline_service_spec.rb
...services/ci/create_cross_project_pipeline_service_spec.rb
+1
-1
spec/services/ci/pipeline_bridge_status_service_spec.rb
spec/services/ci/pipeline_bridge_status_service_spec.rb
+1
-1
No files found.
app/models/ci/bridge.rb
View file @
3566fb4b
...
...
@@ -10,6 +10,7 @@ module Ci
include
HasRef
InvalidBridgeTypeError
=
Class
.
new
(
StandardError
)
InvalidTransitionError
=
Class
.
new
(
StandardError
)
belongs_to
:project
belongs_to
:trigger_request
...
...
app/services/ci/create_cross_project_pipeline_service.rb
View file @
3566fb4b
...
...
@@ -6,7 +6,6 @@ module Ci
include
Gitlab
::
Utils
::
StrongMemoize
DuplicateDownstreamPipelineError
=
Class
.
new
(
StandardError
)
InvalidBridgeTransition
=
Class
.
new
(
StandardError
)
def
execute
(
bridge
)
@bridge
=
bridge
...
...
@@ -55,7 +54,7 @@ module Ci
end
rescue
StateMachines
::
InvalidTransition
=>
e
Gitlab
::
ErrorTracking
.
track_exception
(
InvalidBridgeTransition
.
new
(
e
.
message
),
Ci
::
Bridge
::
InvalidTransitionError
.
new
(
e
.
message
),
bridge_id:
bridge
.
id
,
downstream_pipeline_id:
pipeline
.
id
)
end
...
...
app/services/ci/pipeline_bridge_status_service.rb
View file @
3566fb4b
...
...
@@ -8,7 +8,8 @@ module Ci
begin
pipeline
.
source_bridge
.
inherit_status_from_downstream!
(
pipeline
)
rescue
StateMachines
::
InvalidTransition
=>
e
Gitlab
::
ErrorTracking
.
track_exception
(
e
,
Gitlab
::
ErrorTracking
.
track_exception
(
Ci
::
Bridge
::
InvalidTransitionError
.
new
(
e
.
message
),
bridge_id:
pipeline
.
source_bridge
.
id
,
downstream_pipeline_id:
pipeline
.
id
)
end
...
...
spec/services/ci/create_cross_project_pipeline_service_spec.rb
View file @
3566fb4b
...
...
@@ -374,7 +374,7 @@ describe Ci::CreateCrossProjectPipelineService, '#execute' do
expect
(
Gitlab
::
ErrorTracking
)
.
to
receive
(
:track_exception
)
.
with
(
instance_of
(
Ci
::
CreateCrossProjectPipelineService
::
InvalidBridgeTransition
),
instance_of
(
Ci
::
Bridge
::
InvalidTransitionError
),
bridge_id:
bridge
.
id
,
downstream_pipeline_id:
kind_of
(
Numeric
))
...
...
spec/services/ci/pipeline_bridge_status_service_spec.rb
View file @
3566fb4b
...
...
@@ -33,7 +33,7 @@ describe Ci::PipelineBridgeStatusService do
expect
(
Gitlab
::
ErrorTracking
)
.
to
receive
(
:track_exception
)
.
with
(
instance_of
(
StateMachines
::
InvalidTransition
),
instance_of
(
Ci
::
Bridge
::
InvalidTransitionError
),
bridge_id:
bridge
.
id
,
downstream_pipeline_id:
pipeline
.
id
)
...
...
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