Evaluate group pipeline configuration [RUN ALL RSPEC] [RUN AS-IF-FOSS]
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
-
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 } } ```
-
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
- [-] Changelog entry Feature is gated
-
Documentation (if required) Documentation MR: !52914 (closed) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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