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
8b30dd98
Commit
8b30dd98
authored
Jan 09, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract abstract success with warnings CI/CD status
parent
4404ea86
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
3 deletions
+51
-3
lib/gitlab/ci/status/pipeline/factory.rb
lib/gitlab/ci/status/pipeline/factory.rb
+1
-1
lib/gitlab/ci/status/pipeline/success_warning.rb
lib/gitlab/ci/status/pipeline/success_warning.rb
+13
-0
lib/gitlab/ci/status/success_warning.rb
lib/gitlab/ci/status/success_warning.rb
+35
-0
spec/lib/gitlab/ci/status/pipeline/factory_spec.rb
spec/lib/gitlab/ci/status/pipeline/factory_spec.rb
+1
-1
spec/lib/gitlab/ci/status/pipeline/success_warning_spec.rb
spec/lib/gitlab/ci/status/pipeline/success_warning_spec.rb
+1
-1
No files found.
lib/gitlab/ci/status/pipeline/factory.rb
View file @
8b30dd98
...
...
@@ -4,7 +4,7 @@ module Gitlab
module
Pipeline
class
Factory
<
Status
::
Factory
def
self
.
extended_statuses
[
Pipeline
::
SuccessW
ithWarnings
]
[
Pipeline
::
SuccessW
arning
]
end
def
self
.
common_helpers
...
...
lib/gitlab/ci/status/pipeline/success_w
ith_warnings
.rb
→
lib/gitlab/ci/status/pipeline/success_w
arning
.rb
View file @
8b30dd98
...
...
@@ -2,25 +2,7 @@ module Gitlab
module
Ci
module
Status
module
Pipeline
class
SuccessWithWarnings
<
SimpleDelegator
include
Status
::
Extended
def
text
'passed'
end
def
label
'passed with warnings'
end
def
icon
'icon_status_warning'
end
def
group
'success_with_warnings'
end
class
SuccessWarning
<
Status
::
SuccessWarning
def
self
.
matches?
(
pipeline
,
user
)
pipeline
.
success?
&&
pipeline
.
has_warnings?
end
...
...
lib/gitlab/ci/status/success_warning.rb
0 → 100644
View file @
8b30dd98
module
Gitlab
module
Ci
module
Status
##
# Abstract extended status used when pipeline/stage/build passed
# conditionally.
#
# This means that failed jobs that are allowed to fail were present.
#
class
SuccessWarning
<
SimpleDelegator
include
Status
::
Extended
def
text
'passed'
end
def
label
'passed with warnings'
end
def
icon
'icon_status_warning'
end
def
group
'success_with_warnings'
end
def
self
.
matches?
(
subject
,
user
)
raise
NotImplementedError
end
end
end
end
end
spec/lib/gitlab/ci/status/pipeline/factory_spec.rb
View file @
8b30dd98
...
...
@@ -49,7 +49,7 @@ describe Gitlab::Ci::Status::Pipeline::Factory do
it
'fabricates extended "success with warnings" status'
do
expect
(
status
)
.
to
be_a
Gitlab
::
Ci
::
Status
::
Pipeline
::
SuccessW
ithWarnings
.
to
be_a
Gitlab
::
Ci
::
Status
::
Pipeline
::
SuccessW
arning
end
it
'extends core status with common pipeline methods'
do
...
...
spec/lib/gitlab/ci/status/pipeline/success_w
ith_warnings
_spec.rb
→
spec/lib/gitlab/ci/status/pipeline/success_w
arning
_spec.rb
View file @
8b30dd98
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Pipeline
::
SuccessW
ithWarnings
do
describe
Gitlab
::
Ci
::
Status
::
Pipeline
::
SuccessW
arning
do
subject
do
described_class
.
new
(
double
(
'status'
))
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