Commit Graph

17 Commits (721a721d0875f08a4634f54923b6ea7b32514d25)

Author SHA1 Message Date
Quinten Yearsley 925cedba7b Run spellchecker on depot_tools
This was made by running `codespell` and `scspell`
and then checking the results.

Change-Id: I169fd5b40294f83015075b4a899fbca263821f25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2144602
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Auto-Submit: Quinten Yearsley <qyearsley@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur a81450253f depot_tools: Use mock from vpython (or unittest.mock) instead of third_party/mock
Change-Id: I3a188b34ae5f62649108afe08fe0e389a408c2ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1947933
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
5 years ago
Edward Lemur 2e2f58756d depot_tools: Run auth, cipd_bootstrap, git_number tests on python3.
Bug: 1009809
Change-Id: Ia02460a24f4ac048bd7f0072e70856f9ee22a997
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1925314
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur b43d98bf64 auth: Fix has_luci_context_local_auth.
Checking for LUCI_CONTEXT is not enough. To use local auth, the
stored config must be valid and have a default account id.

Bug: 1018069
Change-Id: I5bbe880cc217a06ae0e1ae8d7e00ef09502af6a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1888211
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
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
Edward Lemur acf922ce48 Reland "depot_tools: Stop using oauth2client"
This is a reland of 55e5853e5c

Original change's description:
> depot_tools: Stop using oauth2client
>
> Bug: 1001756
> Change-Id: I8a0ca2b0f44b20564a9d3192543a7a69788d8d87
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854898
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>

Bug: 1001756
Recipe-Nontrivial-Roll: chromiumos
Recipe-Nontrivial-Roll: skia
Change-Id: If2f584ce0b327324cfb67ce5f29d80986260bd61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1867109
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
5 years ago
Edward Lesmes 989bc35186 Revert "depot_tools: Stop using oauth2client"
This reverts commit 55e5853e5c.

Reason for revert:

  File "PRESUBMIT.py", line 11, in CheckChangeOnCommit
    return input_api.canned_checks.CheckChangedLUCIConfigs(input_api, output_api)
  File "/usr/local/google/home/abennetts/cr/depot_tools/presubmit_canned_checks.py", line 1421, in CheckChangedLUCIConfigs
    acc_tkn = authenticator.get_access_token()
  File "/usr/local/google/home/abennetts/cr/depot_tools/auth.py", line 414, in get_access_token
    if not self._external_token and allow_user_interaction:
AttributeError: 'Authenticator' object has no attribute '_external_token'


Original change's description:
> depot_tools: Stop using oauth2client
> 
> Bug: 1001756
> Change-Id: I8a0ca2b0f44b20564a9d3192543a7a69788d8d87
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854898
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>

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

Change-Id: I94cf38e82e53e51c66efcb99c51f0e1418e86f49
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1001756, 1015285
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1866184
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur 55e5853e5c depot_tools: Stop using oauth2client
Bug: 1001756
Change-Id: I8a0ca2b0f44b20564a9d3192543a7a69788d8d87
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854898
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
5 years ago
Raphael Kubo da Costa e9342a723b Use assertEqual() rather than assertEquals() in Python tests.
The latter form is deprecated, and can generate extraneous output when
running the tests:

    DeprecationWarning: Please use assertEqual instead.

Bug: 984182, 1007872
Change-Id: Ibac81178e719a739560bbc65e0f6b9eda40b313a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1859995
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Nodir Turakulov 5abb9b7c5d Revert "Reland "depot_tools: Add httplib2 to .vpython""
This reverts commit 88d7869db0.

Reason for revert: Broke luci-go-presubmit. luci-go development has stopped. https://ci.chromium.org/p/infra/builders/try/luci-go-try-presubmit

Original change's description:
> Reland "depot_tools: Add httplib2 to .vpython"
> 
> This is a reland of e1410883a3
> 
> Use vpython to execute git_cl.py, gerrit_util.py and presubmit_support.py on recipes.
> 
> Original change's description:
> > depot_tools: Add httplib2 to .vpython
> >
> > Check that things won't break before further changes are made.
> >
> > Bug: 1002153
> > Change-Id: I41866f26334bf9ec2732bc0f25007234a95130e4
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854749
> > Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
> > Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
> > Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
> 
> Bug: 1002153
> Recipe-Nontrivial-Roll: build
> Recipe-Nontrivial-Roll: chromiumos
> Recipe-Nontrivial-Roll: infra
> Recipe-Nontrivial-Roll: skia
> Recipe-Nontrivial-Roll: build_limited_scripts_slave
> Recipe-Nontrivial-Roll: release_scripts
> Change-Id: Id94057eae8830dec197257df3ea35c0c4ff946b7
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1856650
> Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>

TBR=tandrii@google.com,ehmaldonado@chromium.org,apolito@google.com

Change-Id: Ieecf0bf9164a14542a70ee6343763781a098a4a8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1002153
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1858280
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
5 years ago
Edward Lemur 88d7869db0 Reland "depot_tools: Add httplib2 to .vpython"
This is a reland of e1410883a3

Use vpython to execute git_cl.py, gerrit_util.py and presubmit_support.py on recipes.

Original change's description:
> depot_tools: Add httplib2 to .vpython
>
> Check that things won't break before further changes are made.
>
> Bug: 1002153
> Change-Id: I41866f26334bf9ec2732bc0f25007234a95130e4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854749
> Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
> Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
> Reviewed-by: Andrii Shyshkalov <tandrii@google.com>

Bug: 1002153
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: chromiumos
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: skia
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: release_scripts
Change-Id: Id94057eae8830dec197257df3ea35c0c4ff946b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1856650
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lesmes 12265a8f7d Revert "depot_tools: Add httplib2 to .vpython"
This reverts commit e1410883a3.

Reason for revert: 
This appears to have broken Skia's Presubmit:
https://chromium-swarm.appspot.com/task?id=47d11ff76d07a610

Original change's description:
> depot_tools: Add httplib2 to .vpython
> 
> Check that things won't break before further changes are made.
> 
> Bug: 1002153
> Change-Id: I41866f26334bf9ec2732bc0f25007234a95130e4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854749
> Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
> Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
> Reviewed-by: Andrii Shyshkalov <tandrii@google.com>

TBR=tandrii@google.com,ehmaldonado@chromium.org,apolito@google.com

Change-Id: Ie73c4172c349ea0c22cad399f4ef948b9486e028
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1002153
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1855590
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur e1410883a3 depot_tools: Add httplib2 to .vpython
Check that things won't break before further changes are made.

Bug: 1002153
Change-Id: I41866f26334bf9ec2732bc0f25007234a95130e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854749
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
5 years ago
Andrii Shyshkalov b3c4441c81 [auth] cache LUCI_CONTEXT local_auth parameters.
R=vadimsh@chromium.org

Bug: 834536
Change-Id: I84d27c2d962e94cfe7befebfb374b17949bba7e5
Reviewed-on: https://chromium-review.googlesource.com/1020296
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@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
Mun Yong Jang 1728f5f3e6 [depot_tools] Fix timestamp issues related to local auth
Bug: 509672
Change-Id: I5abb813d5f78291b4bf2d8e856c6fd71fcad5b68
Reviewed-on: https://chromium-review.googlesource.com/791472
Commit-Queue: Mun Yong Jang <myjang@google.com>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
7 years ago
Mun Yong Jang acc8e3ebaa [presubmit] Extend depot tools auth to use luci context
Bug: 509672
Change-Id: Ie3cb2fa1a2276f1fe658cdf7b9ffb657d03556e8
Reviewed-on: https://chromium-review.googlesource.com/754340
Commit-Queue: Mun Yong Jang <myjang@google.com>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
7 years ago