Permit injected.py to reuse bot_config.py |
||
Issue description[cc'ing people who touched injected files in the past months as this could be interesting to them] Issues: - When creating an "injected" bot_config.py via bots.cfg, a lot of copy-paste is needed because it doesn't have access to the common one. - Because both the common one and the extra ones are named 'bot_config.py', it's hard to disambiguate when an exception occurs. Goals: - Enable users to not require copy pasta (to the extent possible). - Disambiguate the name of the two scripts. AIs: - Make the injected module have package name 'injected.py' - Make sure 'from config import bot_config' works in this file.
,
Jan 9 2018
This is confirmed to work.
,
Mar 14 2018
The following revision refers to this bug: https://chromium.googlesource.com/infra/luci/luci-py.git/+/f685a4f65ef76fae8580da564298a439aae0255d commit f685a4f65ef76fae8580da564298a439aae0255d Author: Marc-Antoine Ruel <maruel@chromium.org> Date: Wed Mar 14 01:16:54 2018 swarming: add support for importing bot_config from injected - Rename the injected bot config 'injected.py' when processed and define it as module 'injected'. - Confirm that the injected file can import the 'normal' one. R=vadimsh@chromium.org Bug: 795761 Change-Id: Id22ef5b75aa357633531b4125954d594baf68572 Reviewed-on: https://chromium-review.googlesource.com/832767 Commit-Queue: Marc-Antoine Ruel <maruel@chromium.org> Reviewed-by: Vadim Shtayura <vadimsh@chromium.org> [modify] https://crrev.com/f685a4f65ef76fae8580da564298a439aae0255d/appengine/swarming/swarming_bot/bot_code/bot_main.py [modify] https://crrev.com/f685a4f65ef76fae8580da564298a439aae0255d/appengine/swarming/swarming_bot/bot_code/bot_main_test.py |
||
►
Sign in to add a comment |
||
Comment 1 by bugdroid1@chromium.org
, Dec 18 2017