diff --git a/gclient.py b/gclient.py index e14ee41a83..d9341a54a2 100755 --- a/gclient.py +++ b/gclient.py @@ -105,6 +105,7 @@ import gclient_scm import gclient_utils import git_cache import metrics +import metrics_utils from third_party.repo.progress import Progress import subcommand import subprocess2 @@ -1399,6 +1400,15 @@ it or fix the checkout. except KeyError: raise gclient_utils.Error('Invalid .gclient file. Solution is ' 'incomplete: %s' % s) + metrics.collector.add( + 'project_urls', + [ + dep.url if not dep.url.endswith('.git') else dep.url[:-len('.git')] + for dep in deps_to_add + if dep.FuzzyMatchUrl(metrics_utils.KNOWN_PROJECT_URLS) + ] + ) + self.add_dependencies_and_close(deps_to_add, config_dict.get('hooks', [])) logging.info('SetConfig() done') diff --git a/metrics_utils.py b/metrics_utils.py index 9f51182de9..baabeea7e0 100644 --- a/metrics_utils.py +++ b/metrics_utils.py @@ -26,6 +26,27 @@ NOTICE_FOOTER = ( '*****************************************************\n' ) +KNOWN_PROJECT_URLS = { + 'https://chrome-internal.googlesource.com/chrome/ios_internal', + 'https://chrome-internal.googlesource.com/infra/infra_internal', + 'https://chromium.googlesource.com/breakpad/breakpad', + 'https://chromium.googlesource.com/chromium/src', + 'https://chromium.googlesource.com/chromium/tools/depot_tools', + 'https://chromium.googlesource.com/crashpad/crashpad', + 'https://chromium.googlesource.com/external/gyp', + 'https://chromium.googlesource.com/external/naclports', + 'https://chromium.googlesource.com/infra/goma/client', + 'https://chromium.googlesource.com/infra/infra', + 'https://chromium.googlesource.com/native_client/', + 'https://chromium.googlesource.com/syzygy', + 'https://chromium.googlesource.com/v8/v8', + 'https://dart.googlesource.com/sdk', + 'https://pdfium.googlesource.com/pdfium', + 'https://skia.googlesource.com/buildbot', + 'https://skia.googlesource.com/skia', + 'https://webrtc.googlesource.com/src', +} + def get_python_version(): """Return the python version in the major.minor.micro format."""