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
Boxiang Sun
gitlab-ce
Commits
d47aef58
Commit
d47aef58
authored
Dec 05, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Ci::Status::Stage
parent
2f972ad4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
0 deletions
+65
-0
app/models/ci/stage.rb
app/models/ci/stage.rb
+2
-0
lib/gitlab/ci/status/stage/common.rb
lib/gitlab/ci/status/stage/common.rb
+24
-0
lib/gitlab/ci/status/stage/factory.rb
lib/gitlab/ci/status/stage/factory.rb
+39
-0
No files found.
app/models/ci/stage.rb
View file @
d47aef58
...
...
@@ -6,6 +6,8 @@ module Ci
attr_reader
:pipeline
,
:name
delegate
:project
,
to: :pipeline
def
initialize
(
pipeline
,
name:
name
,
status:
nil
)
@pipeline
,
@name
,
@status
=
pipeline
,
name
,
status
end
...
...
lib/gitlab/ci/status/stage/common.rb
0 → 100644
View file @
d47aef58
module
Gitlab
module
Ci
module
Status
module
Stage
module
Common
def
has_details?
true
end
def
details_path
namespace_project_pipeline_path
(
@subject
.
project
.
namespace
,
@subject
.
project
,
@subject
,
anchor:
subject
.
name
)
end
def
has_action?
false
end
end
end
end
end
end
lib/gitlab/ci/status/stage/factory.rb
0 → 100644
View file @
d47aef58
module
Gitlab
module
Ci
module
Status
module
Stage
class
Factory
EXTENDED_STATUSES
=
[]
def
initialize
(
stage
)
@stage
=
stage
@status
=
stage
.
status
||
:created
end
def
fabricate!
if
extended_status
extended_status
.
new
(
core_status
)
else
core_status
end
end
private
def
core_status
Gitlab
::
Ci
::
Status
.
const_get
(
@status
.
capitalize
)
.
new
(
@stage
)
.
extend
(
Status
::
Pipeline
::
Common
)
end
def
extended_status
@extended
||=
EXTENDED_STATUSES
.
find
do
|
status
|
status
.
matches?
(
@stage
)
end
end
end
end
end
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