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
Jérome Perrin
gitlab-ce
Commits
f441b95b
Commit
f441b95b
authored
Mar 20, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pipeline status for transition between stages
parent
9bfff603
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
app/models/concerns/has_status.rb
app/models/concerns/has_status.rb
+1
-0
spec/models/concerns/has_status_spec.rb
spec/models/concerns/has_status_spec.rb
+8
-0
No files found.
app/models/concerns/has_status.rb
View file @
f441b95b
...
...
@@ -31,6 +31,7 @@ module HasStatus
WHEN (
#{
builds
}
)=(
#{
created
}
)+(
#{
skipped
}
)+(
#{
pending
}
) THEN 'pending'
WHEN (
#{
running
}
)+(
#{
pending
}
)>0 THEN 'running'
WHEN (
#{
manual
}
)>0 THEN 'manual'
WHEN (
#{
created
}
)>0 THEN 'running'
ELSE 'failed'
END)"
end
...
...
spec/models/concerns/has_status_spec.rb
View file @
f441b95b
...
...
@@ -110,6 +110,14 @@ describe HasStatus do
it
{
is_expected
.
to
eq
'running'
}
end
context
'when pipeline is in transition between stages'
do
let!
(
:statuses
)
do
[
create
(
type
,
status: :success
),
create
(
type
,
status: :created
)]
end
it
{
is_expected
.
to
eq
'running'
}
end
context
'when one status is a blocking manual action'
do
let!
(
:statuses
)
do
[
create
(
type
,
status: :failed
),
...
...
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