Proposal: Modify pre-filled variables implementation
Problem
In #30101 (closed) we implemented the ability to have variables pre-filled when running a pipeline manually with the "Run Pipeline" button. The implementation uses this syntax:
variables:
TEST:
value: "some value"
description: "This variable makes cakes delicious"
I'm concerned that this design is not intuitive, and may lead to confusion/misconfiguration. The main problem is that the task: Let a variable pre-fill in the run pipeline form
, does not match the method: Add a description to a variable
.
If I was reading a config that had this, I would have no idea that this is used to expose the variable in the UI. I might be tempted to see that and think "Oh, a description, that's useful, let me add descriptions to my other variables so my teammates can better understand our pipeline", but doing this will inadvertently pre-fill all those variables.
Also, it's possible that for many users, they won't actually want to put a description, or a description isn't useful, so we'll probably end up with many people that have configurations like:
variables:
TEST:
value: "some value"
description: "Just adding a description to make the linter happy, and get this variable prefilled when I run it manually"
So, "Add a description to a variable" in order to "prefill the variable in manual runs" is mismatched, I believe.
Users already have the ability to add descriptions like this in Code comments anyways.
I don't think our syntax is always intuitive, but I think this new syntax has a higher potential for misunderstanding/misuse than most. I really think we should reconsider.
Proposal
I propose separating the ability to add a description to variables from the ability to pre-fill the variables, by using a different keyword, that is simply a boolean, just like allow_failure
:
variables:
TEST:
value: "some value"
pre-fill: true # Optional and defaults to true if not defined, so it isn't a breaking change?
description: "This is the description that will be shown in the UI" # (Optional?)
Fabio's comment shows that this is probably a breaking change if we default pre-fill
to false
. I assume that in order for this proposal to be feasible, we'll have to have both description
and pre-fill
optional, and have pre-fill
default to `true.
Other wording ideas include:
manual-runs: true
manual-prefill: true
manual-default: true