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
c1b8f3a2
Commit
c1b8f3a2
authored
Oct 26, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass class as parameter to Simplifiable
parent
ec3b5087
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
ee/lib/ee/gitlab/ci/config/entry/need.rb
ee/lib/ee/gitlab/ci/config/entry/need.rb
+1
-1
lib/gitlab/config/entry/simplifiable.rb
lib/gitlab/config/entry/simplifiable.rb
+3
-3
spec/lib/gitlab/ci/yaml_processor_spec.rb
spec/lib/gitlab/ci/yaml_processor_spec.rb
+4
-4
No files found.
ee/lib/ee/gitlab/ci/config/entry/need.rb
View file @
c1b8f3a2
...
...
@@ -9,7 +9,7 @@ module EE
extend
ActiveSupport
::
Concern
prepended
do
strategy
:Bridge
,
if:
->
(
config
)
{
config
.
is_a?
(
Hash
)
}
strategy
:Bridge
,
class:
EE
::
Gitlab
::
Ci
::
Config
::
Entry
::
Need
::
Bridge
,
if:
->
(
config
)
{
config
.
is_a?
(
Hash
)
}
end
class
Bridge
<
::
Gitlab
::
Config
::
Entry
::
Node
...
...
lib/gitlab/config/entry/simplifiable.rb
View file @
c1b8f3a2
...
...
@@ -4,7 +4,7 @@ module Gitlab
module
Config
module
Entry
class
Simplifiable
<
SimpleDelegator
EntryStrategy
=
Struct
.
new
(
:name
,
:condition
)
EntryStrategy
=
Struct
.
new
(
:name
,
:
klass
,
:
condition
)
attr_reader
:subject
...
...
@@ -25,7 +25,7 @@ module Gitlab
end
def
self
.
strategy
(
name
,
**
opts
)
EntryStrategy
.
new
(
name
,
opts
.
fetch
(
:if
)).
tap
do
|
strategy
|
EntryStrategy
.
new
(
name
,
opts
.
dig
(
:class
),
opts
.
fetch
(
:if
)).
tap
do
|
strategy
|
strategies
.
append
(
strategy
)
end
end
...
...
@@ -36,7 +36,7 @@ module Gitlab
def
self
.
entry_class
(
strategy
)
if
strategy
.
present?
self
.
const_get
(
strategy
.
name
,
false
)
s
trategy
.
klass
||
s
elf
.
const_get
(
strategy
.
name
,
false
)
else
self
::
UnknownStrategy
end
...
...
spec/lib/gitlab/ci/yaml_processor_spec.rb
View file @
c1b8f3a2
...
...
@@ -1342,7 +1342,7 @@ module Gitlab
expect
(
subject
.
builds
.
size
).
to
eq
(
2
)
expect
(
subject
.
builds
[
0
]).
to
eq
(
stage:
"build"
,
stage_idx:
0
,
stage_idx:
1
,
name:
"build"
,
options:
{
script:
[
"test"
]
...
...
@@ -1353,7 +1353,7 @@ module Gitlab
)
expect
(
subject
.
builds
[
1
]).
to
eq
(
stage:
"test"
,
stage_idx:
1
,
stage_idx:
2
,
name:
"bridge"
,
options:
{
bridge_needs:
{
pipeline:
'some/project'
}
...
...
@@ -1372,7 +1372,7 @@ module Gitlab
expect
(
subject
.
builds
.
size
).
to
eq
(
2
)
expect
(
subject
.
builds
[
0
]).
to
eq
(
stage:
"build"
,
stage_idx:
0
,
stage_idx:
1
,
name:
"build"
,
options:
{
script:
[
"test"
]
...
...
@@ -1383,7 +1383,7 @@ module Gitlab
)
expect
(
subject
.
builds
[
1
]).
to
eq
(
stage:
"test"
,
stage_idx:
1
,
stage_idx:
2
,
name:
"bridge"
,
options:
{
bridge_needs:
{
pipeline:
'some/project'
}
...
...
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