mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
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: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1487342
Reviewed-by: Aaron Gable <agable@chromium.org>
This commit is contained in:
committed by
Commit Bot
parent
556c0a2e0f
commit
800129711d
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user