Commit Graph

534 Commits (e95696ff530d1ef5cc103a4c6f148f983f6a998d)

Author SHA1 Message Date
Struan Shrimpton 8b2072b3bd Remove Quick Run options
Quick Run and RTS are being removed from the CQ. This should remove
the -q flag from git cl
Here is the related announcement:
http://g/chromium-dev-internal/aMVTs_LCkYI
and retrospective: https://docs.google.com/document/d/1Jf9S2L_XN3wwCDRe7yYnPd9SH4vrPbKF3Xq8clLdL5Y/edit#heading=h.17wg41voij6q

Bug: 1469110
Change-Id: I57d90165a04c1bd9d2c06d0ba393097822b67e32
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4731557
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Struan Shrimpton <sshrimp@google.com>
2 years ago
Robert Iannucci 3d6d2d2500 [git-cl][presubmit] Remove references to LUCI_OMIT_PYTHON2.
This changes all references to the LUCI_OMIT_PYTHON2 environment
variable to instead assume that it is `'true'`.

R=sokcevic, tikuta

Bug: 1441784
Recipe-Nontrivial-Roll: build
Change-Id: Iea161a372adb68cdcb330d131df2c19ca2fe7b37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4522480
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Robert Iannucci 716022354a Stop running presubmit unittests with python2.
R=ajp@google.com, aravindvasudev@google.com, bryner

Bug: 1441784, 1359438
Change-Id: I8ea7b1aee2df016d15d9bf9d630728b76d1e77cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4521757
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
2 years ago
Josip Sokcevic 967cf672eb Revert "Reland "Remove Python 2 support for PRESUBMIT.py""
This reverts commit 119cff3d2f.

Reason for revert: some builders still call py2 presubmit
http://go/bbid/8781466817788761185

We need to clean up recipe first before relanding this

Original change's description:
> Reland "Remove Python 2 support for PRESUBMIT.py"
>
> This reverts commit d4c6cbeb61.
>
> Reason for revert: Python 2 invocations of the presubmit system
> should be gone now.
>
> Original change's description:
> > Revert "Remove Python 2 support for PRESUBMIT.py"
> >
> > This reverts commit 8454fc2458.
> >
> > Reason for revert: post submit hooks failing
> > https://crbug.com/1422416
> >
> > Original change's description:
> > > Remove Python 2 support for PRESUBMIT.py
> > >
> > > The presubmit system still supports invoking PRESUBMIT.py files using
> > > Python 2. This has recently been turned off on the bots so this change
> > > removes support more completely.
> > >
> > > There are still some python3 parameters being passed around - it seemed
> > > better to do the simplest possible removal now, with a follow-up change
> > > to remove more support code after this has sat for a while.
> > >
> > > Tests run from PRESUBMIT.py files could still be run using Python 2, but
> > > those should also have been addressed already. Removing support for that
> > > will be done in a subsequent change.
> > >
> > > Bug: 1207012
> > > Change-Id: Id244d547a04438f83734dba269c3cc180c148b37
> > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4315183
> > > Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> > > Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
> >
> > Bug: 1207012
> > Bug: 1422416
> > Change-Id: Iaf3102e63ec3c698d0258fac5746dbd92c30edbb
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4317176
> > Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
>
> Bug: 1207012
> Bug: 1422416
> Change-Id: I9521095989c708188fca0251fa13881e086b1395
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4516015
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>

Bug: 1207012
Bug: 1422416
Change-Id: Ifa775ca19f8c7b3c166eb89a255c25c20aaf4a98
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4521578
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2 years ago
Bruce Dawson 119cff3d2f Reland "Remove Python 2 support for PRESUBMIT.py"
This reverts commit d4c6cbeb61.

Reason for revert: Python 2 invocations of the presubmit system
should be gone now.

Original change's description:
> Revert "Remove Python 2 support for PRESUBMIT.py"
>
> This reverts commit 8454fc2458.
>
> Reason for revert: post submit hooks failing
> https://crbug.com/1422416
>
> Original change's description:
> > Remove Python 2 support for PRESUBMIT.py
> >
> > The presubmit system still supports invoking PRESUBMIT.py files using
> > Python 2. This has recently been turned off on the bots so this change
> > removes support more completely.
> >
> > There are still some python3 parameters being passed around - it seemed
> > better to do the simplest possible removal now, with a follow-up change
> > to remove more support code after this has sat for a while.
> >
> > Tests run from PRESUBMIT.py files could still be run using Python 2, but
> > those should also have been addressed already. Removing support for that
> > will be done in a subsequent change.
> >
> > Bug: 1207012
> > Change-Id: Id244d547a04438f83734dba269c3cc180c148b37
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4315183
> > Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> > Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
>
> Bug: 1207012
> Bug: 1422416
> Change-Id: Iaf3102e63ec3c698d0258fac5746dbd92c30edbb
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4317176
> Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>

Bug: 1207012
Bug: 1422416
Change-Id: I9521095989c708188fca0251fa13881e086b1395
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4516015
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang 05b60349bd Add orig_parent to create change descriptions.
Bug: 1426333
Change-Id: I9a199d98aad7ca5133dfa85dd632ffc22f89e421
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4370432
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang 3408652be0 Add push_options to dogfood stacked changes.
Bug: 1423539
Change-Id: If17ce0738878b67d6a267f3082e58ddcef788a4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4337901
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang 892f2ceea5 Fix git_cl tests for DOGFOOD_STACKED_CHANGES=1
Bug: 1422684
Change-Id: I0c772951cdce8bbe0b03b0008d26e80adea593d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4337899
Commit-Queue: Gavin Mak <gavinmak@google.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Josip Sokcevic 48d8e90bd4 Revert "Reland "Remove Python 2 support for PRESUBMIT.py""
This reverts commit e9ece0f581.

Reason for revert: broke infra presubmits:
https://ci.chromium.org/p/infra/builders/try/infra-try-presubmit

Original change's description:
> Reland "Remove Python 2 support for PRESUBMIT.py"
>
> This is a reland of commit 8454fc2458
>
> Original change's description:
> > Remove Python 2 support for PRESUBMIT.py
> >
> > The presubmit system still supports invoking PRESUBMIT.py files using
> > Python 2. This has recently been turned off on the bots so this change
> > removes support more completely.
> >
> > There are still some python3 parameters being passed around - it seemed
> > better to do the simplest possible removal now, with a follow-up change
> > to remove more support code after this has sat for a while.
> >
> > Tests run from PRESUBMIT.py files could still be run using Python 2, but
> > those should also have been addressed already. Removing support for that
> > will be done in a subsequent change.
> >
> > Bug: 1207012
> > Change-Id: Id244d547a04438f83734dba269c3cc180c148b37
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4315183
> > Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> > Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
>
> Bug: 1207012
> Change-Id: If542cac21d8ec8704b28d03fd8407c5c2899ca2c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4317177
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
> Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>

Bug: 1207012
Change-Id: Iebf76d9e2580761fc773791bac07439160503c98
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4323198
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2 years ago
Josip Sokcevic e9ece0f581 Reland "Remove Python 2 support for PRESUBMIT.py"
This is a reland of commit 8454fc2458

Original change's description:
> Remove Python 2 support for PRESUBMIT.py
>
> The presubmit system still supports invoking PRESUBMIT.py files using
> Python 2. This has recently been turned off on the bots so this change
> removes support more completely.
>
> There are still some python3 parameters being passed around - it seemed
> better to do the simplest possible removal now, with a follow-up change
> to remove more support code after this has sat for a while.
>
> Tests run from PRESUBMIT.py files could still be run using Python 2, but
> those should also have been addressed already. Removing support for that
> will be done in a subsequent change.
>
> Bug: 1207012
> Change-Id: Id244d547a04438f83734dba269c3cc180c148b37
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4315183
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Commit-Queue: Bruce Dawson <brucedawson@chromium.org>

Bug: 1207012
Change-Id: If542cac21d8ec8704b28d03fd8407c5c2899ca2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4317177
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Josip Sokcevic d4c6cbeb61 Revert "Remove Python 2 support for PRESUBMIT.py"
This reverts commit 8454fc2458.

Reason for revert: post submit hooks failing
https://crbug.com/1422416

Original change's description:
> Remove Python 2 support for PRESUBMIT.py
>
> The presubmit system still supports invoking PRESUBMIT.py files using
> Python 2. This has recently been turned off on the bots so this change
> removes support more completely.
>
> There are still some python3 parameters being passed around - it seemed
> better to do the simplest possible removal now, with a follow-up change
> to remove more support code after this has sat for a while.
>
> Tests run from PRESUBMIT.py files could still be run using Python 2, but
> those should also have been addressed already. Removing support for that
> will be done in a subsequent change.
>
> Bug: 1207012
> Change-Id: Id244d547a04438f83734dba269c3cc180c148b37
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4315183
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Commit-Queue: Bruce Dawson <brucedawson@chromium.org>

Bug: 1207012
Bug: 1422416
Change-Id: Iaf3102e63ec3c698d0258fac5746dbd92c30edbb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4317176
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2 years ago
Bruce Dawson 8454fc2458 Remove Python 2 support for PRESUBMIT.py
The presubmit system still supports invoking PRESUBMIT.py files using
Python 2. This has recently been turned off on the bots so this change
removes support more completely.

There are still some python3 parameters being passed around - it seemed
better to do the simplest possible removal now, with a follow-up change
to remove more support code after this has sat for a while.

Tests run from PRESUBMIT.py files could still be run using Python 2, but
those should also have been addressed already. Removing support for that
will be done in a subsequent change.

Bug: 1207012
Change-Id: Id244d547a04438f83734dba269c3cc180c148b37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4315183
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
2 years ago
Josip Sokcevic 7958e30579 Revert "Move scm.py to lib/"
This reverts commit 688adfe276.

Reason for revert: breaks try jobs

Original change's description:
> Move scm.py to lib/
>
> It belongs there.
>
> Change-Id: I286b50c43c587c39557fc508175efbd4b0f51d51
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4289680
> Reviewed-by: Joanna Wang <jojwang@chromium.org>
> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>

Change-Id: I662907b8bb4b2e7db82409bd34c3905db7961a12
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4300261
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2 years ago
Josip Sokcevic 688adfe276 Move scm.py to lib/
It belongs there.

Change-Id: I286b50c43c587c39557fc508175efbd4b0f51d51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4289680
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang 7603f04d42 Add external changes for stacked-changes dogfood.
Bug: b/265929888

Change-Id: Idc280549c7e41d6665173ef566637b48c2980e09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4300530
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang d75fc885fd [stacked-changes] Enforce -f and add --cherry-pick-stacked to skip interaction.
Bug: 1420363
Change-Id: I9b58f0126e05a558b42721222014392e9b527a25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4298829
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Victor Hugo Vianna Silva dd03016926 Don't prompt for confirmation in `git cl upload --dependencies`
This is a pretty intentional command, I don't see why the confirmation
would be required.

Bug: None
Change-Id: I111bb39e3b5f467901be5c986847ace3c6efa7ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4261467
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Victor Vianna <victorvianna@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang 6b98cdcbc1 Check for detached HEAD state.
Bug: 1416683
Change-Id: I538715d05170662001ac7193a86dbd2e7f50e3f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4258505
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang 6215dd0365 stacked-changes: Skip empty branches.
Changes:
- _UploadAllPrecheck() returns a list of cls to upload that skips any empty commits in the stack.
- If the current branch is empty, we throw an error.
- UploadAllSquashed() now computes the parent to use for the squashed and cherry-pick flow.
  - for cherry-pick it uses the gerrit_squash_hash of the next cl in `cls`. This means it could be the gerrit_squash_hash of the direct ancestor OR the closest non-empty ancestor branch.
  - for multiple squashed commits, the first parent passed in is either:
     - the closest ancestor with a gerrit_squash_hash OR the common ancestor shared with the root of the tree.
- PrepareSquashedCommit() and PrepareCherryPick() now both require a parent passed in.

Bug:1411878, b/265929888
Change-Id: I7dba289defb40ed0464eabdb7e90810353ef155f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4220412
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Aravind Vasudevan a02b4bf030 Fix gerrit new-password URL
This change fixes gerrit new-password URL from <host>-review.googlesource.com/new-password to <host>.googlesource.com/new-password.

Fixed: 1412557
Change-Id: I0c73e890fa9db5e2172d9a88cbc50703675e9f50
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4219808
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
2 years ago
Joanna Wang c4ac30261d Revert auto-cc behavior back to original and fix comments.
Bug: 1411521, b/265929888
Change-Id: I2d5908f4fb54ad11914d061539c4677e8320c163
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4205471
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang c710e2d56a Connect new stacked changes implementation.
Bug: b/265929888
Change-Id: I89f669d9d0a11f09a89c378222e6780ac9fcec34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4189199
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang 4049791e10 Create PostUploadUpdates func.
Bug: b/265929888
Change-Id: If74949bfb6aafefc789d4e5e025ec15e81197380
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4189838
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Joanna Wang a1abbeda6b [stacked-changes] Add refspec func.
Bug: b/265929888
Change-Id: Ie8bd21b4f1b43a40f303dc1c93fc58becc76f9e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4182845
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang b88a4343de [stacked-changes] Prepare squashed commit
Bug: b/265929888
Change-Id: Ia492666a5707996d94a4b6f7668ceaeb0eda8c39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4182841
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Joanna Wang e852391441 [stacked_changes] Create cherry-picked commit.
Bug:b/265929888
Change-Id: I4277474c1f09e4ac6ea6ebb5d9d340f22365f542
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4178924
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang b46232e729 [stacked_changes] Add Changelist._PrepareChange() common func called before creating commits.
Bug: b/265929888
Change-Id: I18a0c5ba6757aef91e750b9703079c96b090dc1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4178920
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang 18de1f68e6 [git cl]Add precheck function for stacked changes upload.
High-level rough draft: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4166282

Bug: b/265929888

Change-Id: I7881ade0ea97d7537e1dd40ab484ee5ef828aa34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4175861
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang 39811b1915 Remove TBR from git cl
Bug: b/266235601
Change-Id: I8122cf38d5a2c6879c32eafc6abd8fa306095125
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4185277
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang c8f23e26be Revert "Remove rietveld.cc to test removing all reitveld config sttuff."
This reverts commit 8c5174b527.

Reason for revert: Need to replace this before removing.

Original change's description:
> Remove rietveld.cc to test removing all reitveld config sttuff.
>
> Bug:b/266001713
> Change-Id: Ib5342e7519d7f7eaccf0a0a6f4a39c13677406bb
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4178919
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Commit-Queue: Joanna Wang <jojwang@chromium.org>

Bug: b/266001713
Change-Id: Ief110063e7146f045df669ec138c4f01eccc44d0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4182421
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang 8c5174b527 Remove rietveld.cc to test removing all reitveld config sttuff.
Bug:b/266001713
Change-Id: Ib5342e7519d7f7eaccf0a0a6f4a39c13677406bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4178919
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Gavin Mak 4e5e39951e Handle external changes on `git cl upload`
upload currently overwrites any external changes, e.g. edits/rebases
in Gerrit. Check for these on upload and provide the ability to
incorporate those into the CL.

Bug: 1382528
Change-Id: Id32bf8804c4cdeb12b6a5a7cf206e033bbccd453
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3975855
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Brian Sheedy 7326ca218b Add post upload Python 3 option
Adds --no-python2-post-upload-hooks to git_cl.py. This causes any
post upload hooks to only run under Python 3. Without this, uploading
CLs from builders that omit Python 2 causes the CL the step to fail
after the CL is uploaded.

Bug: 1340617
Change-Id: I5fb45922fb05b28ad570091f9e285dd533d92336
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3996467
Auto-Submit: Brian Sheedy <bsheedy@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
2 years ago
Garrett Beaty 08bb5c487f Use the gerrit host when setting gitiles commit.
Currently, the --revision flag to git cl try will cause a gitiles commit
to be set that uses the provided revision, the gerrit host and project
of the CL to test and the target ref of the CL to test. Since the flag
is intended to control the version of source to check out and have the
patch applied to, using the gerrit host instead of the gitiles host will
result in gitiles commits that won't match the repo_path_map in gclient
configs.

Change-Id: Ie391cc9c636f3a9c87116dbb781267031569e67b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3907186
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Garrett Beaty <gbeaty@google.com>
2 years ago
Joanna Wang 46ffd1bca1 Allow sso remotes for `git cl status`.
Bug:1364237
Change-Id: Iff3419097f86db125990001fe316c9c52974e3b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3899165
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
3 years ago
Thiago Perrotta b0fb8d570d Introduce --send-email flag as an alias to --send-mail for `git cl upload`
Vanilla git has a git-send-email(1) subcommand. `git cl upload` should
follow suit by using the same flag name to be consistent and avoid
confusion.

[1]: https://git-scm.com/docs/git-send-email

Bug: none
Change-Id: I47ff8e03bd11915e99804fe1695046d874efc4e0
Tested: `git cl upload --send-email` to upload this very own CL
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3854330
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Auto-Submit: Thiago Perrotta <tperrotta@chromium.org>
3 years ago
manukh 566e9d0177 [git-cl] If set, use `options.title` for initial uploads.
Change-Id: Ia57b7a7b769d352e05820af0e40a52fcab471ddb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3736424
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: manuk hovanesian <manukh@chromium.org>
3 years ago
Aleksey Khoroshilov 35ef5ada1d Run presubmit checks without GerritAccessor if GERRIT_HOST is not set.
When a repository doesn't work with Gerrit, it doesn't make sense to
create GerritAccessor and pass it to presubmit checks.
gerrit.host is stored into git config when codereview.settings file contains GERRIT_HOST item.

Change-Id: I9740950caf85a1da9a6e4ae12e3612625cf0cec5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3687235
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Auto-Submit: Aleksey Khoroshilov <akhoroshilov@brave.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
3 years ago
Bruce Dawson 09c0c073ea Optimize presubmit --all with --no_diffs option
Some of the expensive checks when running presubmit --all, such as
CheckStableMojomChanges (~300 s) and CheckAddedDepsHaveTargetApprovals
(~200 s) only look at diffs and are therefore guaranteed to be NOPs when
running presubmit --all or --files=. Passing along the no_diffs state
lets these expensive checks be skipped, thus allowing for faster
iteration times.

Initial testing suggests that (with some supporting changes in the
Chromium repo) this reduces "presubmit --all" times by about ten
minutes, or a bit more than 10%, and additional improvements may be
possible.

Special handling for the no-diffs case also offers a simple way to avoid
presubmit failures that happen whenever all files are flagged as being
changed.

Finally, and perhaps most importantly for having a presubmit --all bot,
when --no_diffs is passed we can treat errors like "Issue wasn't
uploaded" and "Add a description to the CL" as messages, thus making it
possible to have zero presubmit errors when run on origin/main.

Bug: 1320937, 1322936
Change-Id: I0d09dd4aae8fdaa48c8b2f89337441cf96dcff72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3628368
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
3 years ago
Josip Sokcevic 632bbc0cb1 Skip Python 2 presubmit step when unneeded
All of the PRESUBMIT.py files in the Chromium repo are running under
Python 3. However "git cl presubmit" also works with other repos where
some PRESUBMIT.py scripts still run under Python 2. This means that
the Python 2 presubmit commit checks step cannot simply be disabled.
That meant that Chromium was paying up to a one-minute cost just to
setup for and look for Python 2 scripts that it doesn't run.

This change runs the Python 3 PRESUBMIT.py scripts first, and keeps
track of whether any were skipped. If none were skipped then the
Python 2 PRESUBMIT.py stage can be skipped.

Note that the child scripts of PRESUBMIT.py scripts may still be run
under Python 2, but that is orthogonal to this change.

Bug: 1313804
Change-Id: Ib65838223f232f1e78058d6a08ea15a89f442310
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3614453
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
3 years ago
Joanna Wang 583ca66091 [depot_tools] Give user option to clear cl issue for merged changes.
Test:
Merged: https://chromium-review.googlesource.com/c/infra/gerrit-plugins/buildbucket/+/3600858

Created new CL in same branch:
https://chromium-review.googlesource.com/c/infra/gerrit-plugins/buildbucket/+/3609588

Bug: 1312511

Change-Id: I20ccfc978fd84c4c68f71007cf636fc1ee8e3d4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3609115
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
3 years ago
Josip Sokcevic 017544dc14 Add git cl presubmit --files
Chromium's presubmits contain a lot of latent errors - presubmit errors
that will trigger the next time a file is modified, but have been
waiting for years. Flushing those out with "git cl presubmit --all"
works poorly because it exercises all presubmits simultaneously, which
is too slow and triggers too many failures. Adding a --files option lets
small areas of the tree or specific file types to be exercised in a
controlled manner.

Bug: 1311697
Change-Id: I36ec6a759a80000d6ed4a8cc218ece327d45f8d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3559174
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
3 years ago
Josip Sokcevic e293d3dce9 Support py3 in post upload presubmit hooks
Currently, post upload presubmit hooks are exlusively executed with py2,
regardless of USE_PYTHON3 magic variable. This change adds py3 support
in the same fasion as regular presubmit hooks.

R=aravindvasudev@google.com

Fixed: 1297712
Change-Id: Ib464f8563e4135a63fc48692d27c8692fe1f630b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3469285
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
3 years ago
Alex Turner 30ae637731 Accept URLs missing schemes in git cl patch
Currently, calling a command like "git cl patch crrev.com/c/1234567"
will fail with "git cl: error: Invalid issue ID or URL." as no scheme is
supplied (i.e. "git cl patch https://crrev.com/c/1234567" is considered
valid).

This cl removes the requirement for supplying a scheme. Instead, the
script attempts to add "https://" where it would've thrown an error
previously. If the resulting string is valid, it is used. Otherwise, an
error will still be thrown.

Bug: 1223200
Change-Id: I24ee4df48b5f5d434f3abe270f5c3e793c347cc8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2983443
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Alex Turner <alexmt@chromium.org>
3 years ago
Josip Sokcevic 266129cba3 Ignore comments from accounts with no email
Those comments are from bots and not useful when running git cl
comments.

R=ajp@google.com

Fixed: 1266986
Change-Id: I6a8f8f81e02e4b4624027c4c95546bf5e3e7244b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3268350
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Andy Perelson <ajp@chromium.org>
Reviewed-by: Andy Perelson <ajp@chromium.org>
3 years ago
Xinan Lin 1bd4ffa295 Remove wait-for-merge from gerrit client tool
Following comment in crrev.com/c/3039331, submit call
is fully synchronous.

BUG=1207955
TEST=e2e

Change-Id: I9146d43b4d4530ad5064709e418d34e3229e19ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3049672
Commit-Queue: Xinan Lin <linxinan@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
4 years ago
Josip Sokcevic 7e133ff177 Use main branch as the default branch
R=apolito@google.com

Change-Id: I6a2ed557b9e8d45194b2fe4ea5327ce62020733c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3000134
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
4 years ago
Andrii Shyshkalov 899785a9c6 [cv][git-cl] treat autogenerated CV comments just like CQ.
R=ehmaldonado

Change-Id: If06db13e41a07786aa5a244e95aa3911d9367d6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3010275
Auto-Submit: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
4 years ago
Josip Sokcevic 340edc365b Extract bug/fix from branch only on create
depot_tools supports extracting information from branch name. E.g. if
branch contains fix-\d or bug-\d, commit description will contains
appropriate git footers.

However, such behavior should happen only on initial CL upload. Should
user decide to delete such footer, we shouldn't set bug / fix on any
following PS.

R=ehmaldonado@chromium.org

Bug: 1225663
Change-Id: I66adfdca070083ab66727d132919d47feb7ddd43
Fixed: 1225663
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3010709
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Andy Perelson <ajp@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
4 years ago
Sigurd Schneider 1bfda8eee9 Respect git config cl.date-order in `git cl st`
In the previous commit https://crrev.com/c/2532835 the option
to order branches by date was added. This CL adds a git config
variable cl.date-order than can be set to achive the same effect.

Change-Id: Iaf24c46c5f7b63b1e518c18aedc455808a2dc752
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2992887
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
4 years ago