BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c45ace89
Unverified
Commit
c45ace89
authored
Sep 06, 2017
by
Maxim Rydkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move `lib/ci/gitlab_ci_yaml_processor.rb` into `lib/gitlab/ci/yaml_processor.rb`
parent
c295d336
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
11 deletions
+13
-11
lints_controller.rb
app/controllers/ci/lints_controller.rb
+2
-2
gitlab_ci_yml.rb
app/models/blob_viewer/gitlab_ci_yml.rb
+1
-1
pipeline.rb
app/models/ci/pipeline.rb
+2
-2
lint.rb
lib/api/lint.rb
+1
-1
yaml_processor.rb
lib/gitlab/ci/yaml_processor.rb
+5
-3
yaml_processor_spec.rb
spec/lib/gitlab/ci/yaml_processor_spec.rb
+0
-0
show.html.haml_spec.rb
spec/views/ci/lints/show.html.haml_spec.rb
+2
-2
No files found.
app/controllers/ci/lints_controller.rb
View file @
c45ace89
...
...
@@ -7,11 +7,11 @@ module Ci
def
create
@content
=
params
[
:content
]
@error
=
Ci
::
GitlabCi
YamlProcessor
.
validation_message
(
@content
)
@error
=
Gitlab
::
Ci
::
YamlProcessor
.
validation_message
(
@content
)
@status
=
@error
.
blank?
if
@error
.
blank?
@config_processor
=
Ci
::
GitlabCi
YamlProcessor
.
new
(
@content
)
@config_processor
=
Gitlab
::
Ci
::
YamlProcessor
.
new
(
@content
)
@stages
=
@config_processor
.
stages
@builds
=
@config_processor
.
builds
@jobs
=
@config_processor
.
jobs
...
...
app/models/blob_viewer/gitlab_ci_yml.rb
View file @
c45ace89
...
...
@@ -13,7 +13,7 @@ module BlobViewer
prepare!
@validation_message
=
Ci
::
GitlabCi
YamlProcessor
.
validation_message
(
blob
.
data
)
@validation_message
=
Gitlab
::
Ci
::
YamlProcessor
.
validation_message
(
blob
.
data
)
end
def
valid?
...
...
app/models/ci/pipeline.rb
View file @
c45ace89
...
...
@@ -336,8 +336,8 @@ module Ci
return
@config_processor
if
defined?
(
@config_processor
)
@config_processor
||=
begin
Ci
::
GitlabCi
YamlProcessor
.
new
(
ci_yaml_file
,
project
.
full_path
)
rescue
Ci
::
GitlabCi
YamlProcessor
::
ValidationError
,
Psych
::
SyntaxError
=>
e
Gitlab
::
Ci
::
YamlProcessor
.
new
(
ci_yaml_file
,
project
.
full_path
)
rescue
Gitlab
::
Ci
::
YamlProcessor
::
ValidationError
,
Psych
::
SyntaxError
=>
e
self
.
yaml_errors
=
e
.
message
nil
rescue
...
...
lib/api/lint.rb
View file @
c45ace89
...
...
@@ -6,7 +6,7 @@ module API
requires
:content
,
type:
String
,
desc:
'Content of .gitlab-ci.yml'
end
post
'/lint'
do
error
=
Ci
::
GitlabCi
YamlProcessor
.
validation_message
(
params
[
:content
])
error
=
Gitlab
::
Ci
::
YamlProcessor
.
validation_message
(
params
[
:content
])
status
200
...
...
lib/
ci/gitlab_ci_
yaml_processor.rb
→
lib/
gitlab/ci/
yaml_processor.rb
View file @
c45ace89
module
Ci
class
GitlabCiYamlProcessor
module
Gitlab
module
Ci
class
YamlProcessor
ValidationError
=
Class
.
new
(
StandardError
)
include
Gitlab
::
Ci
::
Config
::
Entry
::
LegacyValidationHelpers
...
...
@@ -73,7 +74,7 @@ module Ci
return
'Please provide content of .gitlab-ci.yml'
if
content
.
blank?
begin
Ci
::
GitlabCi
YamlProcessor
.
new
(
content
)
Gitlab
::
Ci
::
YamlProcessor
.
new
(
content
)
nil
rescue
ValidationError
,
Psych
::
SyntaxError
=>
e
e
.
message
...
...
@@ -248,4 +249,5 @@ module Ci
end
end
end
end
end
spec/lib/
ci/gitlab_ci_
yaml_processor_spec.rb
→
spec/lib/
gitlab/ci/
yaml_processor_spec.rb
View file @
c45ace89
This diff is collapsed.
Click to expand it.
spec/views/ci/lints/show.html.haml_spec.rb
View file @
c45ace89
...
...
@@ -4,7 +4,7 @@ describe 'ci/lints/show' do
include
Devise
::
Test
::
ControllerHelpers
describe
'XSS protection'
do
let
(
:config_processor
)
{
Ci
::
GitlabCi
YamlProcessor
.
new
(
YAML
.
dump
(
content
))
}
let
(
:config_processor
)
{
Gitlab
::
Ci
::
YamlProcessor
.
new
(
YAML
.
dump
(
content
))
}
before
do
assign
(
:status
,
true
)
assign
(
:builds
,
config_processor
.
builds
)
...
...
@@ -59,7 +59,7 @@ describe 'ci/lints/show' do
}
end
let
(
:config_processor
)
{
Ci
::
GitlabCi
YamlProcessor
.
new
(
YAML
.
dump
(
content
))
}
let
(
:config_processor
)
{
Gitlab
::
Ci
::
YamlProcessor
.
new
(
YAML
.
dump
(
content
))
}
context
'when the content is valid'
do
before
do
...
...
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