Commit Graph

351 Commits (chrome/3865)

Author SHA1 Message Date
Andrii Shyshkalov 71f0da3e93 git-cl: add --preserve-tryjobs option for upload command.
CQ will soon start canceling tryjobs it triggered on no-longer-latest
patchsets if these tryjobs won't be re-used. New option can be used by
developers who upload new patchsets but actually care for prior
CQ-triggered tryjobs to complete.

This footer is effectively sticky, unless someone removes it by hand later.
We need to have the footer one way or another to tell the CQ what to do
(and provide a visible audit trail).

We may revisit the stickiness later based on accumulated usage data s.t.
the following uploads remove the footer unless the flag is passed.

Bug: 909895
Test: git cl upload --preserve-tryjobs
Change-Id: Ibbc6e917504c31eab8ab85296b3ecafd3add46df
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1701506
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Edward Lemur 2c48f24c7f git-cl: Report presubmit execution time.
Bug: 970113
Change-Id: Iff31287d1ab8f683f7745fd0abc62b138ffcf219
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1642649
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Daniel Cheng cf6269b441 [git-cl] Handle non-HTTPS repositories gracefully in EnsureAuthenticated
There are some Google-internal repos that use a custom scheme. Having
any remotes pointing to these URLs breaks git cl archive.

Change-Id: Ibd686c5cd11e090f0821ff2b412540138252dfce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1614946
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Edward Lemur 75391d46d0 git-cl: Reword the message when surfacing traces to the user.
In crbug.com/955206 they pointed out that:
- It's not clear when to upload the issue
- It's not clear where to report it, or where to look for existing issues.
- It's not made clear that the traces can contain information the user might not want to share.

I've reworded the message to address those concerns

Bug: 955206
Change-Id: Ia1426007d389328eac52babeee1ec3782c2b104e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1606608
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
6 years ago
Edward Lemur 1b52d87ab5 Reland "git-cl: Keep git push traces"
This is a reland of dc8e23d356

Original change's description:
> git-cl: Keep git push traces
> 
> Keep the last N git push traces.
> Name them after the time when they were collected, and add a
> README file to each one to provide some context to developers.
> 
> Bug: 955206
> Change-Id: Ib5fcf2f78fb65f6ddd80a93619c14e1ef70c5564
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1595108
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>

Bug: 955206
Change-Id: Ie63a3ebfe3024d48ad7e0c8492a2939e635371aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1600246
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Michael Moss e7f0b4c62c Revert "git-cl: Keep git push traces"
This reverts commit dc8e23d356.

Reason for revert: Breaking chrome releases crbug.com/960638

Original change's description:
> git-cl: Keep git push traces
> 
> Keep the last N git push traces.
> Name them after the time when they were collected, and add a
> README file to each one to provide some context to developers.
> 
> Bug: 955206
> Change-Id: Ib5fcf2f78fb65f6ddd80a93619c14e1ef70c5564
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1595108
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>

TBR=dpranke@chromium.org,ehmaldonado@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 955206
Change-Id: Id56dfb1b32a54070d761ef75bc26bbb9081f86fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1600535
Reviewed-by: Michael Moss <mmoss@chromium.org>
Commit-Queue: Michael Moss <mmoss@chromium.org>
6 years ago
Edward Lemur dc8e23d356 git-cl: Keep git push traces
Keep the last N git push traces.
Name them after the time when they were collected, and add a
README file to each one to provide some context to developers.

Bug: 955206
Change-Id: Ib5fcf2f78fb65f6ddd80a93619c14e1ef70c5564
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1595108
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
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
Jonas Termansen d0f7911725 Support bug prefixes when stripping away empty bug in git-cl-upload.
For instance, if the bug-prefix is set to "b/", git cl upload will offer a
line with "Bug: b/", however it won't get stripped away if it's left blank,
unlike the default "Bug:" line. This change fixes that inconsistency by
also taking the bug-prefix into account when stripping.

Change-Id: Ib6e4d18c1ff52ec77cd1422be15b1e6920332238
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1528972
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Jonas Termansen <sortie@google.com>
6 years ago
Edward Lemur 298f2cf820 git cl: Print a clear error message when we fail to find the remote url.
Bug: 914655
Change-Id: I06a3ff39d884327fd407a5c50cc9730a375bef0b
Reviewed-on: https://chromium-review.googlesource.com/c/1382974
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Quinten Yearsley 0e617c0294 Change git cl comments to list robot comments.
In particular, only show robot comments from the latest patchset.

Bug: 924780
Change-Id: I12038ddd2d90a5cb561b248de3fd37908d5b927e
Reviewed-on: https://chromium-review.googlesource.com/c/1457282
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
6 years ago
Bryce Thomas cfc9712bc8 Fix git cl format following removal of Rietveld.
Commit a185e2e3c8 removed the Rietveld code review
implementation, albeit hasn't expunged all references to Rietveld.  This leads
to an assertion error when running |git cl format| on a non-Gerrit change.
There appears to have been a recent attempt to articulate this error better in
a185e2e3c8, albeit not fix the underlying issue.
This change addresses the immediate issue by defaulting the code review
implementation to Gerrit rather than Reitveld.

R=joenotcharles@google.com, tandrii@chromium.org

Bug: 914150
Change-Id: I64d33e5a172cc43339ec417f7f0a7820e0337772
Reviewed-on: https://chromium-review.googlesource.com/c/1372928
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Bryce Thomas <bryct@amazon.com>
6 years ago
Edward Lemur 687ca907fd git-cl: Set Code-Review label as a git push argument.
Bug: 877717
Change-Id: I6541a971068aae662b086eba84448bd0769f1a09
Reviewed-on: https://chromium-review.googlesource.com/c/1362405
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur 61ea30737c git-cl: Remove unused settings.
Bug: 770408
Change-Id: Ic5029d6b12cdb6ea30704d90229ab7e365dc7273
Reviewed-on: https://chromium-review.googlesource.com/c/1354384
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Andrii Shyshkalov a185e2e3c8 git cl: remove Rietveld implementation entirely.
R=ajp, ehmaldonado

Change-Id: I59859048d64902669479e666c6c3d37c1fb1394c
Reviewed-on: https://chromium-review.googlesource.com/c/1344642
Auto-Submit: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Andrii Shyshkalov dd5e09a1c3 git cl: get rid of Rietveld's upload.py import.
R=ajp, ehmaldonado

Change-Id: I9c9f5e0f8ef41c0f6a00faa67acf0cf516290f09
Reviewed-on: https://chromium-review.googlesource.com/c/1345272
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Edward Lemur 01f4a4ff1c git-cl: Add tests for metrics collection.
Bug: 897394
Change-Id: I07959e870fef4e6a6b8e6e7c974397d3306460c1
Reviewed-on: https://chromium-review.googlesource.com/c/1315839
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Andrii Shyshkalov e7a7fc42b6 git cl upload: set CQ and Auto Submit labels through refspec.
Except when TBR is active, because it's not clear how to
compute max score for Code-Review label before uploading a change.

Tested with this very own CL:
  To https://chromium.googlesource.com/chromium/tools/depot_tools.git
   * [new branch]        c78de165c7 ->
     refs/for/refs/heads/master%ready,notify=ALL,m=Initial_upload,r=ehmaldonado,
         cc=ajp,cc=chromium-reviews@chromium.org,cc=iannucci+depot_tools@chromium.org,
         l=Commit-Queue+1,hashtag=git-cl-upload
R=ehmaldonado

Bug: 877717
Change-Id: I464d9df2814bd830dd608bb881040e2dd3c41dbb
Reviewed-on: https://chromium-review.googlesource.com/c/1307052
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Andrii Shyshkalov 0da5e8f8a6 git cl upload: cc + reviewers in git push for chromium host.
For other hosts, behavior is not changed.

Tested on this very CL:
  To https://chromium.googlesource.com/chromium/tools/depot_tools.git
    * [new branch]        9057c2235b ->
      refs/for/refs/heads/master%ready,notify=ALL,m=Initial_upload,r=ehmaldonado,cc=chromium-reviews@chromium.org,cc=iannucci+depot_tools@chromium.org,hashtag=git-cl-upload

R=ehmaldonado

Bug: 877717
Change-Id: I951fc576105211590c6c303ce0ed2fe142628224
Reviewed-on: https://chromium-review.googlesource.com/c/1307051
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Andrii Shyshkalov c68a1753c5 git cl try-results: delete Rietveld support.
R=ehmaldonado

Bug: 770408
Change-Id: I94ff37f198937dc7d341a859a71becd91cf3a706
Reviewed-on: https://chromium-review.googlesource.com/c/1279140
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Andrii Shyshkalov dd672fb3c5 git cl description: rename gerrit test.
R=ehmaldonado

Bug: 770408
Change-Id: I211ad8e67e9486b974eed7694436afb15ecf21a2
Reviewed-on: https://chromium-review.googlesource.com/c/1279136
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Andrii Shyshkalov 642641d030 git cl comments: remove Rietveld support.
R=ehmaldonado

Bug: 770408
Change-Id: Ib3120b5fd09c35be691c025d0d69ceda60f2ec7f
Reviewed-on: https://chromium-review.googlesource.com/c/1279135
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Andrii Shyshkalov feec80e971 git cl: no longer support --rietveld flag when forcing codereview.
R=ehmaldonado

Bug: 770408
Change-Id: I980487aacd115535d0ca855cd1edfcfc18fc5cbe
Reviewed-on: https://chromium-review.googlesource.com/c/1279138
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Andrii Shyshkalov 2f727917ac git cl: add reviewers and ccs to git push command if possible.
Also fix a typo in ValidateEmail function which didn't support
email addresses with '-' in them, e.g., infra-dev@chromium.org.

R=ehmaldonado

Bug: 875089
Change-Id: I2d73c1473527c9bf62e25e9f88250196b783fcb0
Reviewed-on: https://chromium-review.googlesource.com/c/1242849
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Andrii Shyshkalov 9f274436bd git cl: partially remove Rietveld support for uploading code.
Also deletes lots of tests which provided coverage for Rietveld only,
and hence no longer useful.

R=ehmaldonado

Bug: 770408
Change-Id: I31195f7819a52d1063ed28064a74fd70fbc39357
Reviewed-on: https://chromium-review.googlesource.com/c/1279133
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Andrii Shyshkalov 03da150665 git cl: delete Rietveld support for tryjobs.
R=ehmaldonado

Bug: 770408
Change-Id: Id070e6084b6beba7309bdc35f0f750decd77e0c9
Reviewed-on: https://chromium-review.googlesource.com/c/1279132
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Andrii Shyshkalov f5569d2608 git cl: start deleting Rietveld support.
R=ehmaldonado

Bug: 770408
Change-Id: I5020596ada0c6fef2797fed6b78e7256a35ffc40
Reviewed-on: https://chromium-review.googlesource.com/c/1279131
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Andrii Shyshkalov ba7b0a466d git cl: find which reviewers and ccs are OK for Gerrit before upload.
This adds O(reviewers+cc) RPC to Gerrit before upload,
though done concurrently in up to 10 threads. This information isn't
used yet, but will be in follow up CLs.

R=ehmaldonado

Bug: 877717
Change-Id: I2374f249ee874a71089244309e50e8e88a3dee7d
Reviewed-on: https://chromium-review.googlesource.com/c/1242847
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Andrii Shyshkalov 76988a8c52 git cl: compute reviewers and ccs before pushing change to Gerrit.
R=ehmaldonado

Bug: 877717
Change-Id: Iccfba594369d8c726fd9b077d3ac18046757e4a2
Reviewed-on: https://chromium-review.googlesource.com/c/1242845
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Eric Boren 2fb6310237 Reland gerrit_util: Support OAuth2 bearer tokens in CookieAuthenticator
Bug: skia:8394
Change-Id: I928eaec8459a5905360ce760c6361e4554852b44
Reviewed-on: https://chromium-review.googlesource.com/c/1261796
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Eric Boren <borenet@chromium.org>
6 years ago
Andrii Shyshkalov d9fdc1f5b5 git cl: save description before doing any RPCs during upload.
R=smut@google.com

Bug: 881860
Change-Id: I59c337384891f02dbd2cc776318803ac556843ca
Reviewed-on: https://chromium-review.googlesource.com/1247584
Reviewed-by: smut <smut@google.com>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Andrii Shyshkalov c4a7356a46 git cl: cache also LABELS data on a change.
This removes 1 RPC when tbr-ing second or later patchset.

Since tests cover TBR only in first upload, there are
no test changes. Since adding test is real PITA here,
keep them as is.

R=ehmaldonado

Change-Id: I90801b06727ce2131a703d6cd6c24ffad798bc8a
Reviewed-on: https://chromium-review.googlesource.com/1242212
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Andrii Shyshkalov 8e64369342 git cl: delete old support code for Git Numberer with Rietveld.
R=ehmaldonado

Change-Id: Ie5522283e84bdec9d98e236577eaad568816519b
Reviewed-on: https://chromium-review.googlesource.com/1242211
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Andrii Shyshkalov d4c867355a git cl: use explicit Gerrit mirrors on 404s during upload.
This will cycle through known gerrit mirrors for chromium-review host
if Gerrit HTTP RPC results in 404 after successful initial
git push refs/for/refs/...

Tested locally by intentionally using wrong change number (2000000):

    $ PATH=`pwd`:$PATH git cl upload --bypass-hooks
        ...
        remote: Processing changes: refs: 1, new: 1, done
        remote: SUCCESS
        remote: New Changes:
        remote:   https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1227440

                * [new branch]        ea9aea5faa -> refs/for/refs/heads/master%wip,m=Initial_upload,hashtag=git-cl

        WARNING:root:404 NotFound error occurred while querying POST https://chromium-review.googlesource.com/a/changes/chromium%2Ftools%2Fdepot_tools~2000000/revisions/current/review: Not Found
        WARNING:root:404 NotFound error occurred while querying POST https://ap1-mirror-chromium-review.googlesource.com/a/changes/chromium%2Ftools%2Fdepot_tools~2000000/revisions/current/review: Not Found
        WARNING:root:404 NotFound error occurred while querying POST https://us1-mirror-chromium-review.googlesource.com/a/changes/chromium%2Ftools%2Fdepot_tools~2000000/revisions/current/review: Not Found

        ^C

Bug: 881860
Change-Id: Iac7dbe4e35052007650a7a2646a394caed6bd400
Reviewed-on: https://chromium-review.googlesource.com/1227441
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Sergiy Byelozyorov 1aa405fd85 Add an option to disable adding CC emails automatically
R=ehmaldonado@chromium.org, machenbach@chromium.org

Bug: 878303
Change-Id: Ia90001025babe692e481eb74fdbb4a66ce9a22f8
Reviewed-on: https://chromium-review.googlesource.com/1230074
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Eric Boren 0526335226 Revert "gerrit_util: Support OAuth2 bearer tokens in CookieAuthenticator"
This reverts commit 18b4479cee.

Reason for revert: Breaking WebRTC roller: https://luci-milo.appspot.com/buildbot/client.webrtc.fyi/Auto-roll%20-%20WebRTC%20DEPS/12788

Original change's description:
> gerrit_util: Support OAuth2 bearer tokens in CookieAuthenticator
> 
> Change-Id: I9fd3e2fa9ea16d7f057290e77a81f7009c7c9d91
> Reviewed-on: https://chromium-review.googlesource.com/1221826
> Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
> Commit-Queue: Eric Boren <borenet@chromium.org>

TBR=vadimsh@chromium.org,dnj@chromium.org,borenet@chromium.org,tandrii@chromium.org

Change-Id: I93bbd2d09cd2b27d9a7aa98fc15d60c5033a38cd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/1231433
Reviewed-by: Eric Boren <borenet@chromium.org>
Commit-Queue: Eric Boren <borenet@chromium.org>
7 years ago
Eric Boren 18b4479cee gerrit_util: Support OAuth2 bearer tokens in CookieAuthenticator
Change-Id: I9fd3e2fa9ea16d7f057290e77a81f7009c7c9d91
Reviewed-on: https://chromium-review.googlesource.com/1221826
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Eric Boren <borenet@chromium.org>
7 years ago
Leszek Swirski 45b20c4140 [git_cl] Fix git cl comments json stdout printing
Print "git cl comments" json to stdout when the output file is "-"

Change-Id: I91021317e52019a0d499cccc4f40f062127b300e
Reviewed-on: https://chromium-review.googlesource.com/1228094
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Andrii Shyshkalov 889677c044 git cl: now fully use project~changenum when querying Gerrit.
R=ehmaldonado

Bug: 876910
Change-Id: Ibc631bf049440d158de757da0a225ed28f892891
Reviewed-on: https://chromium-review.googlesource.com/1194314
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Andrii Shyshkalov 03e0ed26ea git cl: use project~change_number when querying Gerrit for change Info.
R=ehmaldonado

Bug: 876910
Change-Id: I218a8198d06e51ac2eb57636bbccca9aadc7d81a
Reviewed-on: https://chromium-review.googlesource.com/1194312
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Andrii Shyshkalov f57841b78b git cl patch: cleanup tests.
* remove tests which weren't actually testing any new code path.
* remove Rietveld tests, except 1.
* change default to Gerrit.

R=ehmaldonado

Bug: 719954
Change-Id: I27e59036bbafb870cadc4d6208d21ba17c48c8c0
Reviewed-on: https://chromium-review.googlesource.com/1188992
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Andrii Shyshkalov 2d0e03cb5d git cl: safe fallback for Gerrit RPCs even if gerrit project is unknown.
R=ehmaldonado

Bug: 876910
Change-Id: I258efa0a95f20b80819bc89cccfb5e0a29e09d5c
Reviewed-on: https://chromium-review.googlesource.com/1188989
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Andrii Shyshkalov 1e82867e3d git cl: restart using project~number on Gerrit.
This fixes Gerrit project detection based on remote URL,
accounting for potential 'a/' prefix in the URL path component,
which isn't part of the Gerrit project name.

R=ehmaldonado, mmoss

Bug: 876964, 876910
Change-Id: I473ae8c6c9e0f2034b350901abd67db151e0a3d3
Reviewed-on: https://chromium-review.googlesource.com/1187573
Reviewed-by: Michael Moss <mmoss@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Andrii Shyshkalov 6365bc4446 git cl: temporary stop using project~number on Gerrit.
Broke release process.

R=ehmaldonado, mmoss

Bug: 876964, 876910
Change-Id: I02ea424632f5c5522af0010adce1c993e2610b48
Reviewed-on: https://chromium-review.googlesource.com/1187548
Reviewed-by: Michael Moss <mmoss@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Andrii Shyshkalov 81db1d5032 git cl: cache GetRemoteUrl result.
Sadly, this makes maintaining one test handling covering
exceptional circumstance very complex, so it was removed.

I've decoupled test that ensures that GetRemoteUrl works from
upload codepath.

R=ehmaldonado@chromium.org

Bug: 876910
Change-Id: I39de410c72d893e73492d5c3fc8f60a6ebc4f11f
Reviewed-on: https://chromium-review.googlesource.com/1186142
Reviewed-by: Ryan Tseng <hinoka@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Andrii Shyshkalov 0ec9d15571 git cl: use project~number on Gerrit for better routing when setting reviewers
R=ehmaldonado@chromium.org

Testing
  patched my own depot_tools in $PATH and uploaded
  https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1186072
  which set reviewers and ccs as expected.

Bug: 876910
Change-Id: I43c0f2284941cf703133bb51132226d4a0472d8e
Reviewed-on: https://chromium-review.googlesource.com/1186068
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Andrii Shyshkalov b7214602e3 git cl: remove unused issue kwarg.
R=ehmaldonado

Change-Id: I5be27cb025f8237cef0186c90eb7b99d000076d9
Reviewed-on: https://chromium-review.googlesource.com/1185986
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Edward Lemur 5ba1e9caee git cl: Start reporting metrics.
Bug: 832386
Change-Id: Iccb71c020aea31db33fc16050cb1100ccf5a7fbb
Reviewed-on: https://chromium-review.googlesource.com/1145902
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Jamie Madill 276da0b4d9 git cl: Do not set WIP when using no_squash.
When using non-squashed uploads, there usually isn't an associated
issue with a branch. Thus setting WIP when the issue tag wasn't
present would continually set WIP even on trivial rebases. Not
adding the WIP tag when uploading allows the user to set WIP manually,
while not forcing the WIP flag after every new upload.

Also updates the unit tests that use no-squash.

Bug: 767439
Change-Id: I990a82139fefe1a0c5c7b149d39045cf985539b7
Reviewed-on: https://chromium-review.googlesource.com/1033187
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
7 years ago
Andrii Shyshkalov 733d4ec8e3 [gerrit_util] learn about and use LUCI_CONTEXT when available.
Unfortunately, w/o rewrite of gerrit_util, one can't take advantage
of existing auth.Authenticator (which also doesn't know about ~/.netrc
or .gitcookies, but that's fixable). This rewrite, however, will likely
cause issues for nasty scripts outside of depot_tools which use
gerrit_util as a Python library. So, I followed outdated way of
gerrit_util :(

Also contains refactoring of auth library, which was kept backwards
compatible for the same reasons as above.

R=vadimsh@chromium.org

Test-with: led tool
Test-artifact: https://ci.chromium.org/swarming/task/3cf4687dfd26ca10?server=chromium-swarm.appspot.com
Bug: 834536
Change-Id: I6b84b8b5732aee5d345e2b2ba44f47aaecc0f6c5
Reviewed-on: https://chromium-review.googlesource.com/1018488
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago