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>
Ran:
vi $(git grep --name-only iteritems | grep -v third_party)
vi $(git grep --name-only itervalues | grep -v third_party)
vi $(git grep --name-only 'print ' | grep -v third_party)
and edited the files quickly with adhoc macros. Then ran in recipes/:
./recipes.py test train
There was only a small subset of files that had been updated to use
six.iteritems() and six.itervalues(). Since the dataset size that is
being used in gclient is small (pretty much always below 200 items),
it's better to just switch to .items() right away and take the temporary
performance hit, so that we don't need to come back to rewrite the code.
Recipe-Nontrivial-Roll: build
Bug: 984182
Change-Id: I5faf11486b66b0d73c9098ab0f2ce1b15a45c53e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854900
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Marc-Antoine Ruel <maruel@chromium.org>
I know that sometimes imports can have side-effects,
so unused imports shouldn't always be removed, but these
ones look like they could be.
Change-Id: Iea9f82afa99b0ea35f29a28f20ce0493b579cfee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1819860
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
While fetching monorail issues, @chromium.org is appended to the --user
option even if the original --user option is already a email address
(e.g. user@google.com).
Change-Id: I2442f4ea977b2681a72271f7c20fabb1ceaa351c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1790222
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Peter Lee <pkl@chromium.org>
my_activity.py prints out a help message when required, which has some
example ways to use my_activity.py. However the dates used are ambiguous
in terms of the date format used/required. This CL changes the example
to make it clearer that it is mm/dd/yy.
Change-Id: Id054739201e5c83528902b1f38d1c27c7bbc788b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1682498
Auto-Submit: Mohamed Heikal <mheikal@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Ran "2to3 -w -n -f except ./".
The scripts still work with Python 2.
There are no intended behaviour changes.
Bug: 942522
Change-Id: Ifa274cb83f74cfa8ce092fffbb88f3ab5309e72c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1607841
Commit-Queue: Raul Tambre <raul@tambre.ee>
Auto-Submit: Raul Tambre <raul@tambre.ee>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Ran "2to3 -w -n -f print ./" and manually added imports.
Ran "^\s*print " and "\s+print " to find batch/shell scripts, comments and the like with embedded code, and updated them manually.
Also manually added imports to files, which used print as a function, but were missing the import.
The scripts still work with Python 2.
There are no intended behaviour changes.
Bug: 942522
Change-Id: Id777e4d4df4adcdfdab1b18bde89f235ef491b9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1595684
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Auto-Submit: Raul Tambre <raul@tambre.ee>
If you specify the wrong year to the -b flag then you may end up with an
inverted time range that is entirely in the future, and this causes odd
failures. Or at least that's what I've heard. This detects some of these
error cases and halts.
Also a one-line git cl format cleanup.
Change-Id: Iede80faed00d4857443b3a1d853fa2ba69f47023
Reviewed-on: https://chromium-review.googlesource.com/c/1487744
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
my_activity.py tries to determine the current user with the USER
environment variable but on Windows it should use USERNAME. This change
gets it to check both, which saves users from having to use the -u
option and figure out what format the name should be in.
Change-Id: Id2458d29f8a2635a96dd3859d6af0ed5aaea22bf
Reviewed-on: https://chromium-review.googlesource.com/c/1479896
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Downside: the script now requires "-u user@chromium.org" or it results
in "error: USER is not set, please use -u".
Bug: 904604
Change-Id: I241ad440d0cf1a495ce6f57e48ed49d9d90a49d9
Reviewed-on: https://chromium-review.googlesource.com/c/1442851
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Also, sort all the gerrit instances by url for clarity.
Change-Id: I89aea98f75de33e8673c929fb07df3b686ea6c15
Reviewed-on: https://chromium-review.googlesource.com/1228659
Commit-Queue: enne <enne@chromium.org>
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
--completed-issues lists only monorail issues which are owned by the
user and have status Fixed|Verified.
R=sergiyb@chromium.org
Change-Id: I42737bb6ef81ffa463eedee209a2993f68b57d3a
Reviewed-on: https://chromium-review.googlesource.com/1227445
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Test: verified the same reviews list is produced w/o and w/ this change.
Change-Id: I72be85734a84d96a06b74515e64344fc203b1eed
Reviewed-on: https://chromium-review.googlesource.com/1227442
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
For some users who have a long history on the issue tracker, Monorail
queries were timing out with the default timeout.
Bug: 882266
Change-Id: Ib458f129d5a5f0eb04e035c016957730a1be1b99
Reviewed-on: https://chromium-review.googlesource.com/1214707
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
The script was crashing because of a missing 'email' value from some
gerrit results. Harden against the missing value.
BUG=None
Change-Id: I0f267f130e60e56d532ac2ec1a99ab108a3181e9
Reviewed-on: https://chromium-review.googlesource.com/1161504
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
This change fixes the filtering of Gerrit Reviews. Prior to this change
authored Changes were duplicated in the list of Reviews.
Bug: NONE
Change-Id: If0dceb3dc24ed12f039a9549ec22b9b78c3d80dd
Reviewed-on: https://chromium-review.googlesource.com/1145381
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1058722
changed the behaviour of reporting access errors to no longer
interleave them throughout the output, but instead batch them
together.
This CL had the side effect of changing the way the errors are printed
from using logging.error to print. This means that the errors are now
printing to stdout instead of stderr. This is causing personal scripts
I have for generating reports to fail, since they filtered out stderr.
Change-Id: I664f6166c55f8d20d3c35b63eda695335ab7f8a6
Reviewed-on: https://chromium-review.googlesource.com/1069213
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
When user invoking 'my_activity.py' does not have an account on one or
more of the servers the utility queries, access errors are reported
interleaving with access progress report printouts, this creates a
messy looking output.
With this patch access error messages are accumulated in a set and
then, if there are any, get printed out separately.
TEST=verified that error messages are printed neatly after servers
queries finished running:
> my_activity.py -u xxxyyzz
Loading data.................................
Access Errors:
Looking up 'pdfium-review.googlesource.com': Bad Request: User xxxyyzz not found
Looking up 'android-review.googlesource.com': Bad Request: User xxxyyzz not found
Looking up 'chrome-internal-review.googlesource.com': Bad Request: User xxxyyzz not found
Looking up 'chromium-review.googlesource.com': Bad Request: User xxxyyzz not found
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: Ie9f41110becb67936f49095ff36a8eeaa7a4f114
Reviewed-on: https://chromium-review.googlesource.com/1058722
Reviewed-by: Aaron Gable <agable@chromium.org>
There is no point in trying to retrieve issues information when the
issues list is empty, On top of that the attempt to start a thread
pool with zero threads generates an exception.
TEST=running my_activity.py when the user does not have issues on
certain servers does not cause the exception any more.
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: Ib5889a4c3390a01860fb31a4ff1a343e05b24051
Reviewed-on: https://chromium-review.googlesource.com/1058679
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
When specified it will skip any issues that were not modified in the specified
time period even if they are owned by the user.
R=tandrii@chromium.org
Change-Id: I230c8fa6cbc517c32edb8618a831a62ec6e45405
Reviewed-on: https://chromium-review.googlesource.com/978170
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
This also adds support for V8 project on issue tracker.
R=tandrii@chromium.org
Change-Id: Ie90ae664573d36030267b639e8a55bc349cad872
Reviewed-on: https://chromium-review.googlesource.com/966623
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
No more trying to remember format differences between my_activity.py
and my_reviews.py.
Change-Id: Iaac34529899a78aef3bd2e0742e674c8754f8afb
Reviewed-on: https://chromium-review.googlesource.com/655420
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
We no longer run any ssh-accessible Gerrit hosts; depot_tools only
communicates with *.googlesource.com repos, which use https.
R=tandrii@chromium.org
Bug: 365496
Change-Id: Idb7eb33f91aa19aff4247547c4aab560c27e51ba
Reviewed-on: https://chromium-review.googlesource.com/651317
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
This'll allow to query gerrit from recipes for e.g. current changes in
CQ.
Bug: 685318
Change-Id: I73d08d4b186b2e5fe044fd4d4fafd9db62e27066
Reviewed-on: https://chromium-review.googlesource.com/558939
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
This causes review links to be shown using crrev.com/c/ or crrev.com/i/,
which are the ones recommended at https://polygerrit.appspot.com/.
This gerrit server is no longer used only by CrOS.
Change-Id: Ie6b856390ec465f9d35a5035547f7b779392b24c
Reviewed-on: https://chromium-review.googlesource.com/526612
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
That JSON output format shows some additional fields such as bug number
for CLs, label and component for issues.
Also does minor changes like replacing the old code.google.com
references and using short urls when possible.
BUG=None
Change-Id: I988d292dc57b72a2f2c6f12096266df8a09a4dd8
Reviewed-on: https://chromium-review.googlesource.com/422203
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Nicolas Dossou-Gbété <dgn@chromium.org>
* convert diagnostic prints to logging
* add -v and -q options to control logging verbosity
* add -d option to fetch patchset data
* add format values:
(issues, changes,reviews)
- {created}: the date an activity was created
- {modified}: the date an activity was modified
- {status}: a status indicator for the activity
(changes,reviews)
- {activity}: a count of the number of comment interactions
(changes)
- {delta}: for changes, the number of lines added and removed
* use a default formatter for outputting that skips, rather than
chokes on, missing values.
Change-Id: Ib50c8c72b98b8ef5939d59ab93c5fc0a1a49599f
Reviewed-on: https://chromium-review.googlesource.com/451278
Commit-Queue: Marc-Antoine Ruel <maruel@chromium.org>
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
This change adds the functionality to display Short URLs for issues if possible.
BUG=
Change-Id: I250f3609e853663b576b8ff1c7e27e264b179755
Reviewed-on: https://chromium-review.googlesource.com/426318
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
This affects a bunch of files, but only changes comments,
and shouldn't make any difference to behavior.
The purpose is to slightly improve readability of pylint
disable comments.
Change-Id: Ic6cd0f8de792b31d91c6125f6da2616450b30f11
Reviewed-on: https://chromium-review.googlesource.com/420412
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>