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
6453eca1
Commit
6453eca1
authored
Oct 02, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass pipeline failure reason to a transition event
parent
4a883f36
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+6
-0
ee/lib/ee/gitlab/ci/pipeline/chain/limit/activity.rb
ee/lib/ee/gitlab/ci/pipeline/chain/limit/activity.rb
+1
-2
ee/lib/ee/gitlab/ci/pipeline/chain/limit/size.rb
ee/lib/ee/gitlab/ci/pipeline/chain/limit/size.rb
+1
-2
No files found.
app/models/ci/pipeline.rb
View file @
6453eca1
...
...
@@ -126,6 +126,12 @@ module Ci
pipeline
.
auto_canceled_by
=
nil
end
before_transition
any
=>
:failed
do
|
pipeline
,
transition
|
transition
.
args
.
first
.
try
do
|
reason
|
pipeline
.
failure_reason
=
reason
end
end
after_transition
[
:created
,
:pending
]
=>
:running
do
|
pipeline
|
pipeline
.
run_after_commit
{
PipelineMetricsWorker
.
perform_async
(
pipeline
.
id
)
}
end
...
...
ee/lib/ee/gitlab/ci/pipeline/chain/limit/activity.rb
View file @
6453eca1
...
...
@@ -21,8 +21,7 @@ module EE
@pipeline
.
cancel_running
retry_optimistic_lock
(
@pipeline
)
do
@pipeline
.
failure_reason
=
:activity_limit_exceeded
@pipeline
.
drop!
@pipeline
.
drop!
(
:activity_limit_exceeded
)
end
# TODO, should we invalidate the pipeline
...
...
ee/lib/ee/gitlab/ci/pipeline/chain/limit/size.rb
View file @
6453eca1
...
...
@@ -18,8 +18,7 @@ module EE
return
unless
@limit
.
exceeded?
if
@command
.
save_incompleted
@pipeline
.
failure_reason
=
:size_limit_exceeded
@pipeline
.
drop
@pipeline
.
drop!
(
:size_limit_exceeded
)
end
error
(
@limit
.
message
)
...
...
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