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
3bb830f2
Commit
3bb830f2
authored
Dec 20, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
e1e13918
f7ac8041
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
19 deletions
+4
-19
app/models/project.rb
app/models/project.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+3
-18
No files found.
app/models/project.rb
View file @
3bb830f2
...
...
@@ -256,7 +256,7 @@ class Project < ActiveRecord::Base
# other pipelines, like webide ones, that we won't retrieve
# if we use this relation.
has_many
:ci_pipelines
,
->
{
Feature
.
enabled?
(
:pipeline_ci_sources_only
,
default_enabled:
true
)
?
ci_sources
:
all
},
->
{
ci_sources
},
class_name:
'Ci::Pipeline'
,
inverse_of: :project
has_many
:stages
,
class_name:
'Ci::Stage'
,
inverse_of: :project
...
...
spec/models/project_spec.rb
View file @
3bb830f2
...
...
@@ -160,25 +160,10 @@ describe Project do
end
describe
'ci_pipelines association'
do
context
'when feature flag pipeline_ci_sources_only is enabled'
do
it
'returns only pipelines from ci_sources'
do
stub_feature_flags
(
pipeline_ci_sources_only:
true
)
expect
(
Ci
::
Pipeline
).
to
receive
(
:ci_sources
).
and_call_original
subject
.
ci_pipelines
end
end
it
'returns only pipelines from ci_sources'
do
expect
(
Ci
::
Pipeline
).
to
receive
(
:ci_sources
).
and_call_original
context
'when feature flag pipeline_ci_sources_only is disabled'
do
it
'returns all pipelines'
do
stub_feature_flags
(
pipeline_ci_sources_only:
false
)
expect
(
Ci
::
Pipeline
).
not_to
receive
(
:ci_sources
).
and_call_original
expect
(
Ci
::
Pipeline
).
to
receive
(
:all
).
and_call_original
.
at_least
(
:once
)
subject
.
ci_pipelines
end
subject
.
ci_pipelines
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