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
5d5a2674
Commit
5d5a2674
authored
Sep 02, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
a3bdff7c
6e744f70
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
1 deletion
+26
-1
changelogs/unreleased/sh-fix-ci-lint-500-error.yml
changelogs/unreleased/sh-fix-ci-lint-500-error.yml
+5
-0
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+8
-0
lib/gitlab/ci/config/external/file/base.rb
lib/gitlab/ci/config/external/file/base.rb
+7
-1
spec/lib/gitlab/ci/config/external/file/base_spec.rb
spec/lib/gitlab/ci/config/external/file/base_spec.rb
+6
-0
No files found.
changelogs/unreleased/sh-fix-ci-lint-500-error.yml
0 → 100644
View file @
5d5a2674
---
title
:
Fix 500 error in CI lint when included templates are an array
merge_request
:
32232
author
:
type
:
fixed
doc/ci/yaml/README.md
View file @
5d5a2674
...
@@ -2171,6 +2171,14 @@ include:
...
@@ -2171,6 +2171,14 @@ include:
-
template
:
Auto-DevOps.gitlab-ci.yml
-
template
:
Auto-DevOps.gitlab-ci.yml
```
```
Multiple
`include:template`
files:
```
yaml
include
:
-
template
:
Android-Fastlane.gitlab-ci.yml
-
template
:
Auto-DevOps.gitlab-ci.yml
```
All
[
nested includes
](
#nested-includes
)
will be executed only with the permission of the user,
All
[
nested includes
](
#nested-includes
)
will be executed only with the permission of the user,
so it is possible to use project, remote or template includes.
so it is possible to use project, remote or template includes.
...
...
lib/gitlab/ci/config/external/file/base.rb
View file @
5d5a2674
...
@@ -26,6 +26,10 @@ module Gitlab
...
@@ -26,6 +26,10 @@ module Gitlab
location
.
present?
location
.
present?
end
end
def
invalid_location_type?
!
location
.
is_a?
(
String
)
end
def
invalid_extension?
def
invalid_extension?
location
.
nil?
||
!::
File
.
basename
(
location
).
match?
(
YAML_WHITELIST_EXTENSION
)
location
.
nil?
||
!::
File
.
basename
(
location
).
match?
(
YAML_WHITELIST_EXTENSION
)
end
end
...
@@ -71,7 +75,9 @@ module Gitlab
...
@@ -71,7 +75,9 @@ module Gitlab
end
end
def
validate_location!
def
validate_location!
if
invalid_extension?
if
invalid_location_type?
errors
.
push
(
"Included file `
#{
location
}
` needs to be a string"
)
elsif
invalid_extension?
errors
.
push
(
"Included file `
#{
location
}
` does not have YAML extension!"
)
errors
.
push
(
"Included file `
#{
location
}
` does not have YAML extension!"
)
end
end
end
end
...
...
spec/lib/gitlab/ci/config/external/file/base_spec.rb
View file @
5d5a2674
...
@@ -41,6 +41,12 @@ describe Gitlab::Ci::Config::External::File::Base do
...
@@ -41,6 +41,12 @@ describe Gitlab::Ci::Config::External::File::Base do
end
end
describe
'#valid?'
do
describe
'#valid?'
do
context
'when location is not a string'
do
let
(
:location
)
{
%w(some/file.txt other/file.txt)
}
it
{
is_expected
.
not_to
be_valid
}
end
context
'when location is not a YAML file'
do
context
'when location is not a YAML file'
do
let
(
:location
)
{
'some/file.txt'
}
let
(
:location
)
{
'some/file.txt'
}
...
...
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