doc/development/cicd/components.md
This document explains how to develop CI/CD components that are maintained by GitLab, either the official public ones or those for internal use.
The location for all official GitLab component projects is the gitlab.com/components group.
This group contains all components that are designed to be generic, served to all GitLab users, and maintained by GitLab.
For example: SAST, secret detection and code quality components.
A component project can initially be created under a different group (for example gitlab-org)
but it needs to be moved into the components group before the first version gets published to the catalog. All projects under gitlab.com/components group must be public
Components that are for GitLab internal use only, for example specific to gitlab-org/gitlab project, should be
implemented under gitlab-org group.
Component projects that are expected to be published in the CI/CD catalog should first be dogfooded to ensure we stay on top of the project quality and have first-hand experience with it.
Official GitLab components are trusted by the community and require a high degree of quality and timely maintenance. Components must be kept up to date, monitored for security vulnerabilities, and bugs fixed.
Each component project must have a set of owners and maintainers that are also domain experts. Experts can be from any department in GitLab, from Engineering to Support, Customer Success, and Developer Relations.
If a component is related to a GitLab feature (for example secret detection), the team that owns the feature category or is most closely related to it should maintain the project. In this case, the Engineering Manager for the feature category is assigned as the project owner.
Members with the owner role for the project are the DRIs responsible for triaging open issues and merge requests to ensure they get addressed promptly.
The component project can be created by a separate team or individual initially but it must be transitioned to a set of owners before the first version gets published to the catalog.
The README.md file in the project repository must indicate the main owners of the project so that
they can be contacted by the wider community if needed.
[!note] If a set of project owners cannot be guaranteed or the components cannot be dogfooded, we strongly recommend not creating an official GitLab component project and instead let the wider community fulfill the demand in the catalog.
gitlab.com/components
or ask one of the group owners to create an empty project for you.LICENSE.md file with the MIT license (example)..gitlab-ci.yml file that:
README.md contains at least the sections below (for example, see the Code quality component):
inputs, use underscores _ for composite names and hyphens - as separators, if necessary. For example: service_x-project_name.inputs if you want to allow users to configure rules. See an example here.
To preserve the default behavior when rules is not defined you should use default: [{when: on_success}] for the input, until this issue is resolved.Follow these guidelines to determine the appropriate version type for your component releases:
main branch.Breaking changes that may not be obvious:
before_script, after_script, variables) that users might already be overriding in their pipelinesEnvironment compatibility:
It's possible that components in the project have a related CI/CD template in the GitLab codebase. In that case we need to cross link the component project and CI/CD template:
README.md of the component project with the location of the existing CI/CD template.When changes are applied to these components, check whether we can integrate the changes in the CI/CD template too. This might not be possible due to the rigidity of versioning in CI/CD templates.
Ping any of the maintainers for reviews to ensure that the components are written in consistent style and follow the best practices.
Each component project under gitlab.com/components group should
have specific DRIs and maintainers, however the @gitlab-org/maintainers/ci-components
group of maintainers is responsible for managing the components group in general.
The responsibilities for this group of maintainers:
Requirements for becoming a maintainer:
How to join the gitlab-components group of general maintainers: