Skip to content

Evaluate group pipeline configuration [RUN ALL RSPEC] [RUN AS-IF-FOSS]

Aishwarya Subramanian requested to merge evaluate-group-pipeline-config into master

What does this MR do?

This MR adds changes to evaluate the group level compliance pipeline configuration in projects that apply the specific compliance label.

It adds a new type of pipeline chain config content Gitlab::Ci::Pipeline::Chain::Config::Content::CompliancePipelineConfiguration which has the highest precedence.

If the project's compliance label has a compliance pipeline configuration defined, the license is available for the project, and the FF is enabled, the compliance pipeline configuration will be triggered. The compliance pipeline configuration can include the project's .gitlab-ci.yml.

Please refer to the video below for a demo.

Mentions #281049 (closed)

Demo

(Accessible from GitLab Unfiltered account)

https://www.youtube.com/watch?v=kFNBQoS4Fg8

License

Gitlab Ultimate

Feature flag

ff_evaluate_group_level_compliance_pipeline, disabled by default.

Steps for local testing

  1. Create a Compliance framework for a group using the GraphQL api (requires ff_custom_compliance_frameworks to be enabled)

    API example

    Query:

    ```json
      mutation {
        createComplianceFramework(input: {namespacePath: "disney-org", params: {name: "compliance test", description: "this is a test framework", color: "#FFFFFF", pipelineConfigurationFullPath: ".compliance-gitlab-ci.yml@disney-org/compliance"}}) {
          framework {
            id
            name
            color
            description
            pipelineConfigurationFullPath
          }
          errors
        }
      }
    ```
  1. Assign the framework to a project (in rails console)

    Commands
      > project = Project.find <project_id>
      > framework = ComplianceManagement::Framework.find <framework_id>
      > setting = ComplianceManagement::ComplianceFramework::ProjectSettings.new
      > setting.update(project: project, framework_id: framework.id)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Aishwarya Subramanian

Merge request reports