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
63759af3
Commit
63759af3
authored
Aug 04, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename needs to bridge_needs internally
parent
45ebde4d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
13 additions
and
9 deletions
+13
-9
ee/app/models/ee/ci/bridge.rb
ee/app/models/ee/ci/bridge.rb
+1
-1
ee/spec/models/ci/bridge_spec.rb
ee/spec/models/ci/bridge_spec.rb
+1
-1
ee/spec/services/ci/subscribe_bridge_service_spec.rb
ee/spec/services/ci/subscribe_bridge_service_spec.rb
+1
-1
lib/gitlab/ci/pipeline/seed/build.rb
lib/gitlab/ci/pipeline/seed/build.rb
+2
-1
lib/gitlab/ci/yaml_processor.rb
lib/gitlab/ci/yaml_processor.rb
+1
-1
spec/factories/ci/bridge.rb
spec/factories/ci/bridge.rb
+1
-1
spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
+2
-2
spec/lib/gitlab/ci/yaml_processor_spec.rb
spec/lib/gitlab/ci/yaml_processor_spec.rb
+4
-1
No files found.
ee/app/models/ee/ci/bridge.rb
View file @
63759af3
...
...
@@ -99,7 +99,7 @@ module EE
def
upstream_project
strong_memoize
(
:upstream_project
)
do
options
&
.
dig
(
:needs
,
:pipeline
)
options
&
.
dig
(
:
bridge_
needs
,
:pipeline
)
end
end
...
...
ee/spec/models/ci/bridge_spec.rb
View file @
63759af3
...
...
@@ -39,7 +39,7 @@ describe Ci::Bridge do
context
'when bridge points towards upstream'
do
before
do
bridge
.
options
=
{
needs:
{
pipeline:
'my/project'
}
}
bridge
.
options
=
{
bridge_
needs:
{
pipeline:
'my/project'
}
}
end
it
'subscribes to the upstream project'
do
...
...
ee/spec/services/ci/subscribe_bridge_service_spec.rb
View file @
63759af3
...
...
@@ -77,7 +77,7 @@ describe Ci::SubscribeBridgeService do
let
(
:upstream_project
)
{
nil
}
before
do
bridge
.
options
=
{
needs:
{
pipeline:
'some/project'
}
}
bridge
.
options
=
{
bridge_
needs:
{
pipeline:
'some/project'
}
}
end
it
'drops the bridge'
do
...
...
lib/gitlab/ci/pipeline/seed/build.rb
View file @
63759af3
...
...
@@ -41,7 +41,8 @@ module Gitlab
def
bridge?
attributes_hash
=
@attributes
.
to_h
attributes_hash
.
dig
(
:options
,
:trigger
).
present?
||
attributes_hash
.
dig
(
:options
,
:needs
,
:pipeline
).
present?
(
attributes_hash
.
dig
(
:options
,
:bridge_needs
).
instance_of?
(
Hash
)
&&
attributes_hash
.
dig
(
:options
,
:bridge_needs
,
:pipeline
).
present?
)
end
def
to_resource
...
...
lib/gitlab/ci/yaml_processor.rb
View file @
63759af3
...
...
@@ -56,7 +56,7 @@ module Gitlab
instance:
job
[
:instance
],
start_in:
job
[
:start_in
],
trigger:
job
[
:trigger
],
needs:
job
[
:needs
]
bridge_
needs:
job
[
:needs
]
}.
compact
}.
compact
end
...
...
spec/factories/ci/bridge.rb
View file @
63759af3
...
...
@@ -30,7 +30,7 @@ FactoryBot.define do
if
evaluator
.
upstream
.
present?
bridge
.
options
=
bridge
.
options
.
to_h
.
merge
(
needs:
{
pipeline:
evaluator
.
upstream
.
full_path
}
bridge_
needs:
{
pipeline:
evaluator
.
upstream
.
full_path
}
)
end
end
...
...
spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
View file @
63759af3
...
...
@@ -37,14 +37,14 @@ describe Gitlab::Ci::Pipeline::Seed::Build do
context
'when job is an upstream bridge'
do
let
(
:attributes
)
do
{
name:
'rspec'
,
ref:
'master'
,
options:
{
needs:
{
pipeline:
'my/project'
}
}
}
{
name:
'rspec'
,
ref:
'master'
,
options:
{
bridge_
needs:
{
pipeline:
'my/project'
}
}
}
end
it
{
is_expected
.
to
be_truthy
}
context
'when upstream definition is empty'
do
let
(
:attributes
)
do
{
name:
'rspec'
,
ref:
'master'
,
options:
{
needs:
{
pipeline:
''
}
}
}
{
name:
'rspec'
,
ref:
'master'
,
options:
{
bridge_
needs:
{
pipeline:
''
}
}
}
end
it
{
is_expected
.
to
be_falsey
}
...
...
spec/lib/gitlab/ci/yaml_processor_spec.rb
View file @
63759af3
...
...
@@ -1153,7 +1153,10 @@ module Gitlab
stage_idx:
1
,
name:
"test1"
,
options:
{
script:
[
"test"
]
script:
[
"test"
],
# This does not make sense, there is a follow-up:
# https://gitlab.com/gitlab-org/gitlab-ce/issues/65569
bridge_needs:
%w[build1 build2]
},
needs_attributes:
[
{
name:
"build1"
},
...
...
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