Logs a warning if reading the config fails. Still logs a warning for
recommended settings, so the user can create their global config.
Annoyingly, the exit code is the same for missing config file as it is
for an existing but invalid file.
Bug: b/382395049
Change-Id: I81113ff248f7a5eed2f9fd0303e0e81ae80d7d3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6086756
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Anne Redulla <aredulla@google.com>
In git 2.41, both `list` and `unset` are only options, `--list` and `--unset` respectively. See https://git-scm.com/docs/git-config/2.41.0
These modes are deprecated in later versions; it is recommended to
migrate to the newer syntax, but the old syntax is still supported.
Bug: b/382395049
Change-Id: I9150983084b91279e4f4587a80737e6813937cd6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6083215
Commit-Queue: Anne Redulla <aredulla@google.com>
Reviewed-by: Peter Boström <pbos@chromium.org>
Owners-Override: Anne Redulla <aredulla@google.com>
The Windows global Git config bootstrapping shows a warning if you have
not agreed to depot_tools automatically managing your global Git config.
To silence this warning, a user must either:
(1) explicitly allow to automatic management; or
(2) explicitly deny automatic management.
This CL adds a third way to prevent the warning:
(3) The existing global Git config already has the desired values.
Consequently, depot-tools.gitPostprocessVersion is redundant
and has been removed.
Bug: b/382395049
Change-Id: I18260962ee9647578e61993b191e9f76e99b342b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6072987
Commit-Queue: Anne Redulla <aredulla@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Use the "official" XML schema validation pattern from published CPE
schema.
Add a error message to tell owners that they need to provide at least
one component (other than part) in CPE URN format.
Bug: 378273455
Change-Id: I5ac957f02a0f899d069161cdce54fff499fb35f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6073136
Commit-Queue: Jiewei Qian <qjw@chromium.org>
Reviewed-by: Anne Redulla <aredulla@google.com>
LINT.ThenChange is followed by path which sometimes may exceed the
length limit
Bug: 382239821
Change-Id: I2142fd3326704593bd46c8937b1bb904bcef4763
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6077446
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
When a license validation warning is generated, link to the allowlist file for easy fixing.
Bug: 382745675
Change-Id: I4899401a687ce06e74cd18a95e1a28a2684a8027
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6076211
Reviewed-by: Jordan Brown <rop@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
git-credential-luci is very similar to luci-auth, except that it is
expressly for git/Gerrit. Therefore, it hard codes the scopes needed
for git/Gerrit. It's also a separate binary, which makes it more
convenient for us to configure it for ReAuth later.
Bug: b/382341041
Change-Id: I7de56d3922adac7eb4671849eb6e30be310d4de7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6073043
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
The gclient config refers to a repo that is no longer used and includes
non-inclusive language.
Bug: 40712760
Change-Id: Id7faec4beefdc4387cd8860910e43cbdcac3625a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6070412
Commit-Queue: Garrett Beaty <gbeaty@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
We already have another check for long lines for all languages, we don't
need to block pylint on the same.
Change-Id: I2abc65380a482242a6fde380ba3d8e28a5ba781a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6062830
Reviewed-by: Andy Perelson <ajp@google.com>
Commit-Queue: Andy Perelson <ajp@google.com>
This CL makes searching for an existing system installation of Git
the default behavior.
If a direct Git installation is not found, a warning will be
logged and the bundled Git for Windows will be used instead.
Bug: b/360206460
Change-Id: I48d68b2bf193865ca573199b42e7838c28f1e3cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6068030
Reviewed-by: Allen Li <ayatane@chromium.org>
Commit-Queue: Anne Redulla <aredulla@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Git has been using version 2 of their wire protocol by default since
2.26, released in 2020. Stop setting it explicitely.
Change-Id: Ibc93a672b41c5a8183bc3200c506006f6e08af94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6070782
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
May help user to diagnose/debug some issues.
Bug: b/372552465
Change-Id: Ia9fc4fd49c8ee80bccd98442ed5589324d0b23b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6068966
Reviewed-by: Gavin Mak <gavinmak@google.com>
Auto-Submit: Allen Li <ayatane@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
Modifying the system-level Git config may require admin privileges,
depending on where Git was installed.
This CL makes the bootstrap.py script target a user's Git config
at the global level, instead of system level.
Checks the global Git config for postprocess version and explicit
enabling of global config changing. Logs a warning if out of date
and not enabled so the user knows how to agree to global config
changes.
Bug: b/379888465, b/360206460
Change-Id: I9be395b64d5429f85514397918f4a6140dfe2a1a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6034204
Reviewed-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Anne Redulla <aredulla@google.com>
Gerrit allows multiline footers with indents.
e.g.,
Test: something
looks great
This CL fixes the bug such that add_footer correctly inserts
a given message after multiline footers.
Bug: 379923433
Change-Id: I9b3f793095b63b0586123543a2f8d49f0503fca0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6064963
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Scott Lee <ddoman@chromium.org>
The param before_key used to be used in presubmit_support.py, but
it was removed in 2018, and has never been used anywhere since.
- https://crrev.com/c/1351509
- http://shortn/_YQUh4yC9Tc
This CL removes it to simplify the code before the next CL.
It hasn't been used for several years and will unlikely be used
in the future.
Bug: 379923433
Change-Id: Ib0da340235a991b6d8edca041eae811540d4aa60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6064306
Commit-Queue: Scott Lee <ddoman@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
This CL adds a hint on how to log into GCS to the 401 error message
displayed to the user.
Bug: 381634957
Change-Id: Id72b5030c018b28a7297b7ff3f279485c6da4d9e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6056844
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Alan Cutter <alancutter@chromium.org>
crrev.com/c/6049353 updated bot_update.ensure_checkout to comput the
output commit even when not setting the output commit so that callers
could do custom logic for setting output commits while still having
access to the one computed by bot_update. Unfortunately, this changed
behavior for some builds that have set_output_commit set false. When
computing the output commit, if none of the conditions that set the ref
on the output commit were true then an AssertionError would be raised
indicating that the caller should call
buildbucket.set_output_gitiles_commit. With crrev.com/c/6049353, the
assertion can be raised even if set_output_commit is false.
This changes it so that the constraint on the ref field is only enforced
when set_output_commit is true.
Bug: 366409421
Change-Id: Ifb3a39784d75a3c47a7d4a6e2ac9957c29a09938
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6064719
Auto-Submit: Garrett Beaty <gbeaty@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Getting a lot of "(401) Unauthorized" responses for these now. This at
least makes the script not crash.
Change-Id: Ib42ccbdb3326a0918015e9d5e1cc9392a9c1a469
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6049877
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
These were introduced in crrev.com/c/6024739 and currently break
autoninja for non-Googlers who manually enable Siso by setting the
use_siso=true GN arg.
$ gn gen --args='use_siso=true' out/Debug
$ autoninja -C out/Debug base
Traceback (most recent call last):
File "/home/philwo/depot_tools/autoninja.py", line 504, in <module>
sys.exit(main(sys.argv))
^^^^^^^^^^^^^^
File "/home/philwo/depot_tools/autoninja.py", line 493, in main
exit_code = _main_inner(input_args, build_id, should_collect_logs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/philwo/depot_tools/autoninja.py", line 249, in _main_inner
assert use_siso != False
^^^^^^^^^^^^^^^^^
AssertionError
R=ukai@google.com
Change-Id: I6536576d39b4ef094daa4e7ec80f3d743ecefd85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6058992
Auto-Submit: Philipp Wollermann <philwo@google.com>
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
Commit-Queue: Fumitoshi Ukai <ukai@google.com>
If use_reclient_value.py is not found and args.gn only has
use_remotexec=true, the autoninja fails to start reproxy.
Change-Id: I6608ea48b66864bf2ab89176b6b01a79e07b7564
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6059221
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
Commit-Queue: Aleksei Khoroshilov <akhoroshilov@brave.com>
https://crrev.com/c/6048393 provides build/toolchain/use_reclient_value.py
to get value for use_reclient.
Use it in autoninja if it exists.
Bug: 341167943
Change-Id: Ia6207ea044cc109fa156deff3c3357475368576f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6024739
Commit-Queue: Fumitoshi Ukai <ukai@google.com>
Auto-Submit: Fumitoshi Ukai <ukai@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Junji Watanabe <jwata@google.com>
out_commit is parsed from got_revision even when set_output_commit is False. This allows for the calling code to implement its own logic for setting output commit, but still use the commit from bot_update if needed.
Example of usage: https://crrev.com/c/6049557.
Bug: 366409421
Change-Id: I49ce89730fe780d7561077f82797b30fad87e65e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6049353
Reviewed-by: Garrett Beaty <gbeaty@google.com>
Commit-Queue: Alex Kravchuk <alexanderkr@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
This reverts commit 66b3972fc5.
Reason for revert: This won't work because chromium_checkout relies on the position being set in the output commit in order to set information for RDB. We'll have to come up with a different solution.
Original change's description:
> Add parse_commit_position parameter to BotUpdateApi.ensure_checkout.
>
> When true and got_revision_cp is present, output commit ref and position are set from got_revision_cp. Default value is true.
>
> For Chrome builds that build from tags we will set parse_commit_position to false to show tags instead of branches on Buildbucket UI, e.g. refs/tags/132.0.6824.0 instead of refs/branch-heads/6824@{#1}.
>
> Bug: 366409421
> Change-Id: I77d01615edb6b791445a06469f80c673c97ad8d6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6000539
> Reviewed-by: Garrett Beaty <gbeaty@google.com>
> Reviewed-by: Scott Lee <ddoman@chromium.org>
> Commit-Queue: Alex Kravchuk <alexanderkr@google.com>
Bug: 366409421
Change-Id: I21a5fc6e011a64fffd1d2ef0689d5a3f3843482c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6037603
Reviewed-by: Garrett Beaty <gbeaty@google.com>
Commit-Queue: Alex Kravchuk <alexanderkr@google.com>
Reviewed-by: Scott Lee <ddoman@chromium.org>
gn finds // by searching .gn in parent directories.
To support out dir is not 2 directories from root (i.e. out/Default),
search .gn in parent directory for '//' location.
tools/licenses/licenses.py runs 'gn gen' in out/Default/$tmp.
for such case, '//' should be '../../..', or fail to import '//path'
Change-Id: I6e5ccbe93cb5e51704f31d4eb558c03560286865
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6051636
Reviewed-by: Philipp Wollermann <philwo@google.com>
Commit-Queue: Fumitoshi Ukai <ukai@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>