Skip to content

Update from_yaml parser for role_approvers

Alexander Turinske requested to merge 377863-update-from-yaml-parser into master

What does this MR do and why?

Describe in detail what your merge request does and why.

Update from_yaml parser for role_approvers

  • add role_approvers as allowed value
  • update test

Changelog: added

EE: true

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2023-03-08_at_19.44.17 Screenshot_2023-03-08_at_19.43.50

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

NOTE: Because the backend isn't fully implemented, one needs to do a workaround to create this policy

  1. Upload a GitLab Ultimate license
  2. Navigate to a policy project => /-/blob/main/.gitlab/security-policies/policy.yml
  3. Modify the policy.yml manually and add the below policy
scan_result_policy:
- name: Require owner or maintainer approvers for all license states policy
  description: ''
  enabled: false
  rules:
  - type: license_finding
    branches:
    - master
    match_on_inclusion: false
    license_types:
    - CNRI Jython License
    - CNRI Python License
    license_states:
    - newly_detected
    - detected
  actions:
  - type: require_approval
    approvals_required: 1
    role_approvers:
    - owner
    - maintainer
  1. Merge and navigate to a project that uses the policy project => Security & Compliance => Policies
  2. Select the policy
  3. Verify the drawer loads (though with incorrect text because that part isn't implemented yet)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #377863 (closed)

Merge request reports