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
2135f504
Commit
2135f504
authored
Aug 02, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
b7ea4864
8156e77c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
12 deletions
+21
-12
app/models/ci/build.rb
app/models/ci/build.rb
+6
-10
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+15
-2
No files found.
app/models/ci/build.rb
View file @
2135f504
...
...
@@ -715,18 +715,14 @@ module Ci
depended_jobs
=
depends_on_builds
# find all jobs that are dependent on
if
options
[
:dependencies
].
present?
depended_jobs
=
depended_jobs
.
select
do
|
job
|
options
[
:dependencies
].
include?
(
job
.
name
)
end
# find all jobs that are needed
if
Feature
.
enabled?
(
:ci_dag_support
,
project
)
&&
needs
.
exists?
depended_jobs
=
depended_jobs
.
where
(
name:
needs
.
select
(
:name
))
end
# find all jobs that are needed by this one
if
options
[
:needs
].
present?
depended_jobs
=
depended_jobs
.
select
do
|
job
|
options
[
:needs
].
include?
(
job
.
name
)
end
# find all jobs that are dependent on
if
options
[
:dependencies
].
present?
depended_jobs
=
depended_jobs
.
where
(
name:
options
[
:dependencies
])
end
depended_jobs
...
...
spec/models/ci/build_spec.rb
View file @
2135f504
...
...
@@ -630,12 +630,17 @@ describe Ci::Build do
create
(
:ci_build
,
pipeline:
pipeline
,
name:
'final'
,
stage_idx:
3
,
stage:
'deploy'
,
options:
{
dependencies:
dependencies
,
needs:
needs
dependencies:
dependencies
}
)
end
before
do
needs
.
to_a
.
each
do
|
need
|
create
(
:ci_build_need
,
build:
final
,
name:
need
)
end
end
subject
{
final
.
dependencies
}
context
'when depedencies are defined'
do
...
...
@@ -648,6 +653,14 @@ describe Ci::Build do
let
(
:needs
)
{
%w(build rspec staging)
}
it
{
is_expected
.
to
contain_exactly
(
build
,
rspec_test
,
staging
)
}
context
'when ci_dag_support is disabled'
do
before
do
stub_feature_flags
(
ci_dag_support:
false
)
end
it
{
is_expected
.
to
contain_exactly
(
build
,
rspec_test
,
rubocop_test
,
staging
)
}
end
end
context
'when needs and dependencies are defined'
do
...
...
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