scm.GIT functions are tested, and using them makes it easier to mock
git calls on git-cl tests.
Bug: 1051631
Change-Id: If067aa3f71b7478cafd7985d3020dacc0c6a41c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2055464
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This reverts commit 9ee86e5a46.
Reason for revert: Typo.
Original change's description:
> gerrit-util: Fix GCE check from behind proxy.
>
> Setting HTTP_PROXY or HTTPS_PROXY environment variables will cause git cl
> to fail.
>
> The behavior of an unreachable server behind proxy is different from a direct
> connection, it won't throw a httplib2.ServerNotFoundError error,
> so catch httplib2.Httplib2Error instead.
>
> Bug: 1050380
> Change-Id: I32e2220483de1fd6222c7fd6063039fb86277ef0
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2050947
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
TBR=ehmaldonado@chromium.org,apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: Idb17520e71fc1d892694e0d4d1cf1630a42bb482
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1050380
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2055390
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Setting HTTP_PROXY or HTTPS_PROXY environment variables will cause git cl
to fail.
The behavior of an unreachable server behind proxy is different from a direct
connection, it won't throw a httplib2.ServerNotFoundError error,
so catch httplib2.Httplib2Error instead.
Bug: 1050380
Change-Id: I32e2220483de1fd6222c7fd6063039fb86277ef0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2050947
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
scm:
- Add methods to deal with git configs and tests for them.
Will make it easier to mock git config calls as opposed
to all git calls.
- Add tests to FetchUpstreamTuple
git-cl:
- Mock out settings.GetChangeRoot()
- Use scm.GIT.FetchUpstreamTuple() to reduce code duplication,
and mock it out on tests.
Bug: 1051631
Change-Id: I1a3220b4c0f3e6221b3c00550259a433c2775798
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2052552
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
We start warning if people have outdated systems.
Bug: 997354
Test: `cros --help` uses python3 now
Change-Id: I1491f1c0eea4d544cc508b461153c54c8072699d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2052243
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
This pulls the latest version from upstream.
This drops the custom keys Chromium has been carrying.
We switched our release signing over to the official key,
so there's no need for ours anymore.
The new version will attempt to use Python 3 if available
and whine if it's not. It shouldn't cause errors, just new
warnings, but it should help us track down old systems.
Bug: https://crbug.com/gerrit/10418
Test: `repo sync` still works
Change-Id: I915d0874a1642880831964f91c4632f9d17a1e4a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2044341
Reviewed-by: Michael Mortensen <mmortensen@google.com>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Is not needed, and it's deprecated on Python 3.
Change-Id: I040891ff74708c6606b8c216da3a0bb98d44d977
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2042281
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Anthony Polito <apolito@google.com>
Reviewed-by: Anthony Polito <apolito@google.com>
The `author` parameter is never set.
The `local_description` parameter was only set with the
purpose of getting the local description, so separate it into its
own method and call that instead.
Use the absolute root when getting the list of modified files instead.
Bug: 1042324
Change-Id: I8505172edaacee0656dda98ebbd5f8ebfacb3cef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2038050
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This is a reland of 1c8026d2f1
Original change's description:
> presubmit_support: Add --all-files options.
>
> Will be set when --all is passed to git-cl presubmit to execute
> presubmit checks over all files on a repo.
>
> Bug: 1042324
> Change-Id: I2ebb7c3ec633f9d3a3774314799aa056bc2919c8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2003071
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Bug: 1042324
Change-Id: I452d98972f9b2c6d0a212029bac5aa6af57dce40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2038055
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This reverts commit 42a51f6af1.
Reason for revert: With this change also JavaScript code in the
V8 code base gets formatted. However, clang-format cannot deal with
V8 intrinsics, and therefore inserts a space between the `%` and the
intrinsics name. With that Clusterfuzz cannot detect intrinsics
anymore, and therefore the blacklisting of intrinsics would not
work anymore. The result is that Clusterfuzz then produces useless
test cases that are known to crash and could not exist in the wild.
Original change's description:
> Enable Javascript formatting by default
>
> This removes the need for explicitly passing `--js` to `git cl format`
> to format both JavaScript and TypeScript. It would reduce a significant
> amount of mental overhead for formatting code in DevTools frontend,
> which is primarily JS/TS.
>
> Fixed: 1007347
> Change-Id: Ia35c9af677d12ce9be72fe5fcdd6ceb6cb039c5f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2029371
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
TBR=tvanderlippe@chromium.org,apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I13e8ce8916f0685b667607f2c8e68b1185d43329
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2041650
Reviewed-by: Tamer Tas <tmrts@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
The Goma team releases the Goma client in depot_tools via CIPD.
Let me add all the Goma client release rotation so that they do not
need to wait for the review.
Bug: b/148421866
Change-Id: I45eb24ac8c34bba2183c16e72dcf0a9d7f13d603
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2040850
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Auto-Submit: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
This reverts commit 1c8026d2f1.
Reason for revert:
Description should be set from gerrit before parsing the changes.
Original change's description:
> presubmit_support: Add --all-files options.
>
> Will be set when --all is passed to git-cl presubmit to execute
> presubmit checks over all files on a repo.
>
> Bug: 1042324
> Change-Id: I2ebb7c3ec633f9d3a3774314799aa056bc2919c8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2003071
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
TBR=ehmaldonado@chromium.org,apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: I8c455a269cdd6eb3dea9379faf351a04644bd23f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1042324, 1048885
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2038052
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Will be set when --all is passed to git-cl presubmit to execute
presubmit checks over all files on a repo.
Bug: 1042324
Change-Id: I2ebb7c3ec633f9d3a3774314799aa056bc2919c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2003071
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Needed to find *.winmd files for UWP build.
This CL and crrev.com/c/2007881 were used to generate the recent
toolchains with UWP support:
b92fff97f2e0323e99803f37f4b77b843bdbf69d in crrev.com/c/2015984 and
9ff60e43ba91947baca460d0ca3b1b980c3a2c23 in crrev.com/c/2025528.
Bug: chromium:1032635
Change-Id: I1ab0b6e11a30600deb377078815c268d8f9027e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2013579
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Mock time_time so that time.time is not called from ThreadPoolTest tests,
so that the execution time doesn't change between executions.
Bug: 1047631
Change-Id: I4f4ac30ca6a2ee3be25830c0e17a9f29a9c0c999
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2036477
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Needed by Skia's PostUploadHooks, so that presubmit_support
doesn't depend on git-cl classes.
Bug: 1042324
Change-Id: I02475e346437b26fa8d0d2021ea62754077a2b5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2007262
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Needed by Skia's PostUploadHooks, so that presubmit_support doesn't
depend on git-cl internal classes.
Bug: 1042324
Change-Id: If8f4e6ea035197667cd9705a4274590c4d11511e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2007670
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
It is needed for UWP build and is the same on at least 2 machines in
C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.18362.0\Windows.winmd
Bug: chromium:1032635
Change-Id: I9d7148a8dc11ea85f1b930f63ae19eaa58ac2bf6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2007881
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
This removes the need for explicitly passing `--js` to `git cl format`
to format both JavaScript and TypeScript. It would reduce a significant
amount of mental overhead for formatting code in DevTools frontend,
which is primarily JS/TS.
Fixed: 1007347
Change-Id: Ia35c9af677d12ce9be72fe5fcdd6ceb6cb039c5f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2029371
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
The CL https://crrev.com/c/chromium/tools/depot_tools/+/2031104 used
the full hash when calling "git log" to fix the roll on some bot. It
however resulted in the full hash visible in the commit message.
Fix the command included in the commit message while still using the
full hash in the command invoked.
Bug: none
Change-Id: I454e600fc34e554c1186ae9488ea4b0f7e7df310
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2031105
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Some bots run roll-dep.py and fail while generating the commit message
with the following error:
src/ios/third_party/material_components_ios/src: Rolling from 54fd1dac39 to 5aaf54801f
fatal: ambiguous argument '54fd1dac3..5aaf54801': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
As "Rolling from 54fd1dac39 to 5aaf54801f" is printed, this mean that
the bot was able to resolve both HEAD and roll_to before invoking this
function, thus the corresponding hashes exists in the repository.
It is unlikely that shortening the hash to just the first nine chars
results in a collision, but there is no reason to use a short hash
when invoking git anyway, so use a separate variable to construct the
header of the commit with short hashes while invoking git with the
full hashes.
Also pass '--' after all the parameters to force git to interpret the
hash range as a range and not as a path.
This is a speculative fix.
Change-Id: Iaa2888610dcf8e20f9edc115a719791d573b83ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2031104
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Without this change, having an SSH remote configured makes `git cl
archive` crash:
Traceback (most recent call last):
File "/usr/local/google/home/fmayer/depot_tools/metrics.py", line 267, in print_notice_and_exit
yield
File "/usr/local/google/home/fmayer/depot_tools/git_cl.py", line 5553, in <module>
sys.exit(main(sys.argv[1:]))
File "/usr/local/google/home/fmayer/depot_tools/git_cl.py", line 5535, in main
return dispatcher.execute(OptionParser(), argv)
File "/usr/local/google/home/fmayer/depot_tools/subcommand.py", line 252, in execute
return command(parser, args[1:])
File "/usr/local/google/home/fmayer/depot_tools/metrics.py", line 252, in _inner
return self._collect_metrics(func, command_name, *args, **kwargs)
File "/usr/local/google/home/fmayer/depot_tools/metrics.py", line 232, in _collect_metrics
gclient_utils.reraise(exception[0], exception[1], exception[2])
File "/usr/local/google/home/fmayer/depot_tools/metrics.py", line 205, in _collect_metrics
result = func(*args, **kwargs)
File "/usr/local/google/home/fmayer/depot_tools/git_cl.py", line 3786, in CMDarchive
for cl, status in statuses
File "/usr/local/google/home/fmayer/depot_tools/git_cl.py", line 3599, in get_cl_statuses
cl.EnsureAuthenticated(force=False, refresh=True)
File "/usr/local/google/home/fmayer/depot_tools/git_cl.py", line 1757, in EnsureAuthenticated
if urllib.parse.urlparse(self.GetRemoteUrl()).scheme != 'https':
File "/usr/lib/python2.7/urlparse.py", line 143, in urlparse
tuple = urlsplit(url, scheme, allow_fragments)
File "/usr/lib/python2.7/urlparse.py", line 201, in urlsplit
i = url.find(':')
AttributeError: 'NoneType' object has no attribute 'find'
Change-Id: I6f794f11d3ed5e3dbedfe278ded660fca32abda6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2030505
Commit-Queue: Florian Mayer <fmayer@google.com>
Reviewed-by: Anthony Polito <apolito@google.com>