Commit 430a2ccd authored by Ash McKenzie's avatar Ash McKenzie

Merge branch '26604-license-scanning-artifact' into 'master'

Add 'license_scanning' artifact

See merge request gitlab-org/gitlab!22277
parents 918843b5 6d8457e0
......@@ -23,6 +23,7 @@ module Ci
container_scanning: 'gl-container-scanning-report.json',
dast: 'gl-dast-report.json',
license_management: 'gl-license-management-report.json',
license_scanning: 'gl-license-management-report.json',
performance: 'performance.json',
metrics: 'metrics.txt'
}.freeze
......@@ -46,6 +47,7 @@ module Ci
container_scanning: :raw,
dast: :raw,
license_management: :raw,
license_scanning: :raw,
performance: :raw
}.freeze
......@@ -104,6 +106,7 @@ module Ci
dast: 8, ## EE-specific
codequality: 9, ## EE-specific
license_management: 10, ## EE-specific
license_scanning: 101, ## EE-specific till 13.0
performance: 11, ## EE-specific
metrics: 12 ## EE-specific
}
......
......@@ -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].freeze
LICENSE_MANAGEMENT_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
......
---
title: Add support for license_scanning artifact report
merge_request: 22277
author:
type: added
......@@ -10,6 +10,7 @@ module EE
def parsers
super.merge({
license_management: ::Gitlab::Ci::Parsers::LicenseCompliance::LicenseScanning,
license_scanning: ::Gitlab::Ci::Parsers::LicenseCompliance::LicenseScanning,
dependency_scanning: ::Gitlab::Ci::Parsers::Security::DependencyScanning,
container_scanning: ::Gitlab::Ci::Parsers::Security::ContainerScanning,
dast: ::Gitlab::Ci::Parsers::Security::Dast,
......
......@@ -112,6 +112,16 @@ FactoryBot.define do
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
file_type { :license_management }
file_format { :raw }
......
......@@ -11,6 +11,12 @@ describe EE::Ci::JobArtifact do
it { is_expected.to eq([artifact]) }
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
describe '.metrics_reports' do
......
......@@ -11,7 +11,7 @@ module Gitlab
include ::Gitlab::Config::Entry::Validatable
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
......@@ -28,6 +28,7 @@ module Gitlab
validates :dast, 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_scanning, array_of_strings_or_string: true
validates :metrics, array_of_strings_or_string: true
end
end
......
......@@ -41,6 +41,7 @@ describe Gitlab::Ci::Config::Entry::Reports do
:container_scanning | 'gl-container-scanning-report.json'
:dast | 'gl-dast-report.json'
:license_management | 'gl-license-management-report.json'
:license_scanning | 'gl-license-management-report.json'
:performance | 'performance.json'
end
......
......@@ -32,7 +32,8 @@ describe Ci::RetryBuildService do
job_artifacts_metadata job_artifacts_trace job_artifacts_junit
job_artifacts_sast job_artifacts_dependency_scanning
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_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