Declare required, but not provided, variables
Problem to solve
When sharing CI/CD pipelines, partial pipelines, or individual jobs, whether through project templates, forkable/clonable projects, .gitlab-ci.yml
templates, includes
, or simple copy/paste, you often depend on certain variables being present, but need the consumer of the pipeline to provide the values.
Target audience
-
Delaney, Development Team Lead, https://about.gitlab.com/handbook/marketing/product-marketing/roles-personas#delaney-development-team-lead
-
Sasha, Software Developer, https://about.gitlab.com/handbook/marketing/product-marketing/roles-personas#sasha-software-developer
-
Devon, DevOps Engineer, https://about.gitlab.com/handbook/marketing/product-marketing/roles-personas#devon-devops-engineer
Further details
Proposal
MVC:
- Template creator adds a variable declaration in the YML with a key but no value.
- When project admin goes to the project variables, prompt with empty keys
Enhancements:
- On fork, prompt for missing variables.
- When adding a
.gitlab-ci.yml
template, prompt for missing variables. - When creating from a project template, prompt for missing variables.
- In editor, when add
include
, or really any time, prompt for missing variables. - Look beyond just missing variables, in to optional values, and value types.
Permissions and Security
Documentation
What does success look like, and how can we measure that?
Links / references
Edited by Mark Pundsack