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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
de61efed
Commit
de61efed
authored
Sep 19, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix processing of events when build finished.
This solves Pipelines in `running` after all stages do finish.
parent
c20e4267
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+9
-7
app/models/commit_status.rb
app/models/commit_status.rb
+4
-4
No files found.
app/models/ci/pipeline.rb
View file @
de61efed
...
@@ -241,7 +241,8 @@ module Ci
...
@@ -241,7 +241,8 @@ module Ci
end
end
def
build_updated
def
build_updated
case
latest_builds_status
with_lock
do
case
reload
.
latest_builds_status
when
'pending'
then
enqueue
when
'pending'
then
enqueue
when
'running'
then
run
when
'running'
then
run
when
'success'
then
succeed
when
'success'
then
succeed
...
@@ -250,6 +251,7 @@ module Ci
...
@@ -250,6 +251,7 @@ module Ci
when
'skipped'
then
skip
when
'skipped'
then
skip
end
end
end
end
end
def
predefined_variables
def
predefined_variables
[
[
...
...
app/models/commit_status.rb
View file @
de61efed
...
@@ -69,15 +69,15 @@ class CommitStatus < ActiveRecord::Base
...
@@ -69,15 +69,15 @@ class CommitStatus < ActiveRecord::Base
commit_status
.
update_attributes
finished_at:
Time
.
now
commit_status
.
update_attributes
finished_at:
Time
.
now
end
end
after_transition
do
|
commit_status
,
transition
|
commit_status
.
pipeline
.
try
(
:build_updated
)
unless
transition
.
loopback?
end
after_transition
any
=>
[
:success
,
:failed
,
:canceled
]
do
|
commit_status
|
after_transition
any
=>
[
:success
,
:failed
,
:canceled
]
do
|
commit_status
|
commit_status
.
pipeline
.
try
(
:process!
)
commit_status
.
pipeline
.
try
(
:process!
)
true
true
end
end
after_transition
do
|
commit_status
,
transition
|
commit_status
.
pipeline
.
try
(
:build_updated
)
unless
transition
.
loopback?
end
after_transition
[
:created
,
:pending
,
:running
]
=>
:success
do
|
commit_status
|
after_transition
[
:created
,
:pending
,
:running
]
=>
:success
do
|
commit_status
|
MergeRequests
::
MergeWhenBuildSucceedsService
.
new
(
commit_status
.
pipeline
.
project
,
nil
).
trigger
(
commit_status
)
MergeRequests
::
MergeWhenBuildSucceedsService
.
new
(
commit_status
.
pipeline
.
project
,
nil
).
trigger
(
commit_status
)
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