You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
variablesSpec := make([]spec.VariableSpec, 0)
stateVariables := getVariablesSpecFromEnvMap(jobSpec.StateEnvVars)
commandVariables := getVariablesSpecFromEnvMap(jobSpec.CommandEnvVars)
runVariables := getVariablesSpecFromEnvMap(jobSpec.RunEnvVars)
variablesSpec = append(variablesSpec, stateVariables...)
variablesSpec = append(variablesSpec, commandVariables...)
variablesSpec = append(variablesSpec, runVariables...)
// check for duplicates in list of variablesSpec
justNames := lo.Map(variablesSpec, func(item spec.VariableSpec, i int) string {
return item.Name
})
hasDuplicates := len(justNames) != len(lo.Uniq(justNames))
if hasDuplicates {
return nil, fmt.Errorf("could not load variables due to duplicates")
}
and it seems that we combine all of state, commands and run variables into a single list and then send them to a cli. Furthermore we are checking for duplicates accross all of the variables which is incorrect. For context digger.yml has variables defined like this:
What we are doing in that code block is combining all three types into one list and checking for duplicates which is incorrect. What we are also doing on the cli is we are exposing each variable in all three stages. What we should do instead:
check for duplication only in state individually, command individually, run individually
add an atribute to spec variable "stage" which can be state, commands, run
ensure that in the cli the variables are parsed to their correct stages
In the future we might have a key called "all" for variables that are exposed to all stages
The text was updated successfully, but these errors were encountered:
I just noticed this part of the code:
digger/backend/services/spec.go
Line 104 in 55068d3
and it seems that we combine all of state, commands and run variables into a single list and then send them to a cli. Furthermore we are checking for duplicates accross all of the variables which is incorrect. For context digger.yml has variables defined like this:
What we are doing in that code block is combining all three types into one list and checking for duplicates which is incorrect. What we are also doing on the cli is we are exposing each variable in all three stages. What we should do instead:
In the future we might have a key called "all" for variables that are exposed to all stages
The text was updated successfully, but these errors were encountered: