New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 795761 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Permit injected.py to reuse bot_config.py

Project Member Reported by mar...@chromium.org, Dec 18 2017

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.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 18 2017

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/infradata/config/+/1be2be10285956a29b0c3cf83b064e1b9b80b0b4

commit 1be2be10285956a29b0c3cf83b064e1b9b80b0b4
Author: Marc-Antoine Ruel <maruel@chromium.org>
Date: Mon Dec 18 16:14:10 2017

Status: Fixed (was: Assigned)
This is confirmed to work.
Project Member

Comment 3 by bugdroid1@chromium.org, 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