Backend: Update CI component fetching for updated directory structure
Context
In &10728, we are updating the directory structure required for component repositories.
Legacy component directory structure
The legacy structure allows for a top-level component template.yml
as well as sub-components inside directories:
├── template.yml
├── README.md
├── .gitlab-ci.yml
├── unit/
│ └── template.yml
└── integration/
└── template.yml
These components are included with:
include:
- component: gitlab.com/namespace/project
- component: gitlab.com/namespace/project/unit
- component: gitlab.com/namespace/project/integration
Updated component directory structure
In order to making scanning a component resource repository for components more performant, we will restrict the location of component files to specific directories. For now, while we only have template components, all components must live inside a templates
directory.
.
├── README.md
├── .gitlab-ci.yml
├── templates/
│ ├── all-scans.yml # single file template
│ ├── secret-detection.yml # single file template
│ └── dast/ # more complex template. May rely on other files.
│ ├── template.yml # entry point for directory-based templates
│ └── ...other files
The components can be included by referencing the project path and the template name:
include:
- component: gitlab.com/gitlab-org/security-components/secret-detection@1.0
- component: gitlab.com/gitlab-org/security-components/dast@1.0
Proposed solution
Update include:component
to let it fetch components using the new project path and template name syntax, while preserving the legacy fetching. The legacy fetching will be removed in #415855 (closed)
NOTE: Docs should be updated as well