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
How to set up and validate locally
- Enable the
pipeline_execution_policy_type
feature flag
Feature.enable(:pipeline_execution_policy_type)
- Create a new group
- Go to Settings > General > Permissions and group features
- Enable the Security policy pipeline execution action experiment
- Create a new project
- Add a
.gitlab-ci.yml
with the content
test:
stage: test
script:
- echo "Do a test here"
-
Go back the group
-
Create a new project
-
Go to Secure > Policies
-
Click in New policy
-
Select Pipeline execution policy
-
Create a new policy injecting the content from the
.gitlab-ci.yml
-
Click in update via merge request
-
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
- Go to Build > Pipelines and run a pipeline
- Check if the counter was increased in the event monitoring.
Edited by Marcos Rocha