Commit 93277a7f authored by Edward Lesmes's avatar Edward Lesmes Committed by Commit Bot

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/1289769Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent c1e6594d
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment