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

Unified Diff: components/domain_reliability/bake_in_configs.py

Issue 1180223006: Domain Reliability: Simplify configs and reports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix memory leak in unittests 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
« no previous file with comments | « components/domain_reliability/BUILD.gn ('k') | components/domain_reliability/baked_in_configs.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/domain_reliability/bake_in_configs.py
diff --git a/components/domain_reliability/bake_in_configs.py b/components/domain_reliability/bake_in_configs.py
index 1a171c72c9e1398ee0193b1b978b2c7b0068b1c1..a6fa0ed6caf64642bc039a40e09a766477f6d4de 100755
--- a/components/domain_reliability/bake_in_configs.py
+++ b/components/domain_reliability/bake_in_configs.py
@@ -483,7 +483,11 @@ def read_json_files_from_file(list_file):
return shlex.split(list_text)
-def domain_is_whitelisted(domain):
+def origin_is_whitelisted(origin):
+ if origin.startswith('https://') and origin.endswith('/'):
+ domain = origin[8:-1]
+ else:
+ return False
return any(domain == e or domain.endswith('.' + e) for e in DOMAIN_WHITELIST)
@@ -557,14 +561,14 @@ def main():
print >> sys.stderr, "%s: error parsing JSON: %s" % (json_file, e)
found_invalid_config = True
continue
- if 'monitored_domain' not in config:
- print >> sys.stderr, '%s: no monitored_domain found' % json_file
+ if 'origin' not in config:
+ print >> sys.stderr, '%s: no origin found' % json_file
found_invalid_config = True
continue
- domain = config['monitored_domain']
- if not domain_is_whitelisted(domain):
- print >> sys.stderr, ('%s: monitored_domain "%s" not in whitelist' %
- (json_file, domain))
+ origin = config['origin']
+ if not origin_is_whitelisted(origin):
+ print >> sys.stderr, ('%s: origin "%s" not in whitelist' %
+ (json_file, origin))
found_invalid_config = True
continue
« no previous file with comments | « components/domain_reliability/BUILD.gn ('k') | components/domain_reliability/baked_in_configs.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698