Commit Graph

101 Commits (main)

Author SHA1 Message Date
Andrew Grieve 0b3c297363 my_activity.py: Handle JSON parse errors
Getting a lot of "(401) Unauthorized" responses for these now. This at
least makes the script not crash.

Change-Id: Ib42ccbdb3326a0918015e9d5e1cc9392a9c1a469
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6049877
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
3 months ago
Aravind Vasudevan 1f441eb375 [fix_encoding] Remove fix_encoding
The fix_encoding module within depot_tools was included back in the python2[1] days to as a be all encoding fix boilerplate that is called across depot_tools scripts.

However, now that depot_tools officially deprecated support for py2 and support >= 3.8[2], the boilerplate is not needed anymore.

* `fix_win_codec()`[3] The 'cp65001' codec issue this fixes is fixed in python 3.3[4].
* `fix_default_encoding()`[5] python3 defaults to utf8.
* `fix_win_sys_argv()`[6] sys.srgv unicode issue is fixed in python3[7].
* `fix_win_console()`[8] Fixed[9].

[1] https://codereview.chromium.org/6721029
[2] https://crrev.com/371aa997c04791d21e222ed43a1a0d55b450dd53/README.md
[3] https://source.chromium.org/chromium/chromium/tools/depot_tools/+/main:fix_encoding.py;l=123-132;drc=cfa826c9845122d445dce4f51f556381865dbed3
[4] https://github.com/python/cpython/issues/57425#issuecomment-1093559969
[5] https://source.chromium.org/chromium/chromium/tools/depot_tools/+/main:fix_encoding.py;l=29-66;drc=cfa826c9845122d445dce4f51f556381865dbed3
[6] https://crsrc.org/d/fix_encoding.py;l=73-120;drc=cfa826c9845122d445dce4f51f556381865dbed3
[7] https://github.com/python/cpython/issues/46381#issuecomment-1093409968
[8] https://source.chromium.org/chromium/chromium/tools/depot_tools/+/main:fix_encoding.py;l=315-344;drc=cfa826c9845122d445dce4f51f556381865dbed3
[9] https://github.com/python/cpython/issues/45943#issuecomment-1093402603

Bug: 1501984
Change-Id: I1d512a4b1bfe14e680ac0aa08027849b999cc638
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5263016
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
1 year ago
Josip Sokcevic 371aa997c0 Delete py2 checks
No script can run on py2 (due to print syntax change), so those
checks are useless (will never be printed).

Change-Id: I9cc7bc8b2665dd09cc7f8939ba255956f96af88a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5262958
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
1 year ago
Gavin Mak edba22d4eb Fix multiline comment formatting
Many incorrectly formatted comments exist from the switch to
4 space indent: https://crrev.com/c/4836379

Bug: 1514505
Change-Id: I6366f9da812919bd35b999f18fa8a49b7a66c09b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5153633
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
1 year ago
Gavin Mak f936d540e1 Remove __future__ imports
All __future__ imports (unicode_literals, print_function) are already
mandatory in py3. Also remove an outdated py2 comment in
presubmit_canned_checks.py

Bug: 1475402
Change-Id: I27cf6a8268f6dd1081f22af782c4c29a975376ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4867135
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
1 year ago
Mike Frysinger 124bb8e53c switch to 4 space indent
Leave the recipes/ code at 2 space to match the rest of the recipes
project in other repos.

Reformatted using:
files=( $(
	git ls-tree -r --name-only HEAD | \
		grep -Ev -e '^(third_party|recipes)/' | \
		grep '\.py$';
	git grep -l '#!/usr/bin/env.*python' | grep -v '\.py$'
) )
parallel ./yapf -i -- "${files[@]}"
~/chromiumos/chromite/contrib/reflow_overlong_comments "${files[@]}"

The files that still had strings that were too long were manually
reformatted because they were easy and only a few issues.
autoninja.py
clang_format.py
download_from_google_storage.py
fix_encoding.py
gclient_utils.py
git_cache.py
git_common.py
git_map_branches.py
git_reparent_branch.py
gn.py
my_activity.py
owners_finder.py
presubmit_canned_checks.py
reclient_helper.py
reclientreport.py
roll_dep.py
rustfmt.py
siso.py
split_cl.py
subcommand.py
subprocess2.py
swift_format.py
upload_to_google_storage.py

These files still had lines (strings) that were too long, so the pylint
warnings were suppressed with a TODO.
auth.py
gclient.py
gclient_eval.py
gclient_paths.py
gclient_scm.py
gerrit_util.py
git_cl.py
presubmit_canned_checks.py
presubmit_support.py
scm.py

Change-Id: Ia6535c4f2c48d46b589ec1e791dde6c6b2ea858f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4836379
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Aravind Vasudevan bb14391a50 Remove unused imports from depot_tools scripts
This change removes some unused imports across depot_tools scripts.

Change-Id: Ic1112065ad1020fc4a3573d3fb9f137915ef439c
Bug: 1475776
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4812185
Auto-Submit: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Aravind Vasudevan c5f0cbb865 Use pylint 2.7 for depot_tools
This includes a few fixes for specific errors, and disables several new
warnings introduced in this version, in order to allow for an incremental migration.

Bug:1262286
Change-Id: I4b8f8fc521386419a3121bbb07edc8ac83170a94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3413679
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
3 years ago
Josip Sokcevic 42c5bbbc96 Revert "Use pylint 2.7 for depot_tools"
This reverts commit 22bf605bb6.

Reason for revert: breaks gclient sync

Original change's description:
> Use pylint 2.7 for depot_tools
>
> This includes a few fixes for specific errors, and disables several new
> warnings introduced in this version, in order to allow for an incremental migration.
>
> Bug:1262286
> Change-Id: Ie97d686748c9c952e87718a65f401c5f6f80a5c9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3400616
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>

Bug: 1262286
Change-Id: Ieb946073c7886c7bf056ce843a5a48e82becf7a5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3413672
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
3 years ago
Aravind Vasudevan 22bf605bb6 Use pylint 2.7 for depot_tools
This includes a few fixes for specific errors, and disables several new
warnings introduced in this version, in order to allow for an incremental migration.

Bug:1262286
Change-Id: Ie97d686748c9c952e87718a65f401c5f6f80a5c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3400616
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
3 years ago
Josip Sokcevic 4940cc4b8f Require certifi package and python3 in my_activity
my_activity.py talks to third party (e.g. review.coreboot.org). Without
certifi package, making https connection may result in
CERTIFICATE_VERIFY_FAILED.

Adding certifi package to .vpython (py2) doesn't work, so this change
drops py2 support for my_activity.py.

R=gavinmak@google.com

Fixed: 1255921
Change-Id: I515b14c81d37a52d482d08085d8029c791911ae8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3206906
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
3 years ago
Nicolas Boichat cd3696cf7e my_activity: Add config file option to add additional gerrit instances
my_activity can definitely be useful outside of Chromium, and the
gerrit instances are sometimes private. This allows users to carry
an additional list of instances in a json file (and possibly
monorail projects, but that seems like likely to be useful).

Change-Id: Ic0fec3bd4f815200f27cc0a8530cfd88f4328269
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2925677
Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
4 years ago
Ryan Harrison 9781115e15 Add Tint to list of Monorail projects
Change-Id: I370f023c7c4a5e5b1d1c1322bc443c7c375e1089
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2792341
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
4 years ago
Paul Fagerburg b93d82c4c5 my_activity.py: add coreboot gerrit
Add review.coreboot.org to the list of gerrit repos that
my_activity.py will query to find CLs.

Change-Id: I2c78c3365ee77f6a99ca6a39deda08bb913be5c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2350325
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Dirk Pranke <dpranke@google.com>
5 years ago
Vincent Scheib 2be61a1df4 Document the parameter {heading} avilable to --output-format-heading.
R=jsbell@chromium.org

Change-Id: Ia0db8fe7494306147e0e80f49e229f50b8603f09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2214243
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Vincent Scheib <scheib@chromium.org>
5 years ago
Edward Lesmes ae3586b538 depot_tools: Use gclient_utils.AskForData instead of raw_input.
gclient_utils.AskForData will use raw_input on Python 2 and input on Python 3.

Bug: 1063976
Change-Id: I93c059c4e4454d01787716b5a0a2641ad5253f53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2116370
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur a3b6fd06f9 Reland "my_activity.py: Run using vpython3 by default."
Fix issue with gerrit_util.py and add tests.

Change-Id: Ie523ea59ddb93cf5c7fa35f3761310ce96747720
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2081092
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lesmes eb5dabf901 Revert "my_activity.py: Run using vpython3 by default."
This reverts commit 488712ab57.

Reason for revert: Breaks when running on vpython3

Original change's description:
> my_activity.py: Run using vpython3 by default.
> 
> Also, prompt users to use vpython3 when running my_activity.py
> using Python 2.
> 
> Change-Id: I078517832520b3c7baf3324f83e9a3b5194a5bcb
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2079703
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>

TBR=ehmaldonado@chromium.org,apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com,sokcevic@google.com

Change-Id: Ib217e8ec3613ee6645149f3d78ef9534ac68af8b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2080201
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur 488712ab57 my_activity.py: Run using vpython3 by default.
Also, prompt users to use vpython3 when running my_activity.py
using Python 2.

Change-Id: I078517832520b3c7baf3324f83e9a3b5194a5bcb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2079703
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Mike Frysinger 24fd86307f my_activity: search gerrit review too
This is where PolyGerrit & repo & other Gerrit CLs land.

Change-Id: If584cfce7d6e78f01e30531e5eee70a51a354164
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2079413
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
5 years ago
Mike Frysinger fdf027a728 my_activity: add short url for android CLs
Change-Id: I7e9c7c38b82d746cad28685f0eb8e24cc2f41572
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2079412
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur ab9cc2c149 my_activity: Add some tests and fix some bugs
Change-Id: Ib5625ae9d052eca9d6c6b64f12f64e6697aef7a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2072874
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur 2a04803267 my_activity: Make compatible with Python 3.
Bug: 1009820
Change-Id: I2aa619eb1cc70f7cacd27cbc2afc5c04c3a77d1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2001224
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Vadim Bendebury 800129711d 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>
5 years ago
Edward Lemur 202c559cac depot_tools: Include httplib2 using vpython.
Bug: 1002153
Change-Id: I940b9d834c2f76caab2bd86fc5d5d5c3b03b4b46
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1871763
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur 5b929a4926 depot_tools: Clean up auth.py
Bug: 1001756
Change-Id: I495991c30f7f00de17e7c098e2d88ef7783aff3c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1865265
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Marc-Antoine Ruel 8e57b4bc55 python3 improvements
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>
5 years ago
Edward Lemur b4a587df5e depot_tools: Remove depot-tools-auth
Users must use luci-auth now.

Bug: 1001756
Change-Id: I04cab6bdbfbd958f386a4cab761dfe4d34073afc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1849810
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
5 years ago
Quinten Yearsley 3841eaa164 Remove unused imports in depot_tools/*.py
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>
6 years ago
Ryan Harrison 06e1869f2b Add Dawn to projects for my_activity.py
Change-Id: Id22cde5b5c113fb1145c30afb6671ac2ec32afb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1819547
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Peter K. Lee 711dc5e1ad Use value of --user as monorail email address if it is an email address
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>
6 years ago
Jamie Madill 1db68ea0ba Add ANGLE issue tracker to my_activity.py.
Useful tool for perf for the ANGLE team.

Bug: None
Change-Id: I78c3b7d8a4e2a6d19f6b2ea2c8e6d67b2a4dc0af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1778979
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
6 years ago
Edward Lemur f4e0cc69ee depot_tools: Remove rietvelt code.
Bug: 984182
Change-Id: I0ad2f612f681644b78353195e451e43da936ac9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1709640
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
6 years ago
Mohamed Heikal dc37feb99d Make it clear in the help message that my_activity.py dates are mm/dd/yy
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>
6 years ago
Raul Tambre 7c93846385 Convert except statements to be Python 3 compatible
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>
6 years ago
Raul Tambre 80ee78e7fa Convert print statements to Python 3 style
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>
6 years ago
Lutz Justen 860378ee9e my_activity.py: Add date to format
Allows adding the created and modified dates to the output. Doesn't
change the default behavior.

Example:
$ my_activity.py --begin=01/01/19 -f "{created} {modified} {url} {title}"
2018-12-19 2019-01-09 https://crbug.com/916521 Tests do not resolve libbrillo-libchrome dependency properly
2018-12-05 2019-01-14 https://crbug.com/912312 authpolicy: Cache authentication data

BUG=None

Change-Id: Idfe8aa9553dfb8f9774ee4915e85b6167e6fb75b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1511252
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
6 years ago
Bruce Dawson 2afcf22ad1 Check for impossible date ranges
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>
6 years ago
Bruce Dawson 843709611f Support USERNAME as well as USER environment variable
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>
6 years ago
Gabriel Charette bc6617a165 [depot_tools] Turn my_activity.py into a vpython script
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>
6 years ago
Adrienne Walker 95d4c85563 Add skia reviews to my_activity
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>
7 years ago
Gabriel Charette 482d615b83 Revert "my_activity: Add review.coreboot.org as a source"
This reverts https://chromium-review.googlesource.com/1173069

It breaks my_activity.py on Windows.

R=iannucci@chromium.org, rrangel@chromium.org

Bug: 888641
Change-Id: I353489e52155d40e48e63819dc3016cf7dd59277
Reviewed-on: https://chromium-review.googlesource.com/1241133
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
7 years ago
Andrii Shyshkalov 8bdc1b8a04 my_activity: add --completed-issues option.
--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>
7 years ago
Andrii Shyshkalov 4aedec01f5 my_activity: faster Gerrit reviews search.
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>
7 years ago
Kenneth Russell 66badbd1cb Increase timeout to Http instance passed to authenticator.
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>
7 years ago
Peter K. Lee 9342ac02c1 Adds --merged-only command line option
Adds status:merged to gerrit filter.

Bug: 878433
Change-Id: Ica081fa0cd0e8a267ec0a8d711f749b4e91faec5
Reviewed-on: https://chromium-review.googlesource.com/1194310
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Peter Lee <pkl@chromium.org>
7 years ago
Raul E Rangel c27134c232 my_activity: Add review.coreboot.org as a source
BUG=none
TEST=Made sure my coreboot commits show up

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: If4e3fd501d844da56555a065e2911748a450b36c
Reviewed-on: https://chromium-review.googlesource.com/1173069
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
7 years ago
Don Garrett 2ebf9fdade my_activity: Don't crash if email unset.
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>
7 years ago
jdoerrie 356c288a10 [my_activity] Fix Filtering of Gerrit Reviews
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>
7 years ago
Andrii Shyshkalov 483580b38e Remove unnecessary de-duplication.
Follow up on https://crrev.com/c/1113036/2/my_activity.py#752

R=sergiyb@chromium.org

Change-Id: I56e4936f2f2bc94a734aeb510594ee8384d6e2a9
Reviewed-on: https://chromium-review.googlesource.com/1121816
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago