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
23bed91b
Commit
23bed91b
authored
Aug 25, 2016
by
De Wet Blomerus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename Statuseable to HasStatus
parent
6fb46b60
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+1
-1
app/models/commit_status.rb
app/models/commit_status.rb
+1
-1
app/models/concerns/has_status.rb
app/models/concerns/has_status.rb
+1
-1
app/services/ci/process_pipeline_service.rb
app/services/ci/process_pipeline_service.rb
+1
-1
spec/models/concerns/has_status_spec.rb
spec/models/concerns/has_status_spec.rb
+3
-3
No files found.
app/models/ci/pipeline.rb
View file @
23bed91b
module
Ci
class
Pipeline
<
ActiveRecord
::
Base
extend
Ci
::
Model
include
Statuseable
include
HasStatus
self
.
table_name
=
'ci_commits'
...
...
app/models/commit_status.rb
View file @
23bed91b
class
CommitStatus
<
ActiveRecord
::
Base
include
Statuseable
include
HasStatus
include
Importable
self
.
table_name
=
'ci_builds'
...
...
app/models/concerns/
statuseable
.rb
→
app/models/concerns/
has_status
.rb
View file @
23bed91b
module
Statuseable
module
HasStatus
extend
ActiveSupport
::
Concern
AVAILABLE_STATUSES
=
%w[created pending running success failed canceled skipped]
...
...
app/services/ci/process_pipeline_service.rb
View file @
23bed91b
...
...
@@ -34,7 +34,7 @@ module Ci
end
def
process_build
(
build
,
current_status
)
return
false
unless
Statuseable
::
COMPLETED_STATUSES
.
include?
(
current_status
)
return
false
unless
HasStatus
::
COMPLETED_STATUSES
.
include?
(
current_status
)
if
valid_statuses_for_when
(
build
.
when
).
include?
(
current_status
)
build
.
enqueue
...
...
spec/models/concerns/
statuseable
_spec.rb
→
spec/models/concerns/
has_status
_spec.rb
View file @
23bed91b
require
'spec_helper'
describe
Statuseable
do
describe
HasStatus
do
before
do
@object
=
Object
.
new
@object
.
extend
(
Statuseable
::
ClassMethods
)
@object
.
extend
(
HasStatus
::
ClassMethods
)
end
describe
'.status'
do
...
...
@@ -12,7 +12,7 @@ describe Statuseable do
end
subject
{
@object
.
status
}
shared_examples
'build status summary'
do
context
'all successful'
do
let
(
:statuses
)
{
Array
.
new
(
2
)
{
create
(
type
,
status: :success
)
}
}
...
...
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