Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
58bd5fd29250
Commit
6d80b94a
authored
Dec 05, 2016
by
Kamil Trzcinski
Browse files
Fix handling of skipped vs success status
parent
dbd5be1c428d
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/concerns/has_status.rb
View file @
58bd5fd2
...
...
@@ -4,7 +4,7 @@ module HasStatus
AVAILABLE_STATUSES
=
%w[created pending running success failed canceled skipped]
STARTED_STATUSES
=
%w[running success failed skipped]
ACTIVE_STATUSES
=
%w[pending running]
COMPLETED_STATUSES
=
%w[success failed canceled]
COMPLETED_STATUSES
=
%w[success failed canceled
skipped
]
ORDERED_STATUSES
=
%w[failed pending running canceled success skipped]
class_methods
do
...
...
@@ -23,9 +23,9 @@ def status_sql
canceled
=
scope
.
canceled
.
select
(
'count(*)'
).
to_sql
"(CASE
WHEN (
#{
builds
}
)=(
#{
s
uccess
}
) THEN 's
uccess
'
WHEN (
#{
builds
}
)=(
#{
s
kipped
}
) THEN 's
kipped
'
WHEN (
#{
builds
}
)=(
#{
created
}
) THEN 'created'
WHEN (
#{
builds
}
)=(
#{
success
}
)+(
#{
skipped
}
) THEN 's
kipped
'
WHEN (
#{
builds
}
)=(
#{
success
}
)+(
#{
skipped
}
) THEN 's
uccess
'
WHEN (
#{
builds
}
)=(
#{
success
}
)+(
#{
skipped
}
)+(
#{
canceled
}
) THEN 'canceled'
WHEN (
#{
builds
}
)=(
#{
created
}
)+(
#{
skipped
}
)+(
#{
pending
}
) THEN 'pending'
WHEN (
#{
running
}
)+(
#{
pending
}
)+(
#{
created
}
)>0 THEN 'running'
...
...
app/services/ci/process_pipeline_service.rb
View file @
58bd5fd2
...
...
@@ -44,11 +44,11 @@ def process_build(build, current_status)
def
valid_statuses_for_when
(
value
)
case
value
when
'on_success'
%w[success]
%w[success
skipped
]
when
'on_failure'
%w[failed]
when
'always'
%w[success failed]
%w[success failed
skipped
]
else
[]
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