python-rtmbot icon indicating copy to clipboard operation
python-rtmbot copied to clipboard

Implement passing configuration over environment variables

Open kpaleniu opened this issue 7 years ago • 4 comments

  • [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [x] I've read and agree to the Code of Conduct.
  • [x] I've been mindful about doing atomic commits, adding documentation to my changes, not refactoring too much.
  • [x] I've a descriptive title and added any useful information for the reviewer. Where appropriate, I've attached a screenshot and/or screencast (gif preferably).
  • [x] I've written tests to cover the new code and functionality included in this PR.
  • [x] I've read, agree to, and signed the Contributor License Agreement (CLA).

PR Summary

This pull request adds functionality for overriding configuration file content from environment variables. For example:

$ SLACK_TOKEN="xoxb-foo-bar" REPEAT_PLUGIN_DUMMY_VARIABLE="true" rtmbot

This will result in effectively the following rtmbot.conf:

SLACK_TOKEN: "xoxb-foo-bar"
plugins.repeat.RepeatPlugin:
    dummy_variable: "true"

All rtmbot-specific configuration variables can overridden. For plugin-specific configuration I left the limitation of treating all values as strings to keep code from getting overly complex.

All this is mentioned in the README.md that is also updated by this pull request.

Related Issues

Implements at least the environment variable portion of #89.

Test strategy

tests/test_rtmbot_runner.py includes unit tests that cover most usual cases that came to mind.

kpaleniu avatar May 11 '18 20:05 kpaleniu

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 11 '18 20:05 CLAassistant

Hi. What is the ETA for merging the change? I really miss this feature #86

nyukhalov avatar Sep 05 '18 10:09 nyukhalov

@Roach I think this should be merged. Having config in env vars is critical when running rtmbot in containers and/or kubernetes.

fzipi avatar Nov 21 '18 13:11 fzipi

@Roach could you merge this please - from the Perceptyx version I saw it also seemed to incorporate allowing the log to be set to STDOUT - which is also crucial.

Containers don't like log-files - the environments are ephemeral, but typically have good logging of stdout etc.

iangoldsmithsf avatar May 23 '19 09:05 iangoldsmithsf