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
5ca4e1ec
Commit
5ca4e1ec
authored
Aug 02, 2021
by
Lucas Charles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'use-ref-instead-of-sha-in-pipeline-config-for-variables' into 'master'"
This reverts merge request !67262
parent
6a1d05d4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
lib/gitlab/ci/config.rb
lib/gitlab/ci/config.rb
+3
-3
spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
+1
-0
spec/services/ci/create_pipeline_service_spec.rb
spec/services/ci/create_pipeline_service_spec.rb
+2
-2
No files found.
lib/gitlab/ci/config.rb
View file @
5ca4e1ec
...
@@ -20,7 +20,7 @@ module Gitlab
...
@@ -20,7 +20,7 @@ module Gitlab
attr_reader
:root
,
:context
,
:ref
,
:source
attr_reader
:root
,
:context
,
:ref
,
:source
def
initialize
(
config
,
project:
nil
,
sha:
nil
,
user:
nil
,
parent_pipeline:
nil
,
ref:
nil
,
source:
nil
)
def
initialize
(
config
,
project:
nil
,
sha:
nil
,
user:
nil
,
parent_pipeline:
nil
,
ref:
nil
,
source:
nil
)
@context
=
build_context
(
project:
project
,
sha:
sha
,
user:
user
,
parent_pipeline:
parent_pipeline
,
ref:
ref
)
@context
=
build_context
(
project:
project
,
sha:
sha
,
user:
user
,
parent_pipeline:
parent_pipeline
)
@context
.
set_deadline
(
TIMEOUT_SECONDS
)
@context
.
set_deadline
(
TIMEOUT_SECONDS
)
@ref
=
ref
@ref
=
ref
...
@@ -108,13 +108,13 @@ module Gitlab
...
@@ -108,13 +108,13 @@ module Gitlab
end
end
end
end
def
build_context
(
project
:,
sha
:,
user
:,
parent_pipeline
:
,
ref
:
)
def
build_context
(
project
:,
sha
:,
user
:,
parent_pipeline
:)
Config
::
External
::
Context
.
new
(
Config
::
External
::
Context
.
new
(
project:
project
,
project:
project
,
sha:
sha
||
find_sha
(
project
),
sha:
sha
||
find_sha
(
project
),
user:
user
,
user:
user
,
parent_pipeline:
parent_pipeline
,
parent_pipeline:
parent_pipeline
,
variables:
build_variables
(
project:
project
,
ref:
ref
))
variables:
build_variables
(
project:
project
,
ref:
sha
))
end
end
def
build_variables
(
project
:,
ref
:)
def
build_variables
(
project
:,
ref
:)
...
...
spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
View file @
5ca4e1ec
...
@@ -107,6 +107,7 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Populate do
...
@@ -107,6 +107,7 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Populate do
context
'when ref is protected'
do
context
'when ref is protected'
do
before
do
before
do
allow
(
project
).
to
receive
(
:protected_for?
).
with
(
'master'
).
and_return
(
true
)
allow
(
project
).
to
receive
(
:protected_for?
).
with
(
'master'
).
and_return
(
true
)
allow
(
project
).
to
receive
(
:protected_for?
).
with
(
'b83d6e391c22777fca1ed3012fce84f633d7fed0'
).
and_return
(
true
)
allow
(
project
).
to
receive
(
:protected_for?
).
with
(
'refs/heads/master'
).
and_return
(
true
)
allow
(
project
).
to
receive
(
:protected_for?
).
with
(
'refs/heads/master'
).
and_return
(
true
)
dependencies
.
map
(
&
:perform!
)
dependencies
.
map
(
&
:perform!
)
...
...
spec/services/ci/create_pipeline_service_spec.rb
View file @
5ca4e1ec
...
@@ -1328,7 +1328,7 @@ RSpec.describe Ci::CreatePipelineService do
...
@@ -1328,7 +1328,7 @@ RSpec.describe Ci::CreatePipelineService do
end
end
context
'when ref is tag'
do
context
'when ref is tag'
do
let
(
:ref_name
)
{
'refs/tags/v1.
0
.0'
}
let
(
:ref_name
)
{
'refs/tags/v1.
1
.0'
}
it
'does not create an extrnal pull request pipeline'
,
:aggregate_failures
do
it
'does not create an extrnal pull request pipeline'
,
:aggregate_failures
do
expect
(
response
).
to
be_error
expect
(
response
).
to
be_error
...
@@ -1516,7 +1516,7 @@ RSpec.describe Ci::CreatePipelineService do
...
@@ -1516,7 +1516,7 @@ RSpec.describe Ci::CreatePipelineService do
end
end
context
'when ref is tag'
do
context
'when ref is tag'
do
let
(
:ref_name
)
{
'refs/tags/v1.
0
.0'
}
let
(
:ref_name
)
{
'refs/tags/v1.
1
.0'
}
it
'does not create a merge request pipeline'
,
:aggregate_failures
do
it
'does not create a merge request pipeline'
,
:aggregate_failures
do
expect
(
response
).
to
be_error
expect
(
response
).
to
be_error
...
...
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