Define CI components syntax
Problem
We need to define a yaml syntax for the CI components. The component must define a name, a type (template, step, etc.), input parameters and optionally output parameters, as well as the component configuration/content.
Things to keep in consideration:
- In Allow pipeline name to be defined under workflow (!97502 - merged) we introduce
workflow:name
syntax for pipeline. - We want to replace the design of pre-filled variables from using
variables:description
to an explicit list of pipeline inputs. - We should move away from using variables to customize dynamic content and should instead use inputs.
- We could keep the UX and syntax as familiar as possible to existing use-cases so we can reuse functionalities.
Idea
# header/metadata: This part is stripped out when consuming the content (below).
workflow|template|step:
name: My component X
description: (Optional) My component X does Y very well
inputs:
environment:
default: test
website:
required: true
test_run:
required: true
options:
- unit
- integration
- acceptance
- system
# content
... # following the component type's schema
Input schema
inputs:
deploy_environment:
options: # render a selectbox with options in order of how they are defined below
- staging # 1st option
- canary # 2nd option
- production # 3rd option
default: staging # selected by default in the UI.
# if `default:` is not specified, the user must explicitly select
# an option.
description: Deployment environment # render as input label.
An input can have:
-
required: true
(withoutdefault:
) - in this case the input must be provided (value always expected). -
default: X
- in this case it can be overridden or not provided and use the default (value always expected andrequired: true
is implicit). - none - in this case the input is optional.
Open discussion topics
-
Is version:
needed? Why? Ensure the blueprint is clear about that. -
Should component paths include CDN host gitlab.com
? -
Where should a metadata file (applied to all components in a project) live? What about its syntax? -
Resolve discussion about directory structure and filename conventions. -
Ensure to resolve the discussion from !101762 (comment 1160546712)
Edited by Fabio Pitino