Skip to content

Add metrics for pipeline execution policy usage

What does this MR do and why?

Add metrics for pipeline execution policy usage

Related to: #436055 (closed)

MR acceptance checklist

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

Screenshots or screen recordings

Screenshot_2024-07-09_at_7.03.38_PM

How to set up and validate locally

  1. Enable the pipeline_execution_policy_type feature flag
Feature.enable(:pipeline_execution_policy_type)
  1. Create a new group
  2. Go to Settings > General > Permissions and group features
  3. Enable the Security policy pipeline execution action experiment
  4. Create a new project
  5. Add a .gitlab-ci.yml with the content
test:
  stage: test
  script:
    - echo "Do a test here"
  1. Go back the group

  2. Create a new project

  3. Go to Secure > Policies

  4. Click in New policy

  5. Select Pipeline execution policy

  6. Create a new policy injecting the content from the .gitlab-ci.yml

  7. Click in update via merge request

  8. Start the event monitoring running the command bellow in the gdk-folder/gitlab directory

rails runner scripts/internal_events/monitor.rb enforce_pipeline_execution_policy_in_project
  1. Go to Build > Pipelines and run a pipeline
  2. Check if the counter was increased in the event monitoring.
Edited by Marcos Rocha

Merge request reports

Loading