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
7316400f
Commit
7316400f
authored
Oct 05, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify needs value transformation
parent
a02fe0d5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
8 deletions
+4
-8
ee/spec/lib/ee/gitlab/ci/config/entry/bridge_spec.rb
ee/spec/lib/ee/gitlab/ci/config/entry/bridge_spec.rb
+1
-1
ee/spec/lib/ee/gitlab/ci/config/entry/needs_spec.rb
ee/spec/lib/ee/gitlab/ci/config/entry/needs_spec.rb
+1
-1
lib/gitlab/ci/config/entry/needs.rb
lib/gitlab/ci/config/entry/needs.rb
+1
-5
lib/gitlab/ci/yaml_processor.rb
lib/gitlab/ci/yaml_processor.rb
+1
-1
No files found.
ee/spec/lib/ee/gitlab/ci/config/entry/bridge_spec.rb
View file @
7316400f
...
...
@@ -88,7 +88,7 @@ describe EE::Gitlab::Ci::Config::Entry::Bridge do
describe
'#value'
do
it
'is returns a bridge job configuration'
do
expect
(
subject
.
value
).
to
eq
(
name: :my_bridge
,
needs:
{
bridge:
{
pipeline:
'some/project'
}
},
needs:
{
bridge:
[{
pipeline:
'some/project'
}]
},
ignore:
false
,
stage:
'test'
,
only:
{
refs:
%w[branches tags]
})
...
...
ee/spec/lib/ee/gitlab/ci/config/entry/needs_spec.rb
View file @
7316400f
...
...
@@ -52,7 +52,7 @@ describe ::Gitlab::Ci::Config::Entry::Needs do
describe
'#value'
do
it
'returns key value'
do
expect
(
needs
.
value
).
to
eq
(
pipeline:
[{
name:
'first_job_name'
}],
bridge:
{
pipeline:
'some/project'
}
)
expect
(
needs
.
value
).
to
eq
(
pipeline:
[{
name:
'first_job_name'
}],
bridge:
[{
pipeline:
'some/project'
}]
)
end
end
...
...
lib/gitlab/ci/config/entry/needs.rb
View file @
7316400f
...
...
@@ -58,13 +58,9 @@ module Gitlab
end
def
value
values
=
@entries
.
values
.
group_by
(
&
:type
).
transform_values
do
|
values
|
@entries
.
values
.
group_by
(
&
:type
).
transform_values
do
|
values
|
values
.
map
(
&
:value
)
end
values
.
tap
do
|
values_hash
|
values_hash
[
:bridge
]
=
values_hash
[
:bridge
].
first
if
values_hash
[
:bridge
]
end
end
end
end
...
...
lib/gitlab/ci/yaml_processor.rb
View file @
7316400f
...
...
@@ -59,7 +59,7 @@ module Gitlab
instance:
job
[
:instance
],
start_in:
job
[
:start_in
],
trigger:
job
[
:trigger
],
bridge_needs:
job
.
dig
(
:needs
,
:bridge
)
bridge_needs:
job
.
dig
(
:needs
,
:bridge
)
&
.
first
}.
compact
}.
compact
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