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
Hide 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
...
@@ -9,7 +9,7 @@ module EE
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
prepended
do
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
end
class
Bridge
<
::
Gitlab
::
Config
::
Entry
::
Node
class
Bridge
<
::
Gitlab
::
Config
::
Entry
::
Node
...
...
lib/gitlab/config/entry/simplifiable.rb
View file @
c1b8f3a2
...
@@ -4,7 +4,7 @@ module Gitlab
...
@@ -4,7 +4,7 @@ module Gitlab
module
Config
module
Config
module
Entry
module
Entry
class
Simplifiable
<
SimpleDelegator
class
Simplifiable
<
SimpleDelegator
EntryStrategy
=
Struct
.
new
(
:name
,
:condition
)
EntryStrategy
=
Struct
.
new
(
:name
,
:
klass
,
:
condition
)
attr_reader
:subject
attr_reader
:subject
...
@@ -25,7 +25,7 @@ module Gitlab
...
@@ -25,7 +25,7 @@ module Gitlab
end
end
def
self
.
strategy
(
name
,
**
opts
)
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
)
strategies
.
append
(
strategy
)
end
end
end
end
...
@@ -36,7 +36,7 @@ module Gitlab
...
@@ -36,7 +36,7 @@ module Gitlab
def
self
.
entry_class
(
strategy
)
def
self
.
entry_class
(
strategy
)
if
strategy
.
present?
if
strategy
.
present?
self
.
const_get
(
strategy
.
name
,
false
)
s
trategy
.
klass
||
s
elf
.
const_get
(
strategy
.
name
,
false
)
else
else
self
::
UnknownStrategy
self
::
UnknownStrategy
end
end
...
...
spec/lib/gitlab/ci/yaml_processor_spec.rb
View file @
c1b8f3a2
...
@@ -1342,7 +1342,7 @@ module Gitlab
...
@@ -1342,7 +1342,7 @@ module Gitlab
expect
(
subject
.
builds
.
size
).
to
eq
(
2
)
expect
(
subject
.
builds
.
size
).
to
eq
(
2
)
expect
(
subject
.
builds
[
0
]).
to
eq
(
expect
(
subject
.
builds
[
0
]).
to
eq
(
stage:
"build"
,
stage:
"build"
,
stage_idx:
0
,
stage_idx:
1
,
name:
"build"
,
name:
"build"
,
options:
{
options:
{
script:
[
"test"
]
script:
[
"test"
]
...
@@ -1353,7 +1353,7 @@ module Gitlab
...
@@ -1353,7 +1353,7 @@ module Gitlab
)
)
expect
(
subject
.
builds
[
1
]).
to
eq
(
expect
(
subject
.
builds
[
1
]).
to
eq
(
stage:
"test"
,
stage:
"test"
,
stage_idx:
1
,
stage_idx:
2
,
name:
"bridge"
,
name:
"bridge"
,
options:
{
options:
{
bridge_needs:
{
pipeline:
'some/project'
}
bridge_needs:
{
pipeline:
'some/project'
}
...
@@ -1372,7 +1372,7 @@ module Gitlab
...
@@ -1372,7 +1372,7 @@ module Gitlab
expect
(
subject
.
builds
.
size
).
to
eq
(
2
)
expect
(
subject
.
builds
.
size
).
to
eq
(
2
)
expect
(
subject
.
builds
[
0
]).
to
eq
(
expect
(
subject
.
builds
[
0
]).
to
eq
(
stage:
"build"
,
stage:
"build"
,
stage_idx:
0
,
stage_idx:
1
,
name:
"build"
,
name:
"build"
,
options:
{
options:
{
script:
[
"test"
]
script:
[
"test"
]
...
@@ -1383,7 +1383,7 @@ module Gitlab
...
@@ -1383,7 +1383,7 @@ module Gitlab
)
)
expect
(
subject
.
builds
[
1
]).
to
eq
(
expect
(
subject
.
builds
[
1
]).
to
eq
(
stage:
"test"
,
stage:
"test"
,
stage_idx:
1
,
stage_idx:
2
,
name:
"bridge"
,
name:
"bridge"
,
options:
{
options:
{
bridge_needs:
{
pipeline:
'some/project'
}
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