Commit b946686c authored by Tetiana Chupryna's avatar Tetiana Chupryna

Handle renaming of license_mangement to _scanning

This a part of non-blocking changes related to the remaning.
We dropped support of `license_management` in 13.0.
How we can finish clean-up in the codebase.
parent dca443fc
...@@ -15,7 +15,7 @@ module Security ...@@ -15,7 +15,7 @@ module Security
attr_reader :pipeline attr_reader :pipeline
def self.allowed_job_types def self.allowed_job_types
# Example return: [:sast, :dast, :dependency_scanning, :container_scanning, :license_management, :coverage_fuzzing] # Example return: [:sast, :dast, :dependency_scanning, :container_scanning, :license_scanning, :coverage_fuzzing]
raise NotImplementedError, 'allowed_job_types must be overwritten to return an array of job types' raise NotImplementedError, 'allowed_job_types must be overwritten to return an array of job types'
end end
......
...@@ -9,7 +9,7 @@ module Security ...@@ -9,7 +9,7 @@ module Security
end end
def execute def execute
sync_license_management_rules sync_license_scanning_rules
sync_vulnerability_rules sync_vulnerability_rules
success success
rescue StandardError => error rescue StandardError => error
...@@ -27,7 +27,7 @@ module Security ...@@ -27,7 +27,7 @@ module Security
attr_reader :pipeline attr_reader :pipeline
def sync_license_management_rules def sync_license_scanning_rules
project = pipeline.project project = pipeline.project
report = pipeline.license_scanning_report report = pipeline.license_scanning_report
return if report.empty? && !pipeline.complete? return if report.empty? && !pipeline.complete?
......
...@@ -52,7 +52,6 @@ RSpec.describe GitlabSchema.types['Project'] do ...@@ -52,7 +52,6 @@ RSpec.describe GitlabSchema.types['Project'] do
create(:ci_build, :success, :sast, pipeline: pipeline) create(:ci_build, :success, :sast, pipeline: pipeline)
create(:ci_build, :success, :dast, pipeline: pipeline) create(:ci_build, :success, :dast, pipeline: pipeline)
create(:ci_build, :success, :license_scanning, pipeline: pipeline) create(:ci_build, :success, :license_scanning, pipeline: pipeline)
create(:ci_build, :success, :license_management, pipeline: pipeline)
create(:ci_build, :pending, :secret_detection, pipeline: pipeline) create(:ci_build, :pending, :secret_detection, pipeline: pipeline)
end end
......
...@@ -28,19 +28,19 @@ RSpec.describe Security::SecurityJobsFinder do ...@@ -28,19 +28,19 @@ RSpec.describe Security::SecurityJobsFinder do
end end
end end
context 'with combination of security jobs and license management jobs' do context 'with combination of security jobs and license scanning jobs' do
let!(:sast_build) { create(:ci_build, :sast, pipeline: pipeline) } let!(:sast_build) { create(:ci_build, :sast, pipeline: pipeline) }
let!(:container_scanning_build) { create(:ci_build, :container_scanning, pipeline: pipeline) } let!(:container_scanning_build) { create(:ci_build, :container_scanning, pipeline: pipeline) }
let!(:dast_build) { create(:ci_build, :dast, pipeline: pipeline) } let!(:dast_build) { create(:ci_build, :dast, pipeline: pipeline) }
let!(:secret_detection_build) { create(:ci_build, :secret_detection, pipeline: pipeline) } let!(:secret_detection_build) { create(:ci_build, :secret_detection, pipeline: pipeline) }
let!(:license_management_build) { create(:ci_build, :license_management, pipeline: pipeline) } let!(:license_scanning_build) { create(:ci_build, :license_scanning, pipeline: pipeline) }
it 'returns only the security jobs' do it 'returns only the security jobs' do
is_expected.to include(sast_build) is_expected.to include(sast_build)
is_expected.to include(container_scanning_build) is_expected.to include(container_scanning_build)
is_expected.to include(dast_build) is_expected.to include(dast_build)
is_expected.to include(secret_detection_build) is_expected.to include(secret_detection_build)
is_expected.not_to include(license_management_build) is_expected.not_to include(license_scanning_build)
end end
end end
end end
......
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