Commit Graph

28 Commits (642a989069adfd499e516e7ca5a797d4dbf5441e)

Author SHA1 Message Date
Gavin Mak 642a989069 Reland "Drop py2 support in recipe modules"
This is a reland of commit 5819c303f0

Original change's description:
> Drop py2 support in recipe modules
>
> python3 is the only supported version of python in depot_tools.
>
> Bug: 1475402
> Change-Id: I479de09a0c34b438aced35e4ced58a5972108132
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4808518
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> Commit-Queue: Gavin Mak <gavinmak@google.com>

Bug: 1475402
Change-Id: Ie4e6612a95511026b7602837f8dd3030bcf3ef8a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4811285
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Gavin Mak a5f17dd7b3 Revert "Drop py2 support in recipe modules"
This reverts commit 5819c303f0.

Reason for revert: breaking dart builds

Original change's description:
> Drop py2 support in recipe modules
>
> python3 is the only supported version of python in depot_tools.
>
> Bug: 1475402
> Change-Id: I479de09a0c34b438aced35e4ced58a5972108132
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4808518
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> Commit-Queue: Gavin Mak <gavinmak@google.com>

Bug: 1475402
Change-Id: I0fef7581835bb25ea7e4f22303eef11e72df9536
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4811596
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Gavin Mak 5819c303f0 Drop py2 support in recipe modules
python3 is the only supported version of python in depot_tools.

Bug: 1475402
Change-Id: I479de09a0c34b438aced35e4ced58a5972108132
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4808518
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Xinan Lin 66ab0a5131 Allow existent branch when creating branches via recipe
BUG=1433047
TEST=train

Change-Id: Iafa16840f7ead393ccd09dd483e45e9098358755
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4629867
Commit-Queue: Xinan Lin <linxinan@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Joanna Wang d04720454a Update recipes python tests.
For: http://shortn/_j5mixA1Mjr

Change-Id: I7ac4471fbb1e0629d59263266b3470e372d03a19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4368938
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Xinan Lin 66c9784478 Add cc_list to update_files method
User could attach CC addresses to the gerrit change created.

BUG=1294382
TEST=train

Change-Id: I236658d80f41b27bf007bb344934ce835cd7b5de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3440862
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Xinan Lin <linxinan@chromium.org>
3 years ago
Xinan Lin 42afe9a2d3 Ensure the new patchset exists in Gerrit before we set bot-commit+1
"Publish Change Edit" is not a synchronized API call on Gerrit.
After the call, we need to explicitly check if the new patch exists
in Gerrit. Or, we may label +1 on an old patch.

BUG=1286212
TEST=train
Recipe-Nontrivial-Roll: chrome_release
Change-Id: I1443e2b4cf702f7cb4feebb43e34923f11383f35
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3384422
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Xinan Lin <linxinan@chromium.org>
3 years ago
Michael Moss 9c28af45e6 Add ability to generically call most Gerrit APIs.
This will make it easier to call new or uncommon Gerrit APIs, without
needing to add dedicated methods for each one. This also makes it easier
to debug API calls by exposing the raw response data, which is often
processed or filtered in the existing wrapper methods.

BUG=1052179
R=linxinan@chromium.org

Change-Id: I0b594a9fdaabae4b0ebb379dc5473f4d6de67a13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3235714
Auto-Submit: Michael Moss <mmoss@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Xinan Lin <linxinan@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
4 years ago
Michael Moss b6ce244503 Add 'create tag' support to gerrit_client and gerrit recipe_module.
BUG=1052179
R=dpranke@google.com, linxinan@chromium.org

Change-Id: I6e220b70e63d990e9257d9fe4d107de7dbd2eb81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3232849
Auto-Submit: Michael Moss <mmoss@chromium.org>
Commit-Queue: Michael Moss <mmoss@chromium.org>
Reviewed-by: Xinan Lin <linxinan@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
4 years ago
Ben Pastene 281edf7577 Add a 'setlabel' command to gerrit_client.py
And add a hook for it in the gerrit recipe_module.

This will allow invocations of gerrit_client to set votes like
"code-review-1" or "commit-queue+1" on CLs. This will be used by bots
to control CLs they just created with update_files().

Bug: 1250084
Change-Id: I888458983165fed5882e5c37cba4a69dbfb9b810
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3207266
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
4 years ago
Gavin Mak 1cb508122c Add PYTHON_VERSION_COMPATIBILITY to gerrit recipe module
Bug: 1227140
Change-Id: I3cea6609eb5bb6b7f392e1078eb023ca19c6fb3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3123939
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
4 years ago
Xinan Lin f9d9909c10 Return changeinfo from update_files method
Users may need more info from a created/submitted change,
e.g. revision hash, change status(submitted or not) etc.

BUG=1236658
TEST=train
Recipe-Nontrivial-Roll: chrome_release
Change-Id: I1db57e5c6a4e58ea320526ef5f5cbb83e1b0bb60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3102579
Commit-Queue: Xinan Lin <linxinan@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Michael Moss <mmoss@chromium.org>
4 years ago
Josip Sokcevic ce332a47a9 Use main as default branch in all recipes
Recipe-Manual-Change: build
Recipe-Nontrivial-Roll: build_limited
Recipe-Nontrivial-Roll: chrome_release
Recipe-Nontrivial-Roll: chromiumos
Recipe-Nontrivial-Roll: infra
Change-Id: I89008bc07b1c3de13d9c6dd64e723fe6dc8d01d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3015262
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Anthony Polito <apolito@google.com>
4 years ago
Xinan Lin 493faf1621 Add new API to update files by gerrit module
The new API here could support users to update files to remote
repo without loading the source code to the bot.

BUG=1207955
TEST=train

Change-Id: I2970171bf5b58db0db41bab5a433fc6721b7b2aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3042407
Commit-Queue: Xinan Lin <linxinan@chromium.org>
Reviewed-by: Michael Moss <mmoss@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
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
Garrett Beaty a060611549 Provide step_test_data in gerrit.get_revision_info.
This will reduce the need to manually mock steps: calls to get revision
info will now return CLs that match the requested change and patchset
numbers. Manually mocking will only be required if specific values for
other field are desired or if the test case should not have revision
info that matches the change and patchset.

Change-Id: Ibc6ec62100616680e36d9a842449ac9c6fb2440b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2765162
Commit-Queue: Garrett Beaty <gbeaty@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Auto-Submit: Garrett Beaty <gbeaty@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
4 years ago
Josip Sokcevic 982b2a7570 Add move change to Gerrit recipes
Will be used by a LUCI cron to move Gerrit changes for repos that are in
transition state #1 and #2.

R=ehmaldonado@chromium.org

Change-Id: Id7383ef677aa1cc90102c9a2aadbcc17712e150d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2522559
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
5 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
Andrii Shyshkalov ffb5052e43 delete unused api.gerrit.get_change_destination_branch.
Use api.tryserver.gerrit_change_target_ref instead.
Depends on https://crrev.com/c/1359892

Change-Id: If8ec0bb262035239a1ef77093808196561050c9b
Reviewed-on: https://chromium-review.googlesource.com/c/1359794
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Jao-ke Chin-Lee <jchinlee@chromium.org>
6 years ago
Nodir Turakulov 9af7d107de Revert "bot_update: Specify the target branch for patch_refs."
This reverts commit 01f0c698fb.

Reason for revert: https://chromium-review.googlesource.com/c/chromium/tools/build/+/1211422

Original change's description:
> bot_update: Specify the target branch for patch_refs.
> 
> Bug: 870279
> Recipe-Manual-Change: build
> Recipe-Manual-Change: infra
> Recipe-Manual-Change: build_limited_scripts_slave
> Recipe-Manual-Change: skia
> Recipe-Manual-Change: release_scripts
> Change-Id: I58110ff8c5a6ca6906bbbf3eafa09dcbaf39f777
> Reviewed-on: https://chromium-review.googlesource.com/1174988
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

TBR=tandrii@chromium.org,ehmaldonado@chromium.org,jbudorick@chromium.org

Change-Id: Ic78a264ccf5e2ca15452659e17d41da264560eb8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 870279
Reviewed-on: https://chromium-review.googlesource.com/1211462
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
7 years ago
Edward Lemur 01f0c698fb bot_update: Specify the target branch for patch_refs.
Bug: 870279
Recipe-Manual-Change: build
Recipe-Manual-Change: infra
Recipe-Manual-Change: build_limited_scripts_slave
Recipe-Manual-Change: skia
Recipe-Manual-Change: release_scripts
Change-Id: I58110ff8c5a6ca6906bbbf3eafa09dcbaf39f777
Reviewed-on: https://chromium-review.googlesource.com/1174988
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Andrii Shyshkalov 3cb0767ac1 recipes: cache destination branch of a Gerrit change.
It doesn't change after change is created.

R=jchinlee@chromium.org

Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Change-Id: I4c4758085f6cfa7c2ef5267c6c71c9b324263f95
Reviewed-on: https://chromium-review.googlesource.com/1029227
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
7 years ago
Michael Moss 7d7c4840b7 Add some differentiating details to gerrit step names.
R=phajdan.jr@chromium.org

Recipe-Manual-Change: release_scripts
Recipe-Nontrivial-Roll: release_scripts
Change-Id: I4c3ca01bad7e5158565a8abc8d7fc5b4b77b0d4f
Reviewed-on: https://chromium-review.googlesource.com/666977
Commit-Queue: Michael Moss <mmoss@chromium.org>
Reviewed-by: Paweł Hajdan Jr. <phajdan.jr@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 49b8147be0 Add support to query a CL's branch to gerrit recipe module
Bug: 740456
Change-Id: Ic4f3c1f046cfa025d8e60172ee58e2b2e1b76ee6
Reviewed-on: https://chromium-review.googlesource.com/565560
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
8 years ago
Michael Achenbach 9cb802ca48 Improve gerrit recipe_module example
The /a suffix in the hots URL is not necessary as the gerrit_util adds it by
default to authenticate. Having it hard-coded in the example can be misleading.

Bug: 685318
Change-Id: I333cd8b2aa9020aadfd186f2e18fbff0aa917681
Reviewed-on: https://chromium-review.googlesource.com/564611
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@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
Robert Iannucci 56038f517d rename example.py -> examples/full.py for all modules
R=dnj@chromium.org, nodir@chromium.org, phajdan.jr@chromium.org

Bug:
Change-Id: I47d8f9311b6ee71583fb989888a1e4d28b5495df
Reviewed-on: https://chromium-review.googlesource.com/520731
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
8 years ago