Skip to content

Allow users to configure skip ci behavior for pipeline execution policy

What does this MR do and why?

This MR adds ability to disable [skip ci] restriction for Pipeline Execution Policies. Users now will have option to allow skipping pipelines created from Pipeline Execution Policies with [skip ci] and to specify users that should be exempted from that restriction.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

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

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

Before After
image image

How to set up and validate locally

  1. Create new group and new project in that group
  2. Create new Pipeline Execution Policy (Secure -> Policies -> Create new -> Pipeline Execution Policy) and merge MR with the policy
  3. Go to project created in 1., modify the file and commit change with [skip ci] annotation. -> Pipeline will run
  4. Now go back to Secure -> Policies and modify the policy created in 2.
  5. Add skip_ci: { allowed: false, allowlist: { users: [{ id: YOUR_USER_ID }] }}
  6. Go to project created in 1., modify the file and commit change with [skip ci] annotation. -> Pipeline will be skipped
  7. Now go back to Secure -> Policies and modify the policy created in 2.
  8. Add skip_ci: { allowed: true }
  9. Go to project created in 1., modify the file and commit change with [skip ci] annotation. -> -> Pipeline will be skipped
---
pipeline_execution_policy:
- name: PEP with skip ci enabled
  description: ''
  enabled: true
  pipeline_config_strategy: inject_ci
  content:
    include:
    - project: root/pep-skip-ci
      file: pep.yml
  skip_ci:
    allowed: false
    allowlist:
      users:
      - id: 1
approval_policy: []
Edited by Martin Čavoj

Merge request reports

Loading