Skip to content
Snippets Groups Projects
Verified Commit 2152c23b authored by Sashi Kumar Kumaresan's avatar Sashi Kumar Kumaresan Committed by GitLab
Browse files

Merge branch 'mc_rocha-fix-deprecated-properties-approval-policies-446268' into 'master'

Fix the deprecated_properties method

See merge request !147281



Merged-by: Sashi Kumar Kumaresan's avatarSashi Kumar Kumaresan <skumar@gitlab.com>
Approved-by: default avatarMartin Čavoj <mcavoj@gitlab.com>
Approved-by: Sashi Kumar Kumaresan's avatarSashi Kumar Kumaresan <skumar@gitlab.com>
Reviewed-by: default avatarMartin Čavoj <mcavoj@gitlab.com>
Co-authored-by: default avatarmc_rocha <mrocha@gitlab.com>
parents 9d97480d fbed1c09
No related branches found
No related tags found
1 merge request!147281Fix the deprecated_properties method
Pipeline #1221528440 passed
......@@ -127,7 +127,7 @@ def compliance_framework_ids_with_policy_index
def deprecated_properties
deprecated_properties = Set.new
scan_result_policies = policy_yaml&.[](:scan_result_policy)
scan_result_policies = policy_yaml&.[](:scan_result_policy) || policy_yaml&.[](:approval_policy)
return deprecated_properties.to_a unless scan_result_policies.present?
......
......@@ -1749,11 +1749,7 @@
end
end
context 'when the policy is a scan_result_policy' do
let(:policy_yaml) do
build(:orchestration_policy_yaml, scan_result_policy: [build(:scan_result_policy, rules: rules)])
end
shared_examples 'approval policies' do
context 'when the policy has no rules' do
let(:rules) { nil }
......@@ -1822,6 +1818,22 @@
end
end
end
context 'when the policy is a scan_result_policy' do
let(:policy_yaml) do
build(:orchestration_policy_yaml, scan_result_policy: [build(:scan_result_policy, rules: rules)])
end
it_behaves_like 'approval policies'
end
context 'when the policy is a approval_policy' do
let(:policy_yaml) do
build(:orchestration_policy_yaml, approval_policy: [build(:approval_policy, rules: rules)])
end
it_behaves_like 'approval policies'
end
end
describe '#delete_scan_finding_rules' do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment