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
bade5525
Commit
bade5525
authored
Oct 03, 2019
by
Tetiana Chupryna
Committed by
Douglas Barbosa Alexandre
Oct 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename parser namespace
Use License Compliance feature name
parent
80e49607
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
ee/lib/ee/gitlab/ci/parsers.rb
ee/lib/ee/gitlab/ci/parsers.rb
+1
-1
ee/lib/gitlab/ci/parsers/license_compliance/license_scanning.rb
.../gitlab/ci/parsers/license_compliance/license_scanning.rb
+10
-10
ee/spec/lib/gitlab/ci/parsers/license_compliance/license_scanning_spec.rb
...ab/ci/parsers/license_compliance/license_scanning_spec.rb
+1
-1
ee/spec/models/ci/build_spec.rb
ee/spec/models/ci/build_spec.rb
+1
-1
No files found.
ee/lib/ee/gitlab/ci/parsers.rb
View file @
bade5525
...
@@ -9,7 +9,7 @@ module EE
...
@@ -9,7 +9,7 @@ module EE
class_methods
do
class_methods
do
def
parsers
def
parsers
super
.
merge
({
super
.
merge
({
license_management:
::
Gitlab
::
Ci
::
Parsers
::
License
Management
::
LicenseManagement
,
license_management:
::
Gitlab
::
Ci
::
Parsers
::
License
Compliance
::
LicenseScanning
,
dependency_scanning:
::
Gitlab
::
Ci
::
Parsers
::
Security
::
DependencyScanning
,
dependency_scanning:
::
Gitlab
::
Ci
::
Parsers
::
Security
::
DependencyScanning
,
container_scanning:
::
Gitlab
::
Ci
::
Parsers
::
Security
::
ContainerScanning
,
container_scanning:
::
Gitlab
::
Ci
::
Parsers
::
Security
::
ContainerScanning
,
dast:
::
Gitlab
::
Ci
::
Parsers
::
Security
::
Dast
,
dast:
::
Gitlab
::
Ci
::
Parsers
::
Security
::
Dast
,
...
...
ee/lib/gitlab/ci/parsers/license_
management/license_management
.rb
→
ee/lib/gitlab/ci/parsers/license_
compliance/license_scanning
.rb
View file @
bade5525
...
@@ -3,11 +3,11 @@
...
@@ -3,11 +3,11 @@
module
Gitlab
module
Gitlab
module
Ci
module
Ci
module
Parsers
module
Parsers
module
License
Management
module
License
Compliance
class
License
Management
class
License
Scanning
License
Management
ParserError
=
Class
.
new
(
Gitlab
::
Ci
::
Parsers
::
ParserError
)
License
Scanning
ParserError
=
Class
.
new
(
Gitlab
::
Ci
::
Parsers
::
ParserError
)
def
parse!
(
json_data
,
license_
management
_report
)
def
parse!
(
json_data
,
license_
scanning
_report
)
root
=
JSON
.
parse
(
json_data
)
root
=
JSON
.
parse
(
json_data
)
root
[
'licenses'
].
each
do
|
license_hash
|
root
[
'licenses'
].
each
do
|
license_hash
|
...
@@ -19,18 +19,18 @@ module Gitlab
...
@@ -19,18 +19,18 @@ module Gitlab
uses_license?
(
dependency
[
'license'
][
'name'
],
license_name
)
uses_license?
(
dependency
[
'license'
][
'name'
],
license_name
)
end
end
license_dependencies
.
each
do
|
dependency
|
license_dependencies
.
each
do
|
dependency
|
license_
management
_report
.
add_dependency
(
license_name
,
license_
scanning
_report
.
add_dependency
(
license_name
,
license_hash
[
'count'
],
license_hash
[
'count'
],
dependency
[
'license'
][
'url'
],
dependency
[
'license'
][
'url'
],
dependency
[
'dependency'
][
'name'
])
dependency
[
'dependency'
][
'name'
])
end
end
end
end
end
end
rescue
JSON
::
ParserError
rescue
JSON
::
ParserError
raise
License
Management
ParserError
,
'JSON parsing failed'
raise
License
Scanning
ParserError
,
'JSON parsing failed'
rescue
=>
e
rescue
=>
e
Gitlab
::
Sentry
.
track_exception
(
e
)
Gitlab
::
Sentry
.
track_exception
(
e
)
raise
License
ManagementParserError
,
'License management
report parsing failed'
raise
License
ScanningParserError
,
'License scanning
report parsing failed'
end
end
def
remove_suffix
(
name
)
def
remove_suffix
(
name
)
...
...
ee/spec/lib/gitlab/ci/parsers/license_
management/license_management
_spec.rb
→
ee/spec/lib/gitlab/ci/parsers/license_
compliance/license_scanning
_spec.rb
View file @
bade5525
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Parsers
::
License
Management
::
LicenseManagement
do
describe
Gitlab
::
Ci
::
Parsers
::
License
Compliance
::
LicenseScanning
do
describe
'#parse!'
do
describe
'#parse!'
do
subject
{
described_class
.
new
.
parse!
(
data
,
report
)
}
subject
{
described_class
.
new
.
parse!
(
data
,
report
)
}
...
...
ee/spec/models/ci/build_spec.rb
View file @
bade5525
...
@@ -202,7 +202,7 @@ describe Ci::Build do
...
@@ -202,7 +202,7 @@ describe Ci::Build do
end
end
it
'raises an error'
do
it
'raises an error'
do
expect
{
subject
}.
to
raise_error
(
Gitlab
::
Ci
::
Parsers
::
License
Management
::
LicenseManagement
::
LicenseManagement
ParserError
)
expect
{
subject
}.
to
raise_error
(
Gitlab
::
Ci
::
Parsers
::
License
Compliance
::
LicenseScanning
::
LicenseScanning
ParserError
)
end
end
end
end
...
...
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