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
b306a521
Commit
b306a521
authored
Jul 12, 2016
by
Connor Shea
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add with_warnings? method to Pipelines and add tests.
parent
f668a785
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
0 deletions
+35
-0
CHANGELOG
CHANGELOG
+1
-0
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+2
-0
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+6
-0
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+26
-0
No files found.
CHANGELOG
View file @
b306a521
...
@@ -23,6 +23,7 @@ v 8.10.0 (unreleased)
...
@@ -23,6 +23,7 @@ v 8.10.0 (unreleased)
- Store when and yaml variables in builds table
- Store when and yaml variables in builds table
- Display last commit of deleted branch in push events !4699 (winniehell)
- Display last commit of deleted branch in push events !4699 (winniehell)
- Escape file extension when parsing search results !5141 (winniehell)
- Escape file extension when parsing search results !5141 (winniehell)
- Add "passing with warnings" to the merge request pipeline possible statuses, this happens when builds that allow failures have failed. !5004
- Apply the trusted_proxies config to the rack request object for use with rack_attack
- Apply the trusted_proxies config to the rack request object for use with rack_attack
- Upgrade to Rails 4.2.7. !5236
- Upgrade to Rails 4.2.7. !5236
- Allow to pull code with deploy key from public projects
- Allow to pull code with deploy key from public projects
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
b306a521
...
@@ -286,6 +286,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -286,6 +286,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController
status
=
pipeline
.
status
status
=
pipeline
.
status
coverage
=
pipeline
.
try
(
:coverage
)
coverage
=
pipeline
.
try
(
:coverage
)
status
=
"success_with_warnings"
if
pipeline
.
success?
&&
pipeline
.
with_warnings?
status
||=
"preparing"
status
||=
"preparing"
else
else
ci_service
=
@merge_request
.
source_project
.
ci_service
ci_service
=
@merge_request
.
source_project
.
ci_service
...
...
app/models/ci/pipeline.rb
View file @
b306a521
...
@@ -146,6 +146,12 @@ module Ci
...
@@ -146,6 +146,12 @@ module Ci
end
end
end
end
def
with_warnings?
builds
.
latest
.
any?
do
|
build
|
build
.
failed?
&&
build
.
allow_failure
end
end
def
config_processor
def
config_processor
return
nil
unless
ci_yaml_file
return
nil
unless
ci_yaml_file
return
@config_processor
if
defined?
(
@config_processor
)
return
@config_processor
if
defined?
(
@config_processor
)
...
...
spec/models/ci/pipeline_spec.rb
View file @
b306a521
...
@@ -502,4 +502,30 @@ describe Ci::Pipeline, models: true do
...
@@ -502,4 +502,30 @@ describe Ci::Pipeline, models: true do
end
end
end
end
end
end
describe
'#with_warnings?'
do
subject
{
pipeline
.
with_warnings?
}
context
'build which is allowed to fail fails'
do
before
do
FactoryGirl
.
create
:ci_build
,
:success
,
pipeline:
pipeline
,
name:
'rspec'
FactoryGirl
.
create
:ci_build
,
:allowed_to_fail
,
:failed
,
pipeline:
pipeline
,
name:
'rubocop'
end
it
'returns true'
do
is_expected
.
to
be_truthy
end
end
context
'build which is allowed to fail succeeds'
do
before
do
FactoryGirl
.
create
:ci_build
,
:success
,
pipeline:
pipeline
,
name:
'rspec'
FactoryGirl
.
create
:ci_build
,
:allowed_to_fail
,
:success
,
pipeline:
pipeline
,
name:
'rubocop'
end
it
'returns false'
do
is_expected
.
to
be_falsey
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