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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
2c7d9cfa
Commit
2c7d9cfa
authored
Jan 14, 2016
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Ci::Build#available_statuses to AVAILABLE_STATUSES constant in CommitStatus
parent
405b82af
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
5 deletions
+3
-5
app/models/ci/build.rb
app/models/ci/build.rb
+0
-4
app/models/commit_status.rb
app/models/commit_status.rb
+2
-0
lib/api/builds.rb
lib/api/builds.rb
+1
-1
No files found.
app/models/ci/build.rb
View file @
2c7d9cfa
...
@@ -97,10 +97,6 @@ module Ci
...
@@ -97,10 +97,6 @@ module Ci
new_build
.
save
new_build
.
save
new_build
new_build
end
end
def
available_statuses
state_machines
[
:status
].
states
.
map
&
:value
end
end
end
state_machine
:status
,
initial: :pending
do
state_machine
:status
,
initial: :pending
do
...
...
app/models/commit_status.rb
View file @
2c7d9cfa
...
@@ -56,6 +56,8 @@ class CommitStatus < ActiveRecord::Base
...
@@ -56,6 +56,8 @@ class CommitStatus < ActiveRecord::Base
scope
:ordered
,
->
{
order
(
:ref
,
:stage_idx
,
:name
)
}
scope
:ordered
,
->
{
order
(
:ref
,
:stage_idx
,
:name
)
}
scope
:for_ref
,
->
(
ref
)
{
where
(
ref:
ref
)
}
scope
:for_ref
,
->
(
ref
)
{
where
(
ref:
ref
)
}
AVAILABLE_STATUSES
=
[
'pending'
,
'running'
,
'success'
,
'failed'
,
'canceled'
]
state_machine
:status
,
initial: :pending
do
state_machine
:status
,
initial: :pending
do
event
:run
do
event
:run
do
transition
pending: :running
transition
pending: :running
...
...
lib/api/builds.rb
View file @
2c7d9cfa
...
@@ -125,7 +125,7 @@ module API
...
@@ -125,7 +125,7 @@ module API
def
filter_builds
(
builds
,
scope
)
def
filter_builds
(
builds
,
scope
)
return
builds
if
scope
.
nil?
||
scope
.
empty?
return
builds
if
scope
.
nil?
||
scope
.
empty?
available_statuses
=
Ci
::
Build
.
available_statuses
available_statuses
=
::
CommitStatus
::
AVAILABLE_STATUSES
scope
=
scope
=
if
scope
.
is_a?
(
String
)
if
scope
.
is_a?
(
String
)
[
scope
]
[
scope
]
...
...
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