Skip to content

[BE] Add ability to skip_ci to pipeline execution policy YAML mode

Background

This issue is part of the implementation for adding the ability to disable the [skip ci] restriction for Pipeline Execution Policies. This feature will allow users to specify whether pipelines created from Pipeline Execution Policies can be skipped with [skip ci] and to define users who should be exempted from that restriction.

Objective

Implement the backend logic to support the new skip_ci configuration in Pipeline Execution Policies.

Implementation Details

  1. Update the Pipeline Execution Policy model to include the new skip_ci configuration:
    • allowed: boolean (default: false)
    • exceptions: object
      • users: array of user IDs
  2. Modify the pipeline creation logic to check the skip_ci configuration when a Pipeline Execution Policy is applied:
    • If skip_ci.allowed is false, ignore the [skip ci] annotation unless the user is in the exceptions.users list.
    • If skip_ci.allowed is true, honor the [skip ci] annotation for all users.
  3. Update the API endpoints for creating and updating Pipeline Execution Policies to accept the new skip_ci configuration.
  4. Implement validation for the skip_ci configuration to ensure:
    • allowed is a boolean value
    • exceptions.users contains valid user IDs
  5. Update the relevant services and controllers to handle the new skip_ci logic when applying Pipeline Execution Policies.
  6. Write unit and integration tests to cover the new functionality.

Acceptance Criteria

  • The backend correctly processes the skip_ci configuration in Pipeline Execution Policies.
  • Pipelines are created or skipped according to the skip_ci settings and user exceptions.
  • API endpoints for Pipeline Execution Policies accept and validate the new skip_ci configuration.
  • All new code is covered by appropriate tests.

Related Links

Edited by Alan (Maciej) Paruszewski