Commit Graph

17 Commits (4e26781cf02cdac678a434afc1c88b37f06de8b9)

Author SHA1 Message Date
Michael Moss 5eebf6fa78 Add docstrings so gerrit_client subcommands display properly.
Running './gerrit_client.py' currently shows only "help" as an available
subcommand. Adding these docstrings allows it to properly show all the
other subcommands.

R=sokcevic@google.com

Change-Id: I44c9d63fe8d481cabade50311d0f630b0f747018
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3032207
Auto-Submit: Michael Moss <mmoss@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
4 years ago
Josip Sokcevic 84434e8481 Use py3 with gerrit_client.py
R=ehmaldonado@chromium.org

Change-Id: I93a4c20121010e8644982aa7910ff41884734f97
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2949972
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
4 years ago
Marco Georgaklis 85557a08f4 Implemented suppport for getrelatedchanges endpoint in gerrit module
The endpoint documentation can be found here:
https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-related-changes

This involved adding support for the command in gerrit_client and
gerrit_util and then incorporating functionality and testing into
the gerrit recipe module.

The reasoning for this is to be able to identify chained builds for
improved accuracy of the new test identification for the FLake
Endorser project.

Bug:1204163
Change-Id: Ic60c733540a9afd7ff159408b0ea9ad7aac078e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2928016
Commit-Queue: Marco Georgaklis <mgeorgaklis@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
4 years ago
Josip Sokcevic f5c6d8a27d Handle spaces in Gerrit search options
Gerrit rejects requests with 400 Bad request if query string `q`
contains any spaces. Replace spaces with a plus sign solves the problem.

R=thakis@chromium.org

Bug: 1199692
Change-Id: Ic13dda378527594c6cf57b8cb2edf740517811ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2832653
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
4 years ago
Josip Sokcevic e1a98941d3 Add mass-abandon to gerrit_client.py
mass-abandon allows users to mass abandon CLs based on search query.
Owner is always specified (either "me" or user defined via -p).

R=gavinmak@google.com, thakis@chromium.org

Change-Id: I789a3a1f3af22867ebbbc50c35b60486206ff403
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2811005
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
4 years ago
LaMont Jones 9eed4238d8 gerrit: add createchange changeedit publishchangeedit
Add calls to support creating changes, as well as editing and publishing
them in gerrit_client and gerrit_util.

Bug=b:182613582

Change-Id: I0514cf08dce63ab29d99d4485d96fa124006326a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2800811
Auto-Submit: LaMont Jones <lamontjones@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: LaMont Jones <lamontjones@chromium.org>
4 years ago
Josip Sokcevic 848a5361d7 Stop using /usr/bin/python directly
Use /usr/bin/env python instead

R=dpranke@google.com

Bug: 1191100
Change-Id: I8de37ea7a02e7236d3bd36d4bae8cf4ffcf75ab9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2780631
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
4 years ago
Josip Sokcevic df9a802ad2 Add change HEAD cli option to gerrit_client
This option modifies default branch of desired repository.

R=ehmaldonaldo@chromium.org, gavinmak@google.com

Change-Id: I1e20dc8d333c4301eacffff5049e3a98c3d59f75
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2575884
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
4 years ago
Mike Frysinger 8820ab859b gerrit_client: validate --param options
Passing an invalid --param option in leads to a crash lower down in
the gerrit modules which can be hard to trace back to the original
error: the user forgot the "key" in the "key=value".

Change-Id: I6fe5fab0fad15cf8d25173e0f1c8ea130efc44ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2558651
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
4 years ago
Josip Sokcevic c39ab997ba Support main as default branch
R=apolito@google.com

Change-Id: Ic338c698b8eb8d2e04fc1ef23ae4b13cae08b80f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2404701
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
4 years ago
Josip Sokcevic c99efb2f8c Add gerrit_client unit tests
Change-Id: Id4ca28da6c38f6403636ef8c4de5dae1206cb499
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2106518
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
5 years ago
Quinten Yearsley d9cbe7ad69 [git-cl] Lint and clean-up git-cl, test, and related modules
In this CL:
 - Clarify some comments.
 - Remove some unused imports.
 - Make some style more consistent (e.g. quotes, whitespace)

Tools used: pyflakes, flake8 (most warnings ignored)

Change-Id: Ibfb6733c8d844b3c75a7f50b4f3c1d43afabb0ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1773856
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
6 years ago
Sergiy Belozorov fe34723a55 Add gerrit.abandon_change command
R=tandrii@chromium.org

Bug: 935715
Change-Id: Ia7b8e2b187b59680270d694b24edf82493d1ed5c
Reviewed-on: https://chromium-review.googlesource.com/c/1487212
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
6 years ago
Sergey Berezin e866182f33 depot_tools: Fix executable bit for gerrit_*.py
BUG=628259
TBR=agable@chromium.org

Change-Id: I79bd59bb922d70c59a42ec09f153e9c9220fd9bb
Reviewed-on: https://chromium-review.googlesource.com/599362
Reviewed-by: Sergey Berezin <sergeyberezin@chromium.org>
Commit-Queue: Sergey Berezin <sergeyberezin@chromium.org>
8 years ago
Paweł Hajdan, Jr 24025d3e71 tryserver: add support for gerrit footers
Bug: 644609
Change-Id: Ied7439d688b89f90b9705968927521b5060c5fb4
Reviewed-on: https://chromium-review.googlesource.com/565564
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Michael Achenbach 6fbf12f21c Enable query for changes in gerrit recipe module
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>
8 years ago
dimu 833c94c6fb Create recipe_modules/gerrit to interact with gerrit REST API
BUG=
R=mmoss,agable

Change-Id: I6410c28280ed05cf384a3da93e6b154c6081e039
Reviewed-on: https://chromium-review.googlesource.com/427375
Reviewed-by: Michael Moss <mmoss@chromium.org>
8 years ago