It's pretty common in the Bazel ecosystem to use starlark to manage configuration. A starlark struct could be composed programatically and then loaded elsewhere in the build graph (i.e., augmenting a test target).