This allows us to configure the get_use_siso_default to give a notification suggesting people to switch.
Bug: 393209062
Change-Id: I1bced33272a6dd19d4e71f96f80ac6de61b48d9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6217099
Commit-Queue: Matt Stark <msta@google.com>
Reviewed-by: Junji Watanabe <jwata@google.com>
No need to print status if the user interrupts the compile. Status is
always (all tasks done) since the remaining tasks will have been
canceled.
Change-Id: I3c4e5ff867cfd460aa357197f09276d128b00e01
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6207097
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Auto-Submit: Mohamed Heikal <mheikal@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
The check was originally introduced as part of svn -> git migration, and
no longer needed. This can use issues if user runs vendored depot_tools
inside chromium/src.
R=ddoman
Bug: 347356471
Change-Id: I1a082886933f23e1d7c53f2da906d0727c180a75
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6209088
Reviewed-by: Scott Lee <ddoman@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Git is no longer installed by depot_tools (it should have been
installed directly). Thus, it can be removed from the bootstrap
manifest.
This CL applies the change to `manifest_bleeding_edge.txt`
first, to canary the change.
Bug: b/360206460
Change-Id: I78ced461bc68c33c9979668df1e275ccba6cd2e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6205606
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Anne Redulla <aredulla@google.com>
sys.platform doesn't contain major version of aix.
Always return 'aix', instead of 'aix6' or 'aix7'.
R=gavinmak@google.com, kimstephanie@google.com
Change-Id: I6d2075be808503731996df7bf17f23527ebdf445
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5999752
Commit-Queue: Scott Lee <ddoman@chromium.org>
Reviewed-by: Scott Lee <ddoman@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Looking at split’s documentation it was not clear what was the
behavior when the max-depth flag was missing. As it’s the default,
this seems like an important information. Especially when a warning
state to use it. Also, I thought the depth was counted starting from
the file, not the root. E.g. for file a/b/c/d/e.cc, the depth 1 would
mean using a/b/c/d/OWNERS, and not a/OWNERS. I believe that an example
would make it clearer to future users of LSC how to use this value.
Bug: None
Change-Id: I5d2b4f2fefceb8a4ec86ee1c508fb7848f69e44f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6179836
Auto-Submit: Arthur Milchior <arthurmilchior@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Arthur Milchior <arthurmilchior@chromium.org>
This includes:
- adding `--host` parameter to `git-cl cherry-pick`
- adding `GetCommitMessage` to gerrit_util to be able to switch from `git show` used to get the commit message for a change
Bug: b/391547354
Change-Id: I9af227a78af5aaa1bdc98fc2520d98b413f0f3ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6180633
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gennady Tsitovich <gtsitovich@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Somewhere deep in the Google Cloud Go SDK is a call to user.Current() to
get the user's home directory, in order to find some configuration files
necessary for TLS Client Certificate authentication.
The user.Current() function in Go versions prior to the yet unreleased
Go 1.24 can be very slow on Windows, as it causes a network call to the
Active Directory server to be made if the machine is part of a Windows
domain.
As we don't use TLS Client Certificate at Google, we can safely disable
this code path by setting GOOGLE_API_USE_CLIENT_CERTIFICATE=false in the
environment prior to launching reproxy and other tools using the SDK.
As I'm not sure whether this would cause issues for people actually
using TLS Client Certificate auth with their REAPI backend, let's only
apply this workaround on Google corp machines. It's highly unlikely that
others are affected by this particular issue anyway, and when Go 1.24
is released in February, it will fix the underlying issue anyway.
Bug: 388195531
Change-Id: Ia9d4b74c251b303b66b19fb59957ff5a922d883b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6191410
Auto-Submit: Philipp Wollermann <philwo@google.com>
Commit-Queue: Philipp Wollermann <philwo@google.com>
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
`git cl split` has the potential to do a lot of operations at once,
which is problematic if it didn't end up splitting things in a way
the user approves of. This changes it to print a summary of the
splitting, and asking the user to review it briefly before proceeding
with the upload.
Bug: 389069356, 40642562, 40269201
Change-Id: I90bead0147badbaa3afcce2264d805ae498f101c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6163905
Commit-Queue: Devon Loehr <dloehr@google.com>
Reviewed-by: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: Andy Perelson <ajp@google.com>
Currently using a license in the WITH_PERMISSION_ONLY list will create a
warning. By making an ALL_LICENSE list including this list and also
allowing it when checking for open source compatible licenses, it will
no longer create warnings.
This will enable us to change the current warnings into errors.
Bug: b/388620886
Change-Id: I883a3d3c825f0f1903b62d0b93810218b1f42bb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6188501
Commit-Queue: Jordan Brown <rop@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
Unfixed when we migrated Gerrit auth to git-credential-luci
Bug: b/342261857
Change-Id: I6660f03de830337b14b822a0245f6e0d18a58366
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6174308
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
There's some confusion on what account to use to login. Add the
context for Gerrit to hopefully make it a bit easier to decide.
Bug: b/342261857
Change-Id: Ie59b156c2a91f8168bcd2f381f85fb8157040d80
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6178581
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
If the user uses SSO (and thus has SSO rewrite rules) for their global
config, a repo which locally uses an email that doesn't use SSO needs
an override.
Bug: b/390219533
Change-Id: I639dae4c1a45bbd2c17180855c22260979b0dbc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6177780
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
Adding a special entry for dependencies using this license id.
The Android Software Development Kit License is a special case.
It can introduce licensing complexities due to the potentially extensive
transitive dependency chain. Developers should carefully review the
licenses of all dependencies.
Change-Id: I8626391ce04f921a9efa519a5305afce62a5f1c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6174215
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
The documentation aims to cover how to make, and review changes to this file.
Change-Id: I887ce938df71119f5d04f7cec30350beddcdef47
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6168292
Commit-Queue: Jordan Brown <rop@google.com>
Reviewed-by: Nico Weber <thakis@google.com>
Reviewed-by: Rick Byers <rbyers@chromium.org>
This change introduces a new error for license fields that use any of
the following `["/", ";", " and ", " or "]`.
I chose to include the offending character/s in the error message
because I find it easier to parse error messages that tell me exactly
which character is the bad one. Similarly I've included conditions in
the reason to handle the plural cases correctly, generating either:
`License contains a bad delimiter character ...`, or
`License contains bad delimiter characters ...`
I realise this means that any downstream rules looking to detect this
error will need to check for a common subset, e.g 'bad delimiter
character', however I think it's worth it for the improved user
experience of receiving the error.
I've also anticipated that most of these errors will be due to
situations where multiple licenses are offered, and included additional
text explaining that only the most permissive of the choices should be
included.
This will affect 9 dependencies and they need to choose between multiple licenses anyway so it's okay to generate an error and have partybug file bugs.
Bug: http://b/374850412
Change-Id: I6eb53a8a3bd541a1801dff133884b719dcdfe04d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6181848
Reviewed-by: Jiewei Qian <qjw@chromium.org>
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
This is a reland of https://crrev.com/c/6168707 with fixes.
The CL adds a new param, unified, to git_diff() and create_diffs()
as a required param.
The functions themselves are tested in presubmit_diffs_test.py, but
their usages in presubmit_support.py were not, and the missing param
caused a failure in CiderG (b/389876151)
This CL basically carries the same patch, but makes the params
optional with a default value and adds unit tests for the usage
in presubmit_support.py
Tested with CiderG: https://screenshot.googleplex.com/PYEDZ3NGn5cYGtV
Change-Id: Ic747c6a133c016dbcd80034e521c76a3db3a3f60
Bug: 389876151, 379902295
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6182703
Commit-Queue: Scott Lee <ddoman@chromium.org>
Reviewed-by: Gary Tong <gatong@chromium.org>
RunHook being called at the beginning of the git cl upload command, is necessary for non-squash mode, but is an extra and unnecessary call for squash mode. This Runhook call can be moved later down the call stack as well, but would require a lot more changes to tests (in what needs to be mocked)
Change-Id: I0373c5de84d98c4e8c39dece95a247227562ab82
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6181588
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Adds "BLAS", "LicenseRef-base64-cpp", and "SolarDesigner", to the allow
listed licenses.
Bug: 365320654
Change-Id: Id156b2cc881167e4dac88a9e671b21e5de8263bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6172448
Reviewed-by: Jordan Brown <rop@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
Sometimes I want to add a message without touching the attention set.
The default review call will automatically update it regardless. Add
a flag to explicitly control behavior.
Test:
# No attention set option.
$ ./gerrit_client.py ...
-> ignore_automatic_attention_set_rules not included in body of request
$ ./gerrit_client.py ... --automatic-attention
-> body has {'ignore_automatic_attention_set_rules': False}
$ ./gerrit_client.py ... --no-automatic-attention
-> body has {'ignore_automatic_attention_set_rules': True}
Change-Id: Idcf7975ba691942cfe385a2156ef3a3ec064a0b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6172486
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Mike Frysinger <vapier@chromium.org>
gerrit_utils retries failed HTTP requests 6 times by default. For SubmitChange the failure reason is often 409 on a merge conflict, which doesn't make sense to retry as the conflict remains.
This is being done as part of improving efficiency of submitting Chrome signing request changes. We currently spend a lot of time just retrying to submit a conflicting change. Reducing the number of retries in gerrit_util will free up the time for more retries that include fully recreating the change on top of the latest changes.
Bug: 365827690
Change-Id: Ifae83c14da7ca829a155c1cd6e79398e5ea0cf85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6172303
Reviewed-by: Brian Ryner <bryner@google.com>
Commit-Queue: Alex Kravchuk <alexanderkr@google.com>
This reverts commit 4c54361841.
Reason for revert: Reland with a fix.
Find https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6173762/1..2
Tested by running presubmit_support.py --generate_diff
Original change's description:
> Revert "add support for -U in presubmit_diff.py"
>
> This reverts commit b576ab3b78.
>
> Reason for revert: http://b/389876151
>
> Original change's description:
> > add support for -U in presubmit_diff.py
> >
> > presubmit_diff.py is going to be used to compute the changes to be
> > formatted, and -U helps minimize the number of irrelevant lines
> > from formatting.
> >
> > Bug: 379902295
> > Change-Id: I9c0a2ee6b5ffa6b9fe4427362556020d525f1105
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6168707
> > Reviewed-by: Gavin Mak <gavinmak@google.com>
> > Commit-Queue: Scott Lee <ddoman@chromium.org>
>
> Bug: 379902295
> Change-Id: I82dd707e5ae3d4b1760e632506ee0e1bc1d76e09
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6173760
> Reviewed-by: Scott Lee <ddoman@chromium.org>
> Commit-Queue: Gavin Mak <gavinmak@google.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bug: 379902295
Change-Id: Icbc4aa98bbfaa816143be064217fb2d992b48baf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6173762
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Scott Lee <ddoman@chromium.org>
This includes a backported bugfix from 3.12 which prevents the
interpreter from hanging while generating stack traces - previously
the garbage collector could kick in during stack trace collection
and cause the interpreter to hang.
R=bjoyce, fancl
Bug: 387535231
Change-Id: I2b45c155377ad76dd5876228e9c4cccb374ba2ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6158273
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Chenlin Fan <fancl@chromium.org>
Reviewed-by: Benjamin Joyce (Ben) <bjoyce@chromium.org>
When adding tests, the LoadDescription function accidentally got called
with the wrong arguments in the main function. This fixes that; a future
CL (uploading shortly) adds more robust tests that would have caught this.
Bug: 389568463, 389069356
Change-Id: Icaf5e83cd8caa9f3975173f8c8ee7d92ef44ee56
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6170638
Commit-Queue: Andy Perelson <ajp@google.com>
Reviewed-by: Brian Ryner <bryner@google.com>
Reviewed-by: Andy Perelson <ajp@google.com>
Auto-Submit: Devon Loehr <dloehr@google.com>
This is a little bit more boiler plate, but the UX is much nicer.
Asserts produce race tracebacks while parser.error produces a clean
error message. This in turn makes it much more obvious that the
user made an error vs the tool crashing.
If gerrit_client was written using argparse, we could just set
required=True on the option, but it's still using optparse, and
that has no built-in support for required options.
Before:
$ ./gerrit_client.py addmessage
Traceback (most recent call last):
File ".../depot_tools/./gerrit_client.py", line 563, in <module>
sys.exit(main(sys.argv[1:]))
^^^^^^^^^^^^^^^^^^
File ".../depot_tools/./gerrit_client.py", line 555, in main
return dispatcher.execute(OptionParser(), argv)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../depot_tools/subcommand.py", line 254, in execute
return command(parser, args[1:])
^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../depot_tools/./gerrit_client.py", line 409, in CMDaddMessage
(opt, args) = parser.parse_args(args)
^^^^^^^^^^^^^^^^^^^^^^^
File ".../depot_tools/./gerrit_client.py", line 547, in parse_args
assert options.host, "--host not defined."
^^^^^^^^^^^^
AssertionError: --host not defined.
After:
$ ./gerrit_client.py addmessage
Usage: gerrit_client.py addMessage [options] [args ...]
gerrit_client.py: error: --host is required.
Change-Id: I2f807628439e6399daaedc00cd42d160505ee4ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6172484
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
This reverts commit b576ab3b78.
Reason for revert: http://b/389876151
Original change's description:
> add support for -U in presubmit_diff.py
>
> presubmit_diff.py is going to be used to compute the changes to be
> formatted, and -U helps minimize the number of irrelevant lines
> from formatting.
>
> Bug: 379902295
> Change-Id: I9c0a2ee6b5ffa6b9fe4427362556020d525f1105
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6168707
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Scott Lee <ddoman@chromium.org>
Bug: 379902295
Change-Id: I82dd707e5ae3d4b1760e632506ee0e1bc1d76e09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6173760
Reviewed-by: Scott Lee <ddoman@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
presubmit_diff.py is going to be used to compute the changes to be
formatted, and -U helps minimize the number of irrelevant lines
from formatting.
Bug: 379902295
Change-Id: I9c0a2ee6b5ffa6b9fe4427362556020d525f1105
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6168707
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Scott Lee <ddoman@chromium.org>
The modified lines are corresponding to the following codes in
clang-format-diff.py
: https://source.chromium.org/chromium/chromium/src/+/main:third_party/clang-format/script/clang-format-diff.py;l=124-135
This CL fixes the following two issues.
1) if lines are simply removed w/o replacements in the original text,
_ComputeFormatDiffLineRanges() returns values that result in
--line $start:$start, which formats the start line number of the secion
in the new text, whcih is not the removed line.
If lines are simply removed, no formatting is necessary in the new text.
2) incorrect line counts in the next text.
The line count includes the starting line. Therefore, if the hunk has
12:1, it corresponds to the single, 12th line. However, the existing logic
translates it as 12th and 13th lines.
In most cases, the above issues won't make visible changes. Even if
they do, engineers wouldn't notice, as it would just format one additional
line below the changes that they made.
However, this CL is to match the same behaviour implmented in
clang-format-diff.py
Change-Id: Ifd2a19c8801c836f8e0799410b372a0f258fd476
Bug: 379902295
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6172780
Commit-Queue: Scott Lee <ddoman@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>