Commit 80012971 authored by Vadim Bendebury's avatar Vadim Bendebury Committed by Commit Bot

my_activity: allow to exclude some servers

Not all my_activity.py users have accounts on all servers the utility
queries. This results in access errors reported when the utility is
ran.

Also, many users never upload patches on some servers even though the
account is there, there is no point in querying those servers.

This patch allows to pass in a list of servers to exclude from the
list of queried servers.

BUG=none
TEST=invoked the utility as follows:

  $ my_activity.py --skip_servers \
    pdfium-review.googlesource.com,skia-review.googlesource.com

  observed that the 'ERROR:root:Access Errors:' messages are not
  generated any more.

Change-Id: I7d676e45ee99d883a153b58acb778a2e2d5ed74a
Signed-off-by: 's avatarVadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1487342Reviewed-by: 's avatarAaron Gable <agable@chromium.org>
parent 556c0a2e
......@@ -168,6 +168,7 @@ class MyActivity(object):
self.referenced_issues = []
self.google_code_auth_token = None
self.access_errors = set()
self.skip_servers = (options.skip_servers.split(','))
def show_progress(self, how='.'):
if sys.stdout.isatty():
......@@ -216,6 +217,8 @@ class MyActivity(object):
return []
def gerrit_search(self, instance, owner=None, reviewer=None):
if instance['url'] in self.skip_servers:
return []
max_age = datetime.today() - self.modified_after
filters = ['-age:%ss' % (max_age.days * 24 * 3600 + max_age.seconds)]
if owner:
......@@ -724,6 +727,11 @@ def main():
help='Do not fetch issues referenced by owned changes. Useful in '
'combination with --changes-by-issue when you only want to list '
'issues that have also been modified in the same time period.')
parser.add_option(
'--skip_servers',
action='store',
default='',
help='A comma separated list of gerrit and rietveld servers to ignore')
parser.add_option(
'--skip-own-issues-without-changes',
action='store_true',
......
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