Improve Run Pipeline and Play UX by generating form based on form definition stored in .gitlab-ci.yml
Problem to solve
When Run Pipeline is selected, it only displays a simplistic form that assumes the user knows every variable name and value that needs to be entered when starting the job. If there are a number of variables that need to be entered, and some of then are required, it can be tedious and error prone for the user to enter them all.
Any user that needs to trigger pipelines, typically a developer or devops engineer
When Run Pipeline is selected, the form that allows the user to add variable definitions when running a pipeline or playing a job would add preset input fields from the inputs section in the .gitlab-ci.yml file.
Add inputs: node to yaml file:
inputs: - name: feature_a label: label for feature_a type: boolean | numeric | text | option | password | file | date | date-time default: required: True | False options: ["europe-west1-a", "europe-west1-b"] options_labels: ["label 1", "label 2"]
Inputs could either be at the forthcoming defaults node, or within a job node
- Type boolean would provide a check box next to the name or label
- Type numeric would validate for a numeric input
- Type option would display some sort of drop-down menu
- Type password would mask the input and make sure the variable is masked
- Date and Date-time would display a calendar widget or allow direct entry
Default within a job node would override a variable value from the gitlab-ci.yml variable definition. An inputs node from within a job node would override the entry from the defaults node only for the specific job.
I'm not sure what to name it, but there should also be an option to disable entering any variables other than the listed inputs.
Required inputs would need to be non-blank (Not available for boolean type?).
More discussion about defining the forms is in https://gitlab.com/gitlab-org/gitlab-ce/issues/24935
We have about 100 developers who are running pipelines or playing jobs daily and need to set 6-10 variables every time they do so. Having to cut and paste each variable name in addition to the value is tedious, and potentially time consuming if they leave out a required variable and have to start another pipeline. It looks like there are at least a dozen customers requesting this sort of form defined in the gitlab-ci file in https://gitlab.com/gitlab-org/gitlab-ce/issues/24935.
Links / references
https://gitlab.com/gitlab-org/gitlab-ce/issues/24935 Specify variables when running a manual job
https://gitlab.com/gitlab-org/gitlab-ce/issues/35896 Passing variables to CI/CD pipelines in all possible scenarios
https://gitlab.com/gitlab-org/gitlab-ce/issues/48974 Pipeline variables to be shown on the pipeline run page