Commit f0517095 authored by Andrii Shyshkalov's avatar Andrii Shyshkalov Committed by LUCI CQ

git cl: remove check for likely wrong identities.

This was important 3+ years ago when we were migrating to Gerrit.
It is no longer important, and probably confusing to non-Googlers
and Googlers alike.

R=dpranke, maruel
TBR=ehmaldonado

Bug: 1148065
Change-Id: I79ad71b5afb9adac286780c2093b01f656491918
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2534850
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: 's avatarMarc-Antoine Ruel <maruel@chromium.org>
parent 26cd974a
......@@ -3038,24 +3038,6 @@ class _GitCookiesChecker(object):
counters = collections.Counter(h for h, _, _ in self.get_hosts_with_creds())
return set(host for host, count in counters.items() if count > 1)
_EXPECTED_HOST_IDENTITY_DOMAINS = {
'chromium.googlesource.com': 'chromium.org',
'chrome-internal.googlesource.com': 'google.com',
}
def get_hosts_with_wrong_identities(self):
"""Finds hosts which **likely** reference wrong identities.
Note: skips hosts which have conflicting identities for Git and Gerrit.
"""
hosts = set()
for host, expected in self._EXPECTED_HOST_IDENTITY_DOMAINS.items():
pair = self._get_git_gerrit_identity_pairs().get(host)
if pair and pair[0] == pair[1]:
_, domain = self._parse_identity(pair[0])
if domain != expected:
hosts.add(host)
return hosts
@staticmethod
def _format_hosts(hosts, extra_column_func=None):
......@@ -3100,14 +3082,6 @@ class _GitCookiesChecker(object):
tuple(self._get_git_gerrit_identity_pairs()[host])),
conflicting)
wrong = self.get_hosts_with_wrong_identities()
if wrong:
yield ('These hosts likely use wrong identity',
self._format_hosts(wrong, lambda host: '%s but %s recommended' %
(self._get_git_gerrit_identity_pairs()[host][0],
self._EXPECTED_HOST_IDENTITY_DOMAINS[host])),
wrong)
def find_and_report_problems(self):
"""Returns True if there was at least one problem, else False."""
found = False
......
......@@ -17,15 +17,8 @@
conflict.googlesource.com git-example.google.com vs git-example.chromium.org
These hosts likely use wrong identity:
chrome-internal.googlesource.com git-example.chromium.org but google.com recommended
chromium.googlesource.com git-example.google.com but chromium.org recommended
You can manually remove corresponding lines in your ~%(sep)s.gitcookies file and visit the following URLs with correct account to generate correct credential lines:
https://chrome-internal-review.googlesource.com/new-password
https://chromium-review.googlesource.com/new-password
https://conflict-review.googlesource.com/new-password
https://gpartial-review.googlesource.com/new-password
https://partial-review.googlesource.com/new-password
......@@ -490,7 +490,6 @@ class GitCookiesCheckerTest(unittest.TestCase):
self.assertEqual(set(), self.c.get_conflicting_hosts())
self.assertEqual(set(), self.c.get_duplicated_hosts())
self.assertEqual(set(), self.c.get_partially_configured_hosts())
self.assertEqual(set(), self.c.get_hosts_with_wrong_identities())
def test_analysis(self):
self.mock_hosts_creds([
......@@ -516,9 +515,6 @@ class GitCookiesCheckerTest(unittest.TestCase):
self.assertEqual(set(['partial.googlesource.com',
'gpartial-review.googlesource.com']),
self.c.get_partially_configured_hosts())
self.assertEqual(set(['chromium.googlesource.com',
'chrome-internal.googlesource.com']),
self.c.get_hosts_with_wrong_identities())
def test_report_no_problems(self):
self.test_analysis_nothing()
......
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