chaostoolkit-lib icon indicating copy to clipboard operation
chaostoolkit-lib copied to clipboard

Apply keys and values from extra_vars to experiment configurations

Open alexander-gorelik opened this issue 2 years ago • 3 comments

Hey @alexander-gorelik

As I mentioned in the issue, there is rationale for config keys to be full yexplicit. Otherwise, it can get complicated understanding where it came from when reading the experiment.

I think your change means it will implicitely inject config keys at runtime.

I think a larger approach is about how we can compose experiments, so you could define sections (like configs) in shared files and "include" them in experiments.

Lawouach avatar Aug 26 '21 07:08 Lawouach

@Lawouach That is actually what we are doing. Now it's not fully functional(in our point of view), it can only operate on existent keys in experiments forcing you to have all the keys you ever need in the exp file as empty values.

Regarding the explicit keys, it's correct but if someone chooses to use --var-file it is logical that he knows that his config comes from other files.

From one side it just increases the exp file with not required keys that you always need to remember to add for your injected config to work, from another side you will have better visibility from just looking at the exp file and seeing all the config in one place.

From our side, the former is more important because it reduces maintenance, copy-paste, and failed runs because someone forgot to add keys.

And we actually don't touch the config often after we finish writing the experiment.

alexander-gorelik avatar Aug 26 '21 07:08 alexander-gorelik

Right, I considered that one for a long time. While I'm still feeling a bit concerned about the ripple effect, I must admit I cannot quantify the risks of doing as you suggest.

So let's try how you propose because I can see the benefits. Let's try :)

Lawouach avatar Aug 31 '21 07:08 Lawouach