Chromium Code Reviews| Index: scripts/slave/recipe_modules/chromium/api.py |
| diff --git a/scripts/slave/recipe_modules/chromium/api.py b/scripts/slave/recipe_modules/chromium/api.py |
| index 0232e4f795537c932a82adfb6f240719f64cb99d..4671f91150ee38f3f4c161642e7ca67602cd7fd2 100644 |
| --- a/scripts/slave/recipe_modules/chromium/api.py |
| +++ b/scripts/slave/recipe_modules/chromium/api.py |
| @@ -113,6 +113,52 @@ class ChromiumApi(recipe_api.RecipeApi): |
| """Adds builders to our builder map""" |
| self._builders.update(builders) |
| + def configure_bot(self, builders_dict, additional_configs=None): |
|
iannucci
2014/12/12 23:45:19
assuming that builders_dict is ~{mastername -> {bu
iannucci
2014/12/12 23:45:46
Actually.. that should probably be in the docstrin
Dirk Pranke
2014/12/12 23:59:48
Fixed.
|
| + """Sets up the configurations and gclient to be ready for bot update. |
| + |
| + Returns a tuple of (buildername, bot_config) for subsequent use in |
| + the recipe. |
| + """ |
| + additional_configs = additional_configs or [] |
| + |
| + # TODO: crbug.com/358481 . The build_config should probably be a property |
| + # passed in from slaves.cfg, but that doesn't exist today, so we need a |
| + # lookup mechanism to map bot name to build_config. |
| + mastername = self.m.properties.get('mastername') |
| + buildername = self.m.properties.get('buildername') |
| + master_dict = builders_dict.get(mastername, {}) |
| + bot_config = master_dict.get('builders', {}).get(buildername) |
| + |
| + self.set_config('chromium', **bot_config.get('chromium_config_kwargs', {})) |
| + |
| + for c in bot_config.get('chromium_apply_config', []): |
| + self.apply_config(c) |
| + |
| + for c in additional_configs: |
| + self.apply_config(c) |
| + |
| + # Note that we have to call gclient.set_config() and apply_config() *after* |
| + # calling chromium.set_config(), above, because otherwise the chromium |
| + # call would reset the gclient config to its defaults. |
| + self.m.gclient.set_config('chromium') |
| + for c in bot_config.get('gclient_apply_config', []): |
| + self.m.gclient.apply_config(c) |
| + |
| + if bot_config.get('set_component_rev'): |
| + # If this is a component build and the main revision is e.g. blink, |
| + # webrtc, or v8, the custom deps revision of this component must be |
| + # dynamically set to either: |
| + # (1) 'revision' from the waterfall, or |
| + # (2) 'HEAD' for forced builds with unspecified 'revision'. |
| + component_rev = self.m.properties.get('revision') or 'HEAD' |
| + dep = bot_config.get('set_component_rev') |
| + self.m.gclient.c.revisions[dep['name']] = dep['rev_str'] % component_rev |
| + |
| + if self.m.tryserver.is_tryserver: |
| + self.m.step.auto_resolve_conflicts = True |
| + |
| + return (buildername, bot_config) |
| + |
| def compile(self, targets=None, name=None, |
| force_clobber=False, **kwargs): |
| """Return a compile.py invocation.""" |