Add enforcement_type label to MR approval policy metrics

What does this MR do and why?

This MR extends the MR approval policy metrics to track the enforcement type (enforce or warn mode) of policies. This enables us to measure adoption of warn mode and track progress toward the 30% increase target for MR approval policies created within 3 months.

References

Verification steps

  1. Run bundle exec rails runner scripts/internal_events/monitor.rb create_approval_rule_from_merge_request_approval_policy script
  2. Create new project (ensure you have Ultimate license)
  3. Create new Merge Request Approval Policy with enforce mode, then create new MR and merge it
  4. Verify that the metrics are incremented for the enforce enforcement_type
  5. Repeat steps 3-4 with a policy in warn mode and verify metrics are incremented for the warn enforcement_type

Related to #582870

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #582870

Merge request reports

Loading