Commit Graph

11309 Commits (main)
 

Author SHA1 Message Date
Allen Li c4e7c8717c gerrit_util: Delete temporary text about auth testing setup
Change-Id: I6c61998c1fca2681f6dc0f33468a8ae5b378f12e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6306289
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
19 hours ago
Allen Li 4ac4d26e80 gerrit_util: Always use SSO in Cog
Bug: 396027841
Change-Id: I0e4f8442b0b630afaf1b716115007af3cbf6ee38
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6306288
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
20 hours ago
Peter Wen 3a5e3144af split_cl: Fix Emit-related warnings
Encountered while using `git cl split`.

Bug: None
Change-Id: I8ecaf44a64a5917f50176b8d88e367731a6dee35
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6309324
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Devon Loehr <dloehr@google.com>
Auto-Submit: Peter Wen <wnwen@chromium.org>
1 day ago
Fumitoshi Ukai f638e8a918 autoninja: use build/toolchain/remoteexec_defaults.gni for use_reclient
Instead of using build/toolchain/use_reclient_value.py in
both autoninja and gn, use build/toolchain/remoteexec_defaults.gni
to set default value for use_reclient (on siso or on ninja).

Bug: 397994249
Change-Id: Ia4302fe8794218d485e52ca38f8523453814a6b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6301378
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Fumitoshi Ukai <ukai@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
1 day ago
Yiwei Zhang e5159abea6 Add CheckNewDEPSHooksHasRequiredReviewers canned check
This will later be used in chromium PRESUBMIT to ensure newly added DEPS
hook MUST be reviewed by a dedicated reviewer.

Bug: 396736534
Change-Id: I3859814c6316d4e576d12114277671ed5db80e33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6284565
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
2 days ago
Yiwei Zhang 53f5a2d969 stop running test in python 3.8
chromium[1] and cros[2] have both moved to 3.11 which is the version
depot_tools use by default right now. Therefore, we should stop running
tests using python 3.8 to ensure compatibility and start using features
introduced after python 3.8

[1]: https://issues.chromium.org/40942322
[2]: http://b/318531403

Change-Id: I2bac00421a46793717387cec1898035b10b13b9e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6306285
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 days ago
Mohamed Heikal 678f73bd0e [autoninja] Pass the output directory to the build server
When registering the build with the build server, pass in the output
directory.

Change-Id: Ie6ed0bf5d73926fb163085067aafcd350063ee5a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6249305
Auto-Submit: Mohamed Heikal <mheikal@chromium.org>
Reviewed-by: Philipp Wollermann <philwo@google.com>
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
2 days ago
Fumitoshi Ukai deb5575fbd autoninja: move use_siso default logic in autoninja.py
chromium now doesn't use `use_siso` value for build graph,
so no need to use use_siso_default.py in gn context.
use_siso value is only used to determine autoninja use
siso or ninja, so put use_siso default logic in autoninja.py.

Will remove build/toolchain/use_siso_default.py in chromium

Bug: 397994249
Change-Id: Idb31c4e75f0a1c3bc4a97089494ec16be9879a49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6301272
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Auto-Submit: Fumitoshi Ukai <ukai@google.com>
Commit-Queue: Fumitoshi Ukai <ukai@google.com>
2 days ago
Tomasz Śniatowski 823adab6bd gn_helper: add missing sys import
A recent change added sys usage without the corresponding import. Add it.
See https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6217699

Bug: 393209409
Change-Id: Ib30dc8938ec6e3b56ab35a7b5e2b2071cb9e84ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6300492
Auto-Submit: Tomasz Śniatowski <tomasz.sniatowski@xperi.com>
Commit-Queue: Fumitoshi Ukai <ukai@google.com>
Reviewed-by: Philipp Wollermann <philwo@google.com>
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
2 days ago
Jordan Brown a60883e901 metadata: Fix metadata validator error reporting
Validate errors should be returned as errors (as warnings are ignored), not warnings

Once the following CL's have been submitted there will be 0 presubmit errors or warnings.
* https://crrev.com/c/6284506
* https://crrev.com/c/6296486
* https://crrev.com/c/6290266
* https://crrev.com/c/6296606
* https://crrev.com/c/6297263
* https://crrev.com/c/6296425
* https://crrev.com/c/6290667
* https://crrev.com/c/6287813
* https://crrev.com/c/6289887
* https://crrev.com/c/6290124



Bug: 285453019
Change-Id: I3448435dcb0505722a2c68476ef9d752a6614533
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6296579
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
Commit-Queue: Rachael Newitt <renewitt@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
3 days ago
Devon Loehr f0b8c3b16c [git cl split]: Allow users to override reviewer assignment
This CL adds a --reviewers flag, which allows users to specify that CLs
should all be sent to the same (possibly empty) set of reviewers. This
can be useful for LSCs where OO+1 is available.

Bug: 389069356, 40269201
Change-Id: Ic6202b280bb676f75a71c4ccf0c41b32483d5c6e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6298664
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Devon Loehr <dloehr@google.com>
3 days ago
Jordan Brown feeac124f2 Make custom.license_file validation error a warning, not a hard error.
This is because the linux-presubmit ci job does not run with all
dependencies checked out. See bug for details.

Bug: 398970704
Change-Id: Ia562cc6de7e586f947ccc9d351e9fc5feafa9f22
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6300962
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
4 days ago
Devon Loehr 4629c3474e [git cl split]: Deprecate $directory in favor of $description
`git cl split` allows users to parameterize their CL descriptions
by including the string $directory, which is replaced by the list of
directories covered by each generated CL. However, as we add more ways
of generating splittings, a list of directories may not always be the
most appropriate description. For example, the --from-file option lets
users write arbitrary description strings.

This CL renames the $directory string to $description, to reflect this
new generality, and refactors all places in the code that expected a
directory list instead of a string. Since users may beused to the
current version, it does not remove $directory, but instead notes that
it is deprecated and emits a warning when it is used. After some time,
we can remove it entirely.

Bug: 389069356
Change-Id: If8c947fdcbbb4897675b015a377cf21123e51467
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6299688
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Devon Loehr <dloehr@google.com>
4 days ago
Devon Loehr 158b6837dc [git cl split] Add summarize option during dry runs
Currently, the dry run setting causes the script to print out extremely
detailed information about the splitting it generated. While this is
sometimes useful, often users only care about the overall shape of the
splitting. This CL adds a flag which lets them see the same brief
summary that's printed during full runs.

Bug: 389069356
Change-Id: I473740e50f382e63b1289101f3253ff8ae9e6bbe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6298096
Commit-Queue: Devon Loehr <dloehr@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
4 days ago
Devon Loehr 33522b8bbe Fix Python SyntaxError
Python has started warning about invalid escape sequences in strings.
This fixes the warning by escaping the backslash in question. It seems
Python was already (correctly) printing the literal backslash despite
the warning, so no behavioral change.

Bug: None
Change-Id: I2d5d8d56b989d9a1bb87aba69af0ebac0209a7a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6299490
Commit-Queue: Devon Loehr <dloehr@google.com>
Reviewed-by: Brian Ryner <bryner@google.com>
4 days ago
Devon Loehr 6e0fc6aaa1 [git cl split]: Refactor print function
This CL replaces the builtin print function with an alias `Emit`.
This is symmetric with `EmitWarning`, and primarily serves to allow
easier mocking during tests and debugging. No functional change.

Bug: 389069356
Change-Id: Ib2f5a7648458b6b1181606a3dccd9829542c5521
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6299489
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Devon Loehr <dloehr@google.com>
4 days ago
Scott Lee f945c74073 git_cl: sets opts.full if format-full-by-default is set
settings.GetFormatFullByDefault() looks up a git config to find if
format-full-by-default is set.

RunClangFormatDiff() and RunGoogleJavaFormat() uses the function to
determine whether it should format a given document full or not, and
it makes it difficult to make the wrapper functions git-op free.

To remove git dependencies from the Run functions, this CL simply sets
opts.full if the default is set.

Note that this CL makes a behaviour change to the Python Runner.

RunYapf() doesn't honor settings.GetFormatFullByDefault().
It just looks at opts.full only to determine how to format the file.
If this CL is landed, RunYapf() will take account of the git config to
determine whether it should format the full document or a part.

Bug: 386840832
Change-Id: Ibd7210e20897d354bd3eddf84927cf22105b7255
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6256552
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Scott Lee <ddoman@chromium.org>
5 days ago
Jordan e803e2cb4b Adding 'Patent' to WITH_PERMISSION_ONLY
Ideally we would track these separately but practically they fall into
the same category as the restricted license. It is on the OWNERS and the
reviewers to make sure that they comply with the terms of a Patent file
or any license. Currently we are just generating presubmit warnings that
are being ignored.

This will also enable future tooling that utilises this list for
auditing restricted licenses to surface Patent files.

Bug: 381146326
Change-Id: I0f091bef9649d3a9f7b03940c8634e56bee9541f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6290872
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
5 days ago
Jordan Brown ec894dd8c0 Support 'Refer to additional_readme_paths.json'
This is used by some README.chromium to reference transitive
dependencies, and is supported by licenses.py[0]

[0]
https://source.corp.google.com/h/chrome-internal/codesearch/chrome/src/+/main:tools/licenses/licenses.py;l=131-134

Bug: 398668341
Change-Id: Iac15b001614e7afa6eab981deaaf3d4aa5020d66
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6296123
Auto-Submit: Jordan Brown <rop@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Rachael Newitt <renewitt@google.com>
5 days ago
Devon Loehr c994f00dee [git cl split] Codify and enforce auto-resumption
`git cl split` claims to have built-in auto-resume capabilities, but
the nondeterminism in its splitting algorithm means they don't work
in practice. Now that we have the ability to load splittings from
files, we can ensure the user is using the same splitting as before,
and resume safely.

This CL does two things:
- It checks that any existing split branches match the splitting we're
  about to upload, and complains if they don't match. This relies on
  the fact that our branch names are unique and deterministic.
- It changes the auto-resume message to mention that --from-file is
  required, and includes the relevant filename. This requires tracking
  that filename from earlier in the program.

Bug: 389069356
Change-Id: Ic1d8964e96193ca93e05a9a39e286b84ffb61b06
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6280953
Commit-Queue: Devon Loehr <dloehr@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
7 days ago
recipe-roller c4a8aaee71 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8722300909718109521

recipe_engine:
ca788d1636
  ca788d1 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from 6df8fe616e99 to 0cddbdc27507

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=iannucci@chromium.org

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I9e29aec13bd718e9d4845838f0152c857ffc6500
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6288489
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
7 days ago
Alexander Cooper 5c7e9a0782 Update depot_tools documentation for squash-closed
Fixed: 395115987
Change-Id: Ia6d27144e9cc0e8156affbafc7c481cfe048813a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6287829
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
1 week ago
recipe-roller 2259aa1766 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8722385215502447569

recipe_engine:
c73d7ea697
  c73d7ea (vadimsh@chromium.org)
      [nodejs] Pick 3pp epoch based on the requested nodejs version.

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=iannucci@chromium.org

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I439145fa7d25939184d1008da6a9e72f369179bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6287826
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
1 week ago
Ramin Halavati ab387d1ddc Add items to license allowlist.
Add the following items to the allowlsted licenses based on the
requirement of crrev.com/c/6239492 :
 - PngSuite
 - Spencer-86
 - unicode_org

Bug: 378472917
Change-Id: I6dfa79d612131eae154e5030ec22b787ebc57060
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6243133
Commit-Queue: Jordan Brown <rop@google.com>
Auto-Submit: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: Jordan Brown <rop@google.com>
1 week ago
Paul Irish 237b84e76c Colorize branch names for rebase-update
To ease the UX of finding the branch name when there's a conflict to
resolve.

Change-Id: I34d16f2f7bd897a60e96b0391772b5d8985f3cb6
Bug: none
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6278647
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Paul Irish <paulirish@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
1 week ago
Scott Lee 000a266e69 metrics_xml_format: check the XML path against realpath
metrics_xml_format checks the given file path to ensure that
it's an XML under tools/metrics with the following steps.
1. convert the input file path as a real path.
2. check the real path starts with
  GetPrimarySolutionPath() + "/tools/metrics"

This doesn't work as intended if GetPrimarySolutionPath() returns
a symblink.

This patch converts GetPrimarySolutionPath() as a realpath to ensure
it runs the check based on the realpath of the git checkout.

Bug: 396182402
Change-Id: I3207eba7ed52d09a01b38d65fcf7c314622d95cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6279842
Auto-Submit: Scott Lee <ddoman@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
1 week ago
Alex Gough 74e3dea38d Add .test-mojom to mojom formatted types
These files are testonly but can still be formatted by the
mojom formatter, so add to the matched extensions.

Bug: 397343888
Change-Id: I60352e8400e68426f262eb5601b76c17c0f0b912
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6279546
Reviewed-by: Scott Lee <ddoman@chromium.org>
Reviewed-by: Andy Perelson <ajp@google.com>
Commit-Queue: Alex Gough <ajgo@chromium.org>
1 week ago
Jordan ee429f3694 updating license id for colorama
Bug: b/358504615
Change-Id: Ia5ba1c40f220bb3a7b4f927cd871de9186f31052
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6277978
Auto-Submit: Jordan Brown <rop@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Jordan Brown <rop@google.com>
1 week ago
Chan Li e69b086c0f [depot_tools] Roll led
To release https://crrev.com/c/6268756

Bug:  b/40183006
Change-Id: I78cf7ee95c7ac212f4a80c5994aa22bfb56d3b0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6279569
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Chan Li <chanli@chromium.org>
1 week ago
Gavin Mak 9f715f8017 Revert "Add AffectedFile.Extension() in presubmit_support"
This reverts commit d447f41294.

Reason for revert: "AttributeError: 'str' object has no attribute 'Extension'"

Original change's description:
> Add AffectedFile.Extension() in presubmit_support
>
> Add convenience method AffectedFile.Extension() for extracting file
> extension in a standard way. Add a test for this new functionality.
> Add a similar test for AffectedFile.UnixLocalPath().
>
> Bug: None
> Change-Id: If591e751fb2e4fb5355ad0b6f93f310667849d68
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6273341
> Commit-Queue: Anton Bershanskyi <bershanskyi@gmail.com>
> Reviewed-by: Dirk Pranke <dpranke@google.com>
> Reviewed-by: Gavin Mak <gavinmak@google.com>

Bug: None
Change-Id: Ic51b0942e3a3267194fb73af5e92c902b2098c4c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6279837
Auto-Submit: Gavin Mak <gavinmak@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
1 week ago
Anton Bershanskyi d447f41294 Add AffectedFile.Extension() in presubmit_support
Add convenience method AffectedFile.Extension() for extracting file
extension in a standard way. Add a test for this new functionality.
Add a similar test for AffectedFile.UnixLocalPath().

Bug: None
Change-Id: If591e751fb2e4fb5355ad0b6f93f310667849d68
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6273341
Commit-Queue: Anton Bershanskyi <bershanskyi@gmail.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
1 week ago
Josip Sokcevic 0a3addbf63 [docs] Update readme with instructions for auto deployment
Bug: 396679832
Change-Id: Ic471c93b6aa9da64e3e43228bf5077c3e655c294
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6276740
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
1 week ago
Andrew Grieve 3b16d50864 android_build_server_helper.py: Do not start server when stdout is a pipe
E.g. "autoninja > foo" would result in a file called "pipe:[394765110]"
being created.

Companion change: https://chromium-review.googlesource.com/c/chromium/src/+/6236987

Bug: None
Change-Id: Idbbee3eab136cb88f9658e033ac02bd90feee34d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6278629
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Mohamed Heikal <mheikal@chromium.org>
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
1 week ago
Anne Redulla 213348885f [win-bootstrap] Update depot_tools_tutorial to install Git for Windows
Bug: b/360206460
Change-Id: I7f92312d7160c7406ad48bd506eab00636da986f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6278219
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Anne Redulla <aredulla@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
1 week ago
Fumitoshi Ukai 6cf251b517 autoninja: fix UnboundLocalError
Change-Id: Iff96b697b3c1f1d88c13d099ffec4c4159e002bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6276006
Auto-Submit: Fumitoshi Ukai <ukai@google.com>
Commit-Queue: Fumitoshi Ukai <ukai@google.com>
Reviewed-by: Matt Stark <msta@google.com>
2 weeks ago
Fumitoshi Ukai 7a0dbd2074 autoninja: set RBE_remote_disabled when offline even with siso
Bug: 396724264
Change-Id: Id92e8d532e571420ff64be3da207ffd51fd282e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6272278
Commit-Queue: Junji Watanabe <jwata@google.com>
Auto-Submit: Fumitoshi Ukai <ukai@google.com>
Reviewed-by: Junji Watanabe <jwata@google.com>
2 weeks ago
Josip Sokcevic 858ffc1da7 docs: Regenerate docs
Bug: 396174247
Change-Id: I79dba88457dc61c4e2a48d424b5520bab46bc1a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6266868
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
2 weeks ago
Devon Loehr 65aa0a04ff Use hashlib for truly deterministic hashes
It turns out python's built-in hash function uses a random seed
that changes per-process, so branch names based on that hash
aren't actually deterministic. This changes the hashing algorithm
to use a stable hash so we can get consistent results.

Bug: 389069356
Change-Id: I1d3241b922005a7bff4d8621dc79dc4551bf264e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6258544
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Devon Loehr <dloehr@google.com>
2 weeks ago
Josip Sokcevic ed3da5161f docs: Hide python warnings when generating docs
Those warnings end up going into man pages, which is not desired. The
warning says that pipes are deprecated, and will be removed in py3.13.

R=yiwzhang@google.com

Bug: 396174247
Change-Id: Ieb7f36de944e8b7b5e68f78c87a61b04e663f9d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6268243
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 weeks ago
Devon Loehr f7e85d3470 Remove redundant try/catch for better error reporting
During testing, I discovered that the try/catch block surrounding
most of SplitCl is broken: subprocess errors seem to return bytes
more often than strings. When I fixed that, however, I found that
the errors were much more comprehensible if we simply re-raised
the initial error and got all the information it contained; this
both gives us a stack trace and makes it very obvious an error
occurred.

Specifically, we also had the problem that stderr was sometimes
empty even if the process failed (because it wrote to stdout instead),
and if we just wrote the output then it wasn't clear that an error
happened until you actually read the output, as opposed to the
exception printing where the stack trace makes it obvious.

Since re-raising without additional work is pointless, I just removed
the block entirely.

Bug: 389069356
Change-Id: I1d1bec765469d0b70b463f7214f47a25316a37c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6258516
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Devon Loehr <dloehr@google.com>
2 weeks ago
Josip Sokcevic d49a21c533 docs: Fix make_docs
Bug: 396174247
Change-Id: I5888d14bec33e0484651b0b778666c15b05797ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6266867
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
2 weeks ago
Lei Zhang 664154a905 ninja: Improve depot_tools directory detection
Tweak the code in ninja.py so it would only skip directories in $PATH
that are named "depot_tools". The existing detection logic skips
"foo_depot_tools". Also rename functions in the file to follow Python
Style and auto-format the file.

Change-Id: I631958768168f0d673b824c8e14783d2c6f65563
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6259139
Reviewed-by: Junji Watanabe <jwata@google.com>
Commit-Queue: Lei Zhang <thestig@chromium.org>
2 weeks ago
Mason Freed 2451ee476d Reland: add a `--no-squash` argument to `git rebase-update`
See crbug.com/40264739 for many more details. But a prior attempt
to land this patch resulted in [1] which simply removed all
squashing behavior from `git rebase-update`. That broke several
people's workflows. So this patch attempts, again, to simply
add an opt-in to *not* squashing, for the folks (like me) who
do not want that behavior.

[1] https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6104282

Fixed: 40264739
Change-Id: I4a6aa8e53e854a7e601a0fb83f4f9fcb638d36ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6254099
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Mason Freed <masonf@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Mason Freed <masonf@chromium.org>
2 weeks ago
recipe-roller 39f24ab04b Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8723099295754036657

recipe_engine:
6017fe4b11
  6017fe4 (iannucci@chromium.org)
      [tests] Add explicit api with docs && example for recipe test_d...

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=iannucci@chromium.org

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I3caf783852557fcafbf0a0e08d281c546b93a398
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6258679
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2 weeks ago
recipe-roller 0856363220 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8723100554032821185

recipe_engine:
1b1c7d987d
  1b1c7d9 (iannucci@chromium.org)
      [findings] Make gzip blob deterministic across platforms.

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=iannucci@chromium.org

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: If2e97415db0812fb4004d1f6dfddd4019080ae20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6257640
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2 weeks ago
Gavin Mak 4734cfabf4 Fix roll_dep_test.py
4 tests consistently error with "FileNotFoundError". Ensure that both
DEPS and gclient config use the same "file://" URI format so gclient
recognizes the repo as identical and doesn't move src/ to _bad_scm/.

Bug: 391455129
Change-Id: I507750754adc5e83b8a8ce853013a20f60102096
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6259135
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
2 weeks ago
Mason Freed a155deff42 Revert "Remove "attempt to squash" behavior from `git rebase-update`"
This reverts commit 58625e82c6.

Reason for revert: Several comments on crbug.com/40264739 that this broke their workflow. I plan to revert this and put patchset #2 back up for review, with an opt-in instead of a change to the default behavior.

Original change's description:
> Remove "attempt to squash" behavior from `git rebase-update`
>
> In common workflows, this step only succeeds ~5% of the time, and
> in the other 95% of cases, simply adds ~30 seconds of wasted time
> to the execution time of `rebase-update`. Therefore, this CL removes
> the automated functionality, and leaves squashing as a manual option
> to the user.
>
> Fixed: 40264739
> Bug: 40390274
> Change-Id: Ib2a3ffe4b0e5d0b74323a2a0d34ab0e1b7fafb08
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6104282
> Auto-Submit: Mason Freed <masonf@chromium.org>
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>

Bug: 40390274
Change-Id: I91210a5a21b3751695553433389f346ba443bb1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6254237
Auto-Submit: Mason Freed <masonf@chromium.org>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
2 weeks ago
Devon Loehr 0822fcc141 `git cl split`: Save and load splittings from files
This CL implements the proposal (from the design doc in the cited bug)
to allow `git cl split` to save the generated splitting to a
human-readable and editable text file. This allows users to save the
splitting in case something goes wrong and they need to retry, and also
lets them tweak a generated splitting if they get something mostly, but
not quite, usable.

It also allows users to edit the generated splitting interactively, like
they do for e.g. CL descriptions during `git cl upload`.

Bug: 389069356
Change-Id: I8ae21f2eb7c022ba181ae5af273ce09605b5acec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6235727
Commit-Queue: Devon Loehr <dloehr@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 weeks ago
Anne Redulla 7c4bd3f94e [win-bootstrap] Update the comments in update_depot_tools.bat
Also adds an echo to win_tools.bat so a user will know when the
bootstrapping script is skipped after a CIPD install error.
This should hopefully help when troubleshooting.

Bug: b/360206460
Change-Id: Ic8bfcbddfe4681a7716ca9f3793d045e0de704cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6242904
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Anne Redulla <aredulla@google.com>
3 weeks ago
Fumitoshi Ukai a5519ca872 post_build_ninja_summary: run siso.py instead of siso command
Passing args via siso.bat is problematic.
Invoke 'python3 siso.py' instead.

Bug: 323780528
Change-Id: I991aeab375068d790f9e1f9fd264db9c1003f9dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6247814
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Auto-Submit: Fumitoshi Ukai <ukai@google.com>
Commit-Queue: Fumitoshi Ukai <ukai@google.com>
3 weeks ago