Commit 6d8457e0 authored by Tetiana Chupryna's avatar Tetiana Chupryna Committed by Ash McKenzie

Add license scanning artifact

license_scanning is meant to replace license_management
but till 13.0 we need to support both names.
That's why we need separate file type for _scanning
parent 918843b5
...@@ -23,6 +23,7 @@ module Ci ...@@ -23,6 +23,7 @@ module Ci
container_scanning: 'gl-container-scanning-report.json', container_scanning: 'gl-container-scanning-report.json',
dast: 'gl-dast-report.json', dast: 'gl-dast-report.json',
license_management: 'gl-license-management-report.json', license_management: 'gl-license-management-report.json',
license_scanning: 'gl-license-management-report.json',
performance: 'performance.json', performance: 'performance.json',
metrics: 'metrics.txt' metrics: 'metrics.txt'
}.freeze }.freeze
...@@ -46,6 +47,7 @@ module Ci ...@@ -46,6 +47,7 @@ module Ci
container_scanning: :raw, container_scanning: :raw,
dast: :raw, dast: :raw,
license_management: :raw, license_management: :raw,
license_scanning: :raw,
performance: :raw performance: :raw
}.freeze }.freeze
...@@ -104,6 +106,7 @@ module Ci ...@@ -104,6 +106,7 @@ module Ci
dast: 8, ## EE-specific dast: 8, ## EE-specific
codequality: 9, ## EE-specific codequality: 9, ## EE-specific
license_management: 10, ## EE-specific license_management: 10, ## EE-specific
license_scanning: 101, ## EE-specific till 13.0
performance: 11, ## EE-specific performance: 11, ## EE-specific
metrics: 12 ## EE-specific metrics: 12 ## EE-specific
} }
......
...@@ -12,7 +12,7 @@ module EE ...@@ -12,7 +12,7 @@ module EE
after_destroy :log_geo_deleted_event after_destroy :log_geo_deleted_event
SECURITY_REPORT_FILE_TYPES = %w[sast dependency_scanning container_scanning dast].freeze SECURITY_REPORT_FILE_TYPES = %w[sast dependency_scanning container_scanning dast].freeze
LICENSE_MANAGEMENT_REPORT_FILE_TYPES = %w[license_management].freeze LICENSE_MANAGEMENT_REPORT_FILE_TYPES = %w[license_management license_scanning].freeze
DEPENDENCY_LIST_REPORT_FILE_TYPES = %w[dependency_scanning].freeze DEPENDENCY_LIST_REPORT_FILE_TYPES = %w[dependency_scanning].freeze
METRICS_REPORT_FILE_TYPES = %w[metrics].freeze METRICS_REPORT_FILE_TYPES = %w[metrics].freeze
CONTAINER_SCANNING_REPORT_TYPES = %w[container_scanning].freeze CONTAINER_SCANNING_REPORT_TYPES = %w[container_scanning].freeze
......
---
title: Add support for license_scanning artifact report
merge_request: 22277
author:
type: added
...@@ -10,6 +10,7 @@ module EE ...@@ -10,6 +10,7 @@ module EE
def parsers def parsers
super.merge({ super.merge({
license_management: ::Gitlab::Ci::Parsers::LicenseCompliance::LicenseScanning, license_management: ::Gitlab::Ci::Parsers::LicenseCompliance::LicenseScanning,
license_scanning: ::Gitlab::Ci::Parsers::LicenseCompliance::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,
......
...@@ -112,6 +112,16 @@ FactoryBot.define do ...@@ -112,6 +112,16 @@ FactoryBot.define do
end end
end end
trait :license_scanning do
file_type { :license_scanning }
file_format { :raw }
after(:build) do |artifact, _|
artifact.file = fixture_file_upload(
Rails.root.join('ee/spec/fixtures/security_reports/master/gl-license-management-report.json'), 'application/json')
end
end
trait :license_management_feature_branch do trait :license_management_feature_branch do
file_type { :license_management } file_type { :license_management }
file_format { :raw } file_format { :raw }
......
...@@ -11,6 +11,12 @@ describe EE::Ci::JobArtifact do ...@@ -11,6 +11,12 @@ describe EE::Ci::JobArtifact do
it { is_expected.to eq([artifact]) } it { is_expected.to eq([artifact]) }
end end
context 'when there is a license scanning report' do
let!(:artifact) { create(:ee_ci_job_artifact, :license_scanning) }
it { is_expected.to eq([artifact]) }
end
end end
describe '.metrics_reports' do describe '.metrics_reports' do
......
...@@ -11,7 +11,7 @@ module Gitlab ...@@ -11,7 +11,7 @@ module Gitlab
include ::Gitlab::Config::Entry::Validatable include ::Gitlab::Config::Entry::Validatable
include ::Gitlab::Config::Entry::Attributable include ::Gitlab::Config::Entry::Attributable
ALLOWED_KEYS = %i[junit codequality sast dependency_scanning container_scanning dast performance license_management metrics].freeze ALLOWED_KEYS = %i[junit codequality sast dependency_scanning container_scanning dast performance license_management license_scanning metrics].freeze
attributes ALLOWED_KEYS attributes ALLOWED_KEYS
...@@ -28,6 +28,7 @@ module Gitlab ...@@ -28,6 +28,7 @@ module Gitlab
validates :dast, array_of_strings_or_string: true validates :dast, array_of_strings_or_string: true
validates :performance, array_of_strings_or_string: true validates :performance, array_of_strings_or_string: true
validates :license_management, array_of_strings_or_string: true validates :license_management, array_of_strings_or_string: true
validates :license_scanning, array_of_strings_or_string: true
validates :metrics, array_of_strings_or_string: true validates :metrics, array_of_strings_or_string: true
end end
end end
......
...@@ -41,6 +41,7 @@ describe Gitlab::Ci::Config::Entry::Reports do ...@@ -41,6 +41,7 @@ describe Gitlab::Ci::Config::Entry::Reports do
:container_scanning | 'gl-container-scanning-report.json' :container_scanning | 'gl-container-scanning-report.json'
:dast | 'gl-dast-report.json' :dast | 'gl-dast-report.json'
:license_management | 'gl-license-management-report.json' :license_management | 'gl-license-management-report.json'
:license_scanning | 'gl-license-management-report.json'
:performance | 'performance.json' :performance | 'performance.json'
end end
......
...@@ -32,7 +32,8 @@ describe Ci::RetryBuildService do ...@@ -32,7 +32,8 @@ describe Ci::RetryBuildService do
job_artifacts_metadata job_artifacts_trace job_artifacts_junit job_artifacts_metadata job_artifacts_trace job_artifacts_junit
job_artifacts_sast job_artifacts_dependency_scanning job_artifacts_sast job_artifacts_dependency_scanning
job_artifacts_container_scanning job_artifacts_dast job_artifacts_container_scanning job_artifacts_dast
job_artifacts_license_management job_artifacts_performance job_artifacts_license_management job_artifacts_license_scanning
job_artifacts_performance
job_artifacts_codequality job_artifacts_metrics scheduled_at job_artifacts_codequality job_artifacts_metrics scheduled_at
job_variables waiting_for_resource_at].freeze job_variables waiting_for_resource_at].freeze
......
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