Commit 8715e59a authored by Tetiana Chupryna's avatar Tetiana Chupryna Committed by Ash McKenzie

Rename file constant

License Management -> License Scanning
parent a46af619
......@@ -68,7 +68,7 @@ module EE
end
def collect_license_scanning_reports!(license_scanning_report)
each_report(::Ci::JobArtifact::LICENSE_MANAGEMENT_REPORT_FILE_TYPES) do |file_type, blob|
each_report(::Ci::JobArtifact::LICENSE_SCANNING_REPORT_FILE_TYPES) do |file_type, blob|
next if ::Feature.disabled?(:parse_license_management_reports, default_enabled: true)
next unless project.feature_available?(:license_management)
......@@ -95,7 +95,7 @@ module EE
if project.feature_available?(:dependency_scanning)
dependency_list = ::Gitlab::Ci::Parsers::Security::DependencyList.new(project, sha)
each_report(::Ci::JobArtifact::LICENSE_MANAGEMENT_REPORT_FILE_TYPES) do |_, blob|
each_report(::Ci::JobArtifact::LICENSE_SCANNING_REPORT_FILE_TYPES) do |_, blob|
dependency_list.parse_licenses!(blob, dependency_list_report)
end
end
......
......@@ -12,7 +12,7 @@ module EE
after_destroy :log_geo_deleted_event
SECURITY_REPORT_FILE_TYPES = %w[sast dependency_scanning container_scanning dast].freeze
LICENSE_MANAGEMENT_REPORT_FILE_TYPES = %w[license_management license_scanning].freeze
LICENSE_SCANNING_REPORT_FILE_TYPES = %w[license_management license_scanning].freeze
DEPENDENCY_LIST_REPORT_FILE_TYPES = %w[dependency_scanning].freeze
METRICS_REPORT_FILE_TYPES = %w[metrics].freeze
CONTAINER_SCANNING_REPORT_TYPES = %w[container_scanning].freeze
......@@ -27,8 +27,8 @@ module EE
with_file_types(SECURITY_REPORT_FILE_TYPES)
end
scope :license_management_reports, -> do
with_file_types(LICENSE_MANAGEMENT_REPORT_FILE_TYPES)
scope :license_scanning_reports, -> do
with_file_types(LICENSE_SCANNING_REPORT_FILE_TYPES)
end
scope :dependency_list_reports, -> do
......
......@@ -51,7 +51,7 @@ module EE
state_machine :status do
after_transition any => ::Ci::Pipeline.completed_statuses do |pipeline|
next unless pipeline.has_reports?(::Ci::JobArtifact.security_reports.or(::Ci::JobArtifact.license_management_reports))
next unless pipeline.has_reports?(::Ci::JobArtifact.security_reports.or(::Ci::JobArtifact.license_scanning_reports))
pipeline.run_after_commit do
StoreSecurityReportsWorker.perform_async(pipeline.id) if pipeline.default_branch?
......@@ -134,7 +134,7 @@ module EE
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|
builds.latest.with_reports(::Ci::JobArtifact.license_scanning_reports).each do |build|
build.collect_license_scanning_reports!(license_management_report)
end
end
......@@ -145,7 +145,7 @@ module EE
builds.latest.with_reports(::Ci::JobArtifact.dependency_list_reports).each do |build|
build.collect_dependency_list_reports!(dependency_list_report)
end
builds.latest.with_reports(::Ci::JobArtifact.license_management_reports).each do |build|
builds.latest.with_reports(::Ci::JobArtifact.license_scanning_reports).each do |build|
build.collect_licenses_for_dependency_list!(dependency_list_report)
end
end
......
......@@ -155,7 +155,7 @@ module EE
end
def has_license_management_reports?
!!(actual_head_pipeline&.has_reports?(::Ci::JobArtifact.license_management_reports))
!!(actual_head_pipeline&.has_reports?(::Ci::JobArtifact.license_scanning_reports))
end
def has_container_scanning_reports?
......
......@@ -52,7 +52,7 @@ module SCA
def pipeline
strong_memoize(:pipeline) do
project.latest_pipeline_with_reports(::Ci::JobArtifact.license_management_reports)
project.latest_pipeline_with_reports(::Ci::JobArtifact.license_scanning_reports)
end
end
......
......@@ -3,8 +3,8 @@
require 'spec_helper'
describe EE::Ci::JobArtifact do
describe '.license_management_reports' do
subject { Ci::JobArtifact.license_management_reports }
describe '.license_scanning_reports' do
subject { Ci::JobArtifact.license_scanning_reports }
context 'when there is a license management report' do
let!(:artifact) { create(:ee_ci_job_artifact, :license_management) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment