From 6cfe8d430161cc03089ca3b1fe2a4c418681b09d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Hajdan=2C=20Jr?= Date: Thu, 1 Jun 2017 18:52:14 +0200 Subject: [PATCH] Add disable_syntax_validation gclient config to easily whitelist builders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: 570091 Change-Id: Icb15bcd354c9b524674c6b4496f430c26cf7b89e Reviewed-on: https://chromium-review.googlesource.com/521482 Reviewed-by: Andrii Shyshkalov Reviewed-by: John Budorick Commit-Queue: Paweł Hajdan Jr. --- recipes/recipe_modules/bot_update/api.py | 2 +- recipes/recipe_modules/gclient/config.py | 6 ++++++ recipes/recipe_modules/gclient/example.py | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/recipes/recipe_modules/bot_update/api.py b/recipes/recipe_modules/bot_update/api.py index c9e3ca06b..b4c92aa18 100644 --- a/recipes/recipe_modules/bot_update/api.py +++ b/recipes/recipe_modules/bot_update/api.py @@ -243,7 +243,7 @@ class BotUpdateApi(recipe_api.RecipeApi): cmd.append('--gerrit_no_reset') if gerrit_no_rebase_patch_ref: cmd.append('--gerrit_no_rebase_patch_ref') - if disable_syntax_validation: + if disable_syntax_validation or cfg.disable_syntax_validation: cmd.append('--disable-syntax-validation') # Inject Json output for testing. diff --git a/recipes/recipe_modules/gclient/config.py b/recipes/recipe_modules/gclient/config.py index 73b650282..ab1a1e713 100644 --- a/recipes/recipe_modules/gclient/config.py +++ b/recipes/recipe_modules/gclient/config.py @@ -90,6 +90,8 @@ def BaseConfig(USE_MIRROR=True, CACHE_DIR=None, required=False, hidden=True), + disable_syntax_validation = Single(bool, empty_val=False, required=False), + USE_MIRROR = Static(bool(USE_MIRROR)), # TODO(tandrii): remove PATCH_PROJECT field. # DON'T USE THIS. WILL BE REMOVED. @@ -106,6 +108,10 @@ def ChromiumGitURL(_c, *pieces): def ChromeInternalGitURL(_c, *pieces): # pragma: no cover return '/'.join(('https://chrome-internal.googlesource.com',) + pieces) +@config_ctx() +def disable_syntax_validation(c): + c.disable_syntax_validation = True + @config_ctx() def android(c): c.target_os.add('android') diff --git a/recipes/recipe_modules/gclient/example.py b/recipes/recipe_modules/gclient/example.py index b5a0d8216..54ed52604 100644 --- a/recipes/recipe_modules/gclient/example.py +++ b/recipes/recipe_modules/gclient/example.py @@ -20,6 +20,7 @@ TEST_CONFIGS = [ 'crashpad', 'custom_tabs_client', 'dart', + 'disable_syntax_validation', 'gerrit_test_cq_normal', 'gyp', 'infra',