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

Unified Diff: third_party/cq_client/validate_config.py

Issue 1475033006: Updated cq_client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Restore manual protobuf26 fixes Created 5 years, 1 month 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: third_party/cq_client/validate_config.py
diff --git a/third_party/cq_client/validate_config.py b/third_party/cq_client/validate_config.py
index 51fa7cf2b30daf240664a778270f0339dfcc20b8..b6d73db9b1107af81f282f0692ad7b3c8f67350d 100644
--- a/third_party/cq_client/validate_config.py
+++ b/third_party/cq_client/validate_config.py
@@ -23,16 +23,12 @@ from cq_client import cq_pb2
REQUIRED_FIELDS = [
'version',
- 'rietveld',
- 'rietveld.url',
'verifiers',
'cq_name',
]
LEGACY_FIELDS = [
'svn_repo_url',
- 'server_hooks_missing',
- 'verifiers_with_patch',
]
EMAIL_REGEXP = '^[^@]+@[^@]+\.[^@]+$'
@@ -92,7 +88,22 @@ def IsValid(cq_config):
logging.error('Failed to parse config as protobuf:\n%s', e)
return False
- for fname in REQUIRED_FIELDS:
+ if _HasField(config, 'gerrit'):
+ if _HasField(config, 'rietveld'):
+ logging.error('gerrit and rietveld are not supported at the same time.')
+ return False
+ # TODO(tandrii): validate gerrit.
+ required_fields = REQUIRED_FIELDS + ['gerrit.cq_verified_label']
+ if _HasField(config, 'verifiers.reviewer_lgtm'):
+ logging.error('reviewer_lgtm verifier is not supported with Gerrit.')
+ return False
+ elif _HasField(config, 'rietveld'):
+ required_fields = REQUIRED_FIELDS + ['rietveld.url']
+ else:
+ logging.error('either rietveld gerrit are required fields.')
+ return False
+
+ for fname in required_fields:
if not _HasField(config, fname):
logging.error('%s is a required field', fname)
return False
@@ -111,5 +122,4 @@ def IsValid(cq_config):
# TODO(sergiyb): For each field, check valid values depending on its
# semantics, e.g. email addresses, regular expressions etc.
-
return True
« third_party/cq_client/README.md ('K') | « third_party/cq_client/test/validate_config_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698