git-cl: Don't report metrics for not-known repos.

It is not recorded by the server, but causes a 500 status anyway.

Bug: 896868
Change-Id: Ic3bf0d989bf3c3641dae9ea49a58ffb28f52e865
Reviewed-on: https://chromium-review.googlesource.com/c/1289769
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
changes/69/1289769/4
Edward Lesmes 6 years ago committed by Commit Bot
parent c1e6594df5
commit 93277a7fc8

@ -56,6 +56,7 @@ import git_cache
import git_common
import git_footers
import metrics
import metrics_utils
import owners
import owners_finder
import presubmit_support
@ -5899,7 +5900,10 @@ def main(argv):
settings = Settings()
if not metrics.DISABLE_METRICS_COLLECTION:
metrics.collector.add('project_urls', [settings.GetViewVCUrl().strip('/+')])
project_url = settings.GetViewVCUrl().strip('/+')
if project_url in metrics_utils.KNOWN_PROJECT_URLS:
metrics.collector.add('project_urls', [project_url])
colorize_CMDstatus_doc()
dispatcher = subcommand.CommandDispatcher(__name__)
try:

Loading…
Cancel
Save