Skip to content

Enable CI for configless projects with compliance pipelines

Max Woolf requested to merge 332040-missing-ci-compliance-pipeline into master

What does this MR do and why?

  • Projects subject to a compliance pipeline that do not have a CI pipeline themselves previously could not execute a pipeline that would consist entirely of the compliance framework's configuration, instead showing an error.
  • This MR allows projects that have no CI configuration file but are subject to a compliance framework with a compliance pipeline configuration to execute a pipeline regardless.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

  • Create a new group
  • Create a new project, called compliance-configuration.
  • Inside that project create a single file called compliance-ci.yml which contains the following:
include:
  project: '$CI_PROJECT_PATH'
  file: '$CI_CONFIG_PATH'
  ref: '$CI_COMMIT_REF_NAME'
  - rules:
    exists: '$CI_CONFIG_PATH'

stages:
  - build
  - test

comply:
  stage: test
  script:
    - echo "This is the compliance framework"
  • In the newly created group, create a new compliance framework. Point the pipeline configuration to the file created above.
  • Add the newly created compliance framework to the new project
  • Create a new project within the group. Ensure Auto DevOps is disabled and ensure that the project does not have its own CI config!
  • Start a new pipeline.
  • Ensure that the pipeline is created successfully and contains the job defined in the template above.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #332040 (closed)

Edited by Max Woolf

Merge request reports