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
Relay and Cog currently provide per-bundle dynamic configuration. These config values are derived from a yaml file stored in a directory named after the related bundle. The file is re-read on each pipeline execution which allows for nearly instantaneous configuration changes.
The design presents a flattened configuration where all commands from the same bundle share the same config regardless of the invoking user or invocation location. It is sufficient for simple use cases but quickly becomes limited when you attempt to customize the configuration based on runtime attributes such as room or invoking user.
Design Overview
We can support per-room and per-user customization by extending dynamic configuration to include the notion of room- and user-specific "layers". Configuration layers overlay the base dynamic configuration based on who invoked a command and where the invocation occurred. Layers are applied using a small set of rules making them both deterministic and easy to understand.
Layers
Layers will be modeled as subdirectories inside a bundle's dynamic configuration directory. Room layer directories will be prefixed with room_. The room layer for DMs will be the special name room_direct. User layer directories will be prefixed with user_. For example, mist's dynamic configuration would look like the below diagram if it included both user and room layers.
Layers are evaluated in least-to-most specific order.
Base context (config.yaml, if it exists)
Room
User
Each subsequent layer can overwrite the contents of prior layers in the event of a conflict. In other words, room layer configuration overrides the starting named context and user layer overrides both.
Merging two layers together is a shallow merge of top-level keys only.
Layers are selected by exact case-insensitive string match. Room and user names are downcased before evaluating matches.
room_ops matches a command invocation from rooms named "Ops", "ops", and "OPS".
user_susan matches a command invocation from users named "susan", and "Susan".
The base layer is restricted to a single file named config.yaml for backwards compatibility and future extensibility.
Files in the room and user layers are processed by name sorted in lexicographical ascending order.
The text was updated successfully, but these errors were encountered:
Overview
Relay and Cog currently provide per-bundle dynamic configuration. These config values are derived from a yaml file stored in a directory named after the related bundle. The file is re-read on each pipeline execution which allows for nearly instantaneous configuration changes.
The design presents a flattened configuration where all commands from the same bundle share the same config regardless of the invoking user or invocation location. It is sufficient for simple use cases but quickly becomes limited when you attempt to customize the configuration based on runtime attributes such as room or invoking user.
Design Overview
We can support per-room and per-user customization by extending dynamic configuration to include the notion of room- and user-specific "layers". Configuration layers overlay the base dynamic configuration based on who invoked a command and where the invocation occurred. Layers are applied using a small set of rules making them both deterministic and easy to understand.
Layers
Layers will be modeled as subdirectories inside a bundle's dynamic configuration directory. Room layer directories will be prefixed with
room_
. The room layer for DMs will be the special nameroom_direct
. User layer directories will be prefixed withuser_
. For example,mist
's dynamic configuration would look like the below diagram if it included both user and room layers.Layer Composition Rules
config.yaml
, if it exists)room_ops
matches a command invocation from rooms named "Ops", "ops", and "OPS".user_susan
matches a command invocation from users named "susan", and "Susan".config.yaml
for backwards compatibility and future extensibility.The text was updated successfully, but these errors were encountered: