Backend: CI interpolation with structs
Problem
There is no way to dynamically provide variables as inputs for a component so that the variables don't have to be in the global scope. The only potential option currently would be for the user of the component to know the name of a generated job, and override the job in their CI configuration to add the desired variables.
Proposal
Using this as an example, the input definition can be written like:
spec:
inputs:
vars:
type: struct
default:
VAR1: value1
VAR2: value2
VAR3: value3
These inputs can be used like:
test:
variables: $[[ inputs.vars ]] # defines all variables
and (possibly):
test:
variables:
<<: $[[ inputs.vars ]] # gets merged with other variables
VAR1: override1
VAR4: value4
and (like #407176 (closed)):
test:
script:
- echo "I am $[[ inputs.vars ]]" # gets stringified and inserted
This issue was based off of #407176 (closed), and inspired from renovate-bot/renovate-runner#98 (comment 1832306588). This could possibly be tracked under &10603.