Add yaml validation for scan result policies
What does this MR do and why?
Describe in detail what your merge request does and why.
Add yaml validation for scan result policies
- gernalize current yaml validation
- update tests
Changelog: changed
EE: true
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Policy Type | Screenshot |
---|---|
project scan execution | |
group scan execution | |
project scan result | |
group scan result | |
non existent |
No validation example shown with the following below patch
diff --git a/ee/app/assets/javascripts/security_orchestration/components/utils.js b/ee/app/assets/javascripts/security_orchestration/components/utils.js
index ad2255bd3f4c..1f6a055f0d13 100644
--- a/ee/app/assets/javascripts/security_orchestration/components/utils.js
+++ b/ee/app/assets/javascripts/security_orchestration/components/utils.js
@@ -44,7 +44,7 @@ export const getSinglePolicySchema = async ({ namespacePath, namespaceType, poli
description: 'Specifies the type of policy to be enforced.',
enum: policyType,
},
- ...schemaForMultiplePolicies.properties[policyType].items.properties,
+ ...schemaForMultiplePolicies.properties['a'].items.properties,
},
};
} catch {
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Navigate to a project => Security & Compliance => Policies => New policy => Scan Result policy => yaml mode (example gdk url)
- Verify yaml validation
- Navigate to a project => Security & Compliance => Policies => New policy => Scan Execution policy => yaml mode (example gdk url)
- Verify yaml validation
- Navigate to a group => Security & Compliance => Policies => New policy => Scan Result policy => yaml mode (example gdk url)
- Verify yaml validation
- Navigate to a group => Security & Compliance => Policies => New policy => Scan Execution policy => yaml mode (example gdk url)
- Verify yaml validation
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #393435 (closed)
Edited by Alexander Turinske