Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1717)

Unified Diff: scripts/slave/recipe_modules/bot_update/api.py

Issue 275303003: Reland: Use real revision mapping in bot_update module (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Fix nits, copy GOT_REVISION_MAPPING sub-dict to avoid modifying the global one. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: scripts/slave/recipe_modules/bot_update/api.py
diff --git a/scripts/slave/recipe_modules/bot_update/api.py b/scripts/slave/recipe_modules/bot_update/api.py
index ad1815e02e7dbc9317ec278b8e701382bc46489f..fe040e7945459da0abaedb24408db01e1a9172d2 100644
--- a/scripts/slave/recipe_modules/bot_update/api.py
+++ b/scripts/slave/recipe_modules/bot_update/api.py
@@ -90,6 +90,10 @@ class BotUpdateApi(recipe_api.RecipeApi):
# If patch_url is present, bot_update will actually ignore issue/ps.
issue = patchset = None
+ rev_map = {}
+ if self.m.gclient.c:
+ rev_map = self.m.gclient.c.got_revision_mapping.as_jsonish()
+
flags = [
# 1. Do we want to run? (master/builder/slave).
['--master', master],
@@ -100,7 +104,7 @@ class BotUpdateApi(recipe_api.RecipeApi):
['--spec', spec_string],
['--root', root],
['--revision', revision],
- ['--revision_mapping', self.m.properties.get('revision_mapping')],
+ ['--revision_mapping_file', self.m.json.input(rev_map)],
# 3. How to find the patch, if any (issue/patchset/patch_url).
['--issue', issue],
@@ -115,19 +119,10 @@ class BotUpdateApi(recipe_api.RecipeApi):
for item in flag_set if flag_set[1] is not None]
# Inject Json output for testing.
- try:
- revision_map_data = self.m.gclient.c.got_revision_mapping
- except AttributeError:
- revision_map_data = {}
git_mode = self.m.properties.get('mastername') in GIT_MASTERS
first_sln = cfg.solutions[0].name
- step_test_data = lambda : self.test_api.output_json(master,
- builder,
- slave,
- root,
- first_sln,
- revision_map_data,
- git_mode)
+ step_test_data = lambda: self.test_api.output_json(
+ master, builder, slave, root, first_sln, rev_map, git_mode)
def followup_fn(step_result):
if update_presentation:

Powered by Google App Engine
This is Rietveld 408576698