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

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

Issue 2166673002: Pass buildbucket.build.id to cbuildbot as --buildbucket-id. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 5 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/chromite/api.py
diff --git a/scripts/slave/recipe_modules/chromite/api.py b/scripts/slave/recipe_modules/chromite/api.py
index b7da9be2e63641f0e9ce572e9a6ba7e9cd761aa3..41ee4038f9ec6bb6f351743cdac84d7a17b1262e 100644
--- a/scripts/slave/recipe_modules/chromite/api.py
+++ b/scripts/slave/recipe_modules/chromite/api.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import cgi
+import json
dnj (Google) 2016/07/20 01:37:06 We actually have a recipe module called "json": ht
nxia1 2016/07/20 05:24:22 looks like it's already imported.
import re
from recipe_engine import recipe_api
@@ -69,6 +70,11 @@ class ChromiteApi(recipe_api.RecipeApi):
}
if 'buildnumber' in self.m.properties:
defaults['CBB_BUILD_NUMBER'] = int(self.m.properties['buildnumber'])
+
+ if 'buildbucket' in self.m.properties:
+ buildbucket_json = json.loads(self.m.properties.get('buildbucket'))
dnj (Google) 2016/07/20 01:37:06 Use recipe module "self.m.json.loads" here instead
nxia1 2016/07/20 05:24:22 Done.
+ defaults['CBB_BUILDBUCKET_ID'] = buildbucket_json['build']['id']
+
return defaults
def _load_config_dump(self):
@@ -348,6 +354,8 @@ class ChromiteApi(recipe_api.RecipeApi):
cbb_args.extend(['--chrome_version', self.c.cbb.chrome_version])
if self.c.cbb.config_repo:
cbb_args.extend(['--config_repo', self.c.cbb.config_repo])
+ if self.c.cbb.buildbucket_id:
+ cbb_args.extend(['--buildbucket-id', self.c.cbb.buildbucket_id])
if self.c.repo_cache_dir and self.c.cbb.supports_repo_cache:
cbb_args.extend(['--repo-cache', self.c.repo_cache_dir])
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/chromite/config.py » ('j') | scripts/slave/recipes/cros/cbuildbot_tryjob.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698