From @christophermaier on July 28, 2016 19:12
With the addition of layered dynamic bundle configuration, command execution can be customized based on which user is executing the command, and what chat room they do it from. The API and cogctl can both be used to manipulate individual configuration layers, but there is manual work to be done if you want to get a sense of the command execution environment in effect for a specific room / user combination.
It would be nice to have a cogctl dynamic-command effective command to fill this gap, allowing administrators to be able to troubleshoot configuration-related issues. Specifying the bundle and optional --room and --user arguments would display the appropriately merged configuration.
It would be a good idea to implement this merging logic in Cog and expose it to cogctl via a new API endpoint. Relay already implements this merging logic internally when running in non-managed dynamic configuration mode, but cogctl shouldn't be the place to implement it; it should just straightforwardly consume the API.
We can display the output as plain YAML by default, but having an output option (maybe --as-env-vars?) would be nice, allowing users to run
export $(cogctl dynamic-config effective my-bundle --room=ops --user=bob --as-env-vars)
to help with debugging.
Copied from original issue: operable/cog#889
From @christophermaier on July 28, 2016 19:12
With the addition of layered dynamic bundle configuration, command execution can be customized based on which user is executing the command, and what chat room they do it from. The API and
cogctlcan both be used to manipulate individual configuration layers, but there is manual work to be done if you want to get a sense of the command execution environment in effect for a specific room / user combination.It would be nice to have a
cogctl dynamic-command effectivecommand to fill this gap, allowing administrators to be able to troubleshoot configuration-related issues. Specifying the bundle and optional--roomand--userarguments would display the appropriately merged configuration.It would be a good idea to implement this merging logic in Cog and expose it to
cogctlvia a new API endpoint. Relay already implements this merging logic internally when running in non-managed dynamic configuration mode, butcogctlshouldn't be the place to implement it; it should just straightforwardly consume the API.We can display the output as plain YAML by default, but having an output option (maybe
--as-env-vars?) would be nice, allowing users to runto help with debugging.
Copied from original issue: operable/cog#889