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
7c73f9d3
Commit
7c73f9d3
authored
Oct 04, 2019
by
Tetiana Chupryna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename license_management_report in pipeline
parent
72ea8193
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
12 additions
and
12 deletions
+12
-12
ee/app/controllers/ee/projects/pipelines_controller.rb
ee/app/controllers/ee/projects/pipelines_controller.rb
+1
-1
ee/app/models/approval_merge_request_rule.rb
ee/app/models/approval_merge_request_rule.rb
+1
-1
ee/app/models/ee/ci/pipeline.rb
ee/app/models/ee/ci/pipeline.rb
+1
-1
ee/app/services/ci/compare_license_management_reports_service.rb
...services/ci/compare_license_management_reports_service.rb
+1
-1
ee/app/services/security/licenses_list_service.rb
ee/app/services/security/licenses_list_service.rb
+1
-1
ee/app/services/security/sync_reports_to_approval_rules_service.rb
...rvices/security/sync_reports_to_approval_rules_service.rb
+1
-1
ee/spec/controllers/projects/pipelines_controller_spec.rb
ee/spec/controllers/projects/pipelines_controller_spec.rb
+2
-2
ee/spec/models/approval_merge_request_rule_spec.rb
ee/spec/models/approval_merge_request_rule_spec.rb
+1
-1
ee/spec/models/ci/pipeline_spec.rb
ee/spec/models/ci/pipeline_spec.rb
+1
-1
ee/spec/services/security/sync_reports_to_approval_rules_service_spec.rb
...s/security/sync_reports_to_approval_rules_service_spec.rb
+1
-1
ee/spec/workers/refresh_license_compliance_checks_worker_spec.rb
.../workers/refresh_license_compliance_checks_worker_spec.rb
+1
-1
No files found.
ee/app/controllers/ee/projects/pipelines_controller.rb
View file @
7c73f9d3
...
...
@@ -31,7 +31,7 @@ module EE
if
report_exists
format
.
html
{
render_show
}
format
.
json
do
data
=
LicenseManagementReportsSerializer
.
new
(
project:
project
,
current_user:
current_user
).
represent
(
pipeline
&
.
license_
management
_report
&
.
licenses
)
data
=
LicenseManagementReportsSerializer
.
new
(
project:
project
,
current_user:
current_user
).
represent
(
pipeline
&
.
license_
scanning
_report
&
.
licenses
)
render
json:
data
,
status: :ok
end
else
...
...
ee/app/models/approval_merge_request_rule.rb
View file @
7c73f9d3
...
...
@@ -135,7 +135,7 @@ class ApprovalMergeRequestRule < ApplicationRecord
end
def
refresh_license_management_approvals
(
project_approval_rule
)
license_report
=
merge_request
.
head_pipeline
&
.
license_
management
_report
license_report
=
merge_request
.
head_pipeline
&
.
license_
scanning
_report
return
if
license_report
.
blank?
if
license_report
.
violates?
(
project
.
software_license_policies
)
...
...
ee/app/models/ee/ci/pipeline.rb
View file @
7c73f9d3
...
...
@@ -133,7 +133,7 @@ module EE
end
end
def
license_
management
_report
def
license_
scanning
_report
::
Gitlab
::
Ci
::
Reports
::
LicenseScanning
::
Report
.
new
.
tap
do
|
license_management_report
|
builds
.
latest
.
with_reports
(
::
Ci
::
JobArtifact
.
license_management_reports
).
each
do
|
build
|
build
.
collect_license_scanning_reports!
(
license_management_report
)
...
...
ee/app/services/ci/compare_license_management_reports_service.rb
View file @
7c73f9d3
...
...
@@ -11,7 +11,7 @@ module Ci
end
def
get_report
(
pipeline
)
pipeline
&
.
license_
management
_report
pipeline
&
.
license_
scanning
_report
end
end
end
ee/app/services/security/licenses_list_service.rb
View file @
7c73f9d3
...
...
@@ -8,7 +8,7 @@ module Security
end
def
execute
pipeline
.
license_
management
_report
.
licenses
pipeline
.
license_
scanning
_report
.
licenses
end
private
...
...
ee/app/services/security/sync_reports_to_approval_rules_service.rb
View file @
7c73f9d3
...
...
@@ -29,7 +29,7 @@ module Security
def
sync_license_management_rules
project
=
pipeline
.
project
report
=
pipeline
.
license_
management
_report
report
=
pipeline
.
license_
scanning
_report
return
if
report
.
empty?
&&
!
pipeline
.
complete?
return
if
report
.
violates?
(
project
.
software_license_policies
)
...
...
ee/spec/controllers/projects/pipelines_controller_spec.rb
View file @
7c73f9d3
...
...
@@ -285,13 +285,13 @@ describe Projects::PipelinesController do
end
it
'will return license management report in json format'
do
expect
(
payload
.
size
).
to
eq
(
pipeline
.
license_
management
_report
.
licenses
.
size
)
expect
(
payload
.
size
).
to
eq
(
pipeline
.
license_
scanning
_report
.
licenses
.
size
)
expect
(
payload
.
first
.
keys
).
to
eq
(
%w(name classification dependencies count url)
)
end
it
'will return mit license approved status'
do
payload_mit
=
payload
.
find
{
|
l
|
l
[
'name'
]
==
'MIT'
}
expect
(
payload_mit
[
'count'
]).
to
eq
(
pipeline
.
license_
management
_report
.
found_licenses
[
'MIT'
].
count
)
expect
(
payload_mit
[
'count'
]).
to
eq
(
pipeline
.
license_
scanning
_report
.
found_licenses
[
'MIT'
].
count
)
expect
(
payload_mit
[
'url'
]).
to
eq
(
'http://opensource.org/licenses/mit-license'
)
expect
(
payload_mit
[
'classification'
][
'approval_status'
]).
to
eq
(
'approved'
)
end
...
...
ee/spec/models/approval_merge_request_rule_spec.rb
View file @
7c73f9d3
...
...
@@ -321,7 +321,7 @@ describe ApprovalMergeRequestRule do
context
"when the latest license report violates the compliance policy"
do
let
(
:license
)
{
create
(
:software_license
,
name:
license_report
.
license_names
[
0
])
}
let
(
:license_report
)
{
open_pipeline
.
license_
management
_report
}
let
(
:license_report
)
{
open_pipeline
.
license_
scanning
_report
}
specify
{
expect
(
subject
.
approvals_required
).
to
be
(
project_approval_rule
.
approvals_required
)
}
end
...
...
ee/spec/models/ci/pipeline_spec.rb
View file @
7c73f9d3
...
...
@@ -240,7 +240,7 @@ describe Ci::Pipeline do
end
describe
'#license_management_reports'
do
subject
{
pipeline
.
license_
management
_report
}
subject
{
pipeline
.
license_
scanning
_report
}
before
do
stub_licensed_features
(
license_management:
true
)
...
...
ee/spec/services/security/sync_reports_to_approval_rules_service_spec.rb
View file @
7c73f9d3
...
...
@@ -73,7 +73,7 @@ describe Security::SyncReportsToApprovalRulesService, '#execute' do
context
"when a license violates the license compliance policy"
do
let!
(
:blacklisted_license
)
{
create
(
:software_license
,
name:
license_name
)
}
let!
(
:ci_build
)
{
create
(
:ee_ci_build
,
:success
,
:license_management
,
pipeline:
pipeline
,
project:
project
)
}
let!
(
:license_name
)
{
ci_build
.
pipeline
.
license_
management
_report
.
license_names
[
0
]
}
let!
(
:license_name
)
{
ci_build
.
pipeline
.
license_
scanning
_report
.
license_names
[
0
]
}
specify
{
expect
{
subject
}.
not_to
change
{
license_compliance_rule
.
reload
.
approvals_required
}
}
specify
{
expect
(
subject
[
:status
]).
to
be
(
:success
)
}
...
...
ee/spec/workers/refresh_license_compliance_checks_worker_spec.rb
View file @
7c73f9d3
...
...
@@ -26,7 +26,7 @@ describe RefreshLicenseComplianceChecksWorker do
let!
(
:closed_pipeline
)
{
create
(
:ee_ci_pipeline
,
:success
,
:with_license_management_report
,
project:
project
,
merge_requests_as_head_pipeline:
[
closed_merge_request
])
}
let!
(
:blacklist_policy
)
{
create
(
:software_license_policy
,
project:
project
,
software_license:
license
,
approval_status: :blacklisted
)
}
let
(
:license
)
{
create
(
:software_license
,
name:
license_report
.
license_names
[
0
])
}
let
(
:license_report
)
{
open_pipeline
.
license_
management
_report
}
let
(
:license_report
)
{
open_pipeline
.
license_
scanning
_report
}
before
do
subject
.
perform
(
project
.
id
)
...
...
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