Commit Graph

10685 Commits (8ac3425344e1e0713daafde92fdf15b7ad5ee390)
 

Author SHA1 Message Date
Gavin Mak 8ac3425344 Create scm.DIFF.GetAllFiles
For a ProvidedDiffChange, the AllFiles method naively returns all files
with rglob("*"). The returned list includes files in nested submodules.
This does not match the behavior of GitChange's AllFiles which uses
git ls-files to find all files.

Implement a new SCM that stops iterating recursively when it
sees a submodule from .gitmodules in the repo root.

Bug: b/323243527
Change-Id: I170d0f1bc4a838acea04779dee3df7fca0bce359
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5648616
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
10 months ago
Allen Li 6359e82d13 [git_cl] Add new auth support for creds check
Bug: b/348024314
Change-Id: I157380b19121a9fbcee2a1a13447df9c03f7bccc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5646659
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li bb38aa2f8e [gerrit_util] Use SSO only if configured with appropriate email
So you can use chromium.org or other accounts in some repos

Bug: b/348024314
Change-Id: Ice6b6d9e6e827a606a2ce7f3b127d4660df1aedf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5641255
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Robert Iannucci 005e60ceda [git_cl] Make EnsureCanUploadPatchset work for all auth methods.
Previously EnsureCanUploadPatchset only had a working implementation
for the CookiesAuthenticator, relying on being able to parse the
user name out of the .gitcookies file.

Additionally, the previous implementation assumed that you would
always authenticate as your primary Gerrit account OR you had
a matching `user.email` gitconfig entry, even though neither of these
is a strict requirement for the upload to work.

The new implementation still short-circuits if issue_owner matches
the configured user.email, but other than this it just asks Gerrit
what the full list of linked emails is for the currently authenticated
account.

The new approach is not only correct, but will now work for all auth
schemes in exactly the same way.

When the accounts do mismatch, you will now see output like:

```
WARNING: Change 5590262 is owned by iannucci@chromium.org, but Gerrit knows you as:
  * user@example.org
  * other.user@example.com
  * primary@real.example.com (preferred)
Uploading may fail due to lack of permissions.
```

R=ayatane@chromium.org, yiwzhang@google.com

Bug: 336351842
Change-Id: I89c1b121c9110e00d1348884aaf025fc783542d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5590262
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
10 months ago
recipe-roller 88b222ccdf 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/8744220970510326561

recipe_engine:
f91bc37aab
  f91bc37 (kimstephanie@google.com)
      Roll test_variants.proto

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: Iead1edde69a0125114f8d41636c0adffa7252806
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5651516
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>
10 months ago
recipe-roller 3e9c527581 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/8744226632651760465

recipe_engine:
659f41cff9
  659f41c (mohrr@google.com)
      recipe.warnings: Push back checkout_dir deprecation

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: I5fbb9d525d6f1c511893e5b371d7fa8bf9cd7298
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5647021
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>
10 months ago
mlcui 6592795601 gerrit_util: Fix NameError in GceAuthenticator._get
Bug: None
Change-Id: I6a6a210069da0f77ebbed4c6ef530864cb2d8109
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5644850
Reviewed-by: Gavin Mak <gavinmak@google.com>
Auto-Submit: Michael Cui <mlcui@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
10 months ago
Robert Iannucci 6daca50597 [git_cl] Refactor EnsureAuthenticated logic.
This will allow us to implement EnsureAuthenticated for other
Authenticator implementations.

R=ayatane@chromium.org

Bug: 336351842
Change-Id: I5ff4efd45eb5baa6baa048842510ec6e18e1b8fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5588510
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Scott Lee <ddoman@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
10 months ago
Robert Iannucci 137bb69871 [gerrit_util] Cache resolved Authenticator as a class variable.
I noticed that the Authenticator is resolved maybe 5 or 6 times per
git-cl invocation. This should lead to more consistent behavior and
will likely be a bit faster, especially for SSOAuthenticator and
LuciAuthAuthenticator which involve subprocess invocations.

R=ayatane@chromium.org

Bug: 336351842
Change-Id: Id6c2873a6960a171305560acb98afe2c4f397295
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5589865
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
10 months ago
Allen Li bdf64705c3 [gerrit_util] Factor out SSOHelper
Add a layer of abstraction/isolation for general organization.

Also, this logic needs to be used in Git setup too, not just Gerrit
authentication.

Bug: b/348024314
Change-Id: Ie1310a9b8e71c05c72a4b987dcbff76b70c67945
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5645906
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Robert Iannucci c4c3d5326e [gerrit_util] Add some additional tests and fixes for SSOAuthenticator.
Unfortunately, the depot_tools presubmit builders are incredibly slow
which make the subprocess based tests fail flakily. I've marked them
all as `skip` with an optional way to run them locally.

R=ayatane, yiwzhang

Bug: b/335483238
Change-Id: I407aed3a1ed01563a0a80973b679aca405b9cde9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5641259
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Gavin Mak 47a841a204 Handle empty diff in _diffs_to_change_files
An valid empty diff can be passed into _diffs_to_change_files if the
modified file's contents is same as upstream. In this case,
_diffs_to_change_files gets an IndexError.

Bug: b/336555565
Change-Id: I848e6016a1e8089473ff8a72d2e0142fbabfda9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5635166
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
10 months ago
recipe-roller 6cc020f612 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/8744498424735586417

recipe_engine:
f3a3b6e2d0
  f3a3b6e (gbeaty@chromium.org)
      Prevent joining paths with None.

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: Ide40593fa3ca63bd8e10055d8e15acc7bfbb93c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5648795
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
10 months ago
Allen Li 06673958a3 [git_cl] Fix comment about GetCodereviewServer
Previous comment was... lacking.  Actually, wrong.  It's doing the
exact opposite of lazy loading.  Maybe they were trying to use AI code
gen before it existed?

Bug: b/348024314
Change-Id: I068d43fe1abf757cb8b109890a14ca0cefe3fec0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5641090
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Allen Li 39e7285c30 [scm] Fix docstring reference to `modify_all`
Bug: b/348024314
Change-Id: Ic5609fe286e8c016862aa38dbb0f17c9b52e7941
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5641260
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li 6355da7032 [git_common] Relocate comment
Change-Id: I489df67dae5607acc4edbb0243b149eae1742733
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5641088
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li 1e4251b6ea [newauth] Accept standard Git bool values
Just some "syntactic" sugar (at the very least we should probably have
used 'true' from the beginning)

https://git-scm.com/docs/git-config#Documentation/git-config.txt-boolean

Bug: b/348024314
Change-Id: I9ec3b12012444662289619ac955885e732945fe2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5641085
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li fa1bba51d7 [gerrit_util] Add newauth.py helper
These checks will be needed in git_cl.py and probably other places.

Make it easy to change the default to opt-in as some point (and for
deletion later).

Bug: b/348024314
Change-Id: I768986e47ec2e86604268d74ca2b632458263bba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5641084
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
10 months ago
Robert Iannucci e5490cc303 [gerrit_util] Fix unstopped mocks.
R=ayatane, yiwzhang

Bug: b/335483238
Change-Id: I9df8c754f25de2ad51cac78eecc2ede08eff5fa1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5646325
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Allen Li <ayatane@chromium.org>
10 months ago
Josip Sokcevic 2517f89cdf Reland "[presubmit checks] Check if files are written to a dep dir"
This is a reland of commit 561772c448

Original change's description:
> [presubmit checks] Check if files are written to a dep dir
>
> No files should be written to a directory that's used by CIPD or GCS, as
> defined in DEPS. Git already doesn't allow files to be written to a
> directory that's a gitlink.
>
> R=jojwang@google.com
>
> Bug: 343199633
> Change-Id: I8d3414eac728580eaf9ac7e337bb22bca3989e4e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5633187
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>

Bug: 343199633
Change-Id: Ifc3f6c4df328cdd215ceb7d0333f68223e9a1ccb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5643922
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
10 months ago
recipe-roller f7d041dbde 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/8744590280712977393

recipe_engine:
c5245039e2
  c524503 (mohrr@google.com)
      [path] Add warning for using api.path.is_parent_of

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: Ica032db3005a848bd6e920e6f643e625423f35e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5643923
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>
10 months ago
Robert Iannucci 6833e00918 [gerrit_util] Revise comments on SSOAuthenticator.
Previous comments on SSOAuthenticator were incorrect (the
git-remote-sso process does NOT need to persist). Remove comments
which were inconsistent with the code, and add an explainer on why
the _launch_sso_helper method is written the way it is.

R=ayatane, yiwzhang

Bug: b/335483238
Change-Id: I6b318ef36d7c4f757cd0b979fdc90c01c7a5b529
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5641089
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
10 months ago
Robert Iannucci 1f4f982beb [git-cl] SSOAuthenticator: Add tests and fix bugs.
Adds a few very basic tests.

Fixes bug where, when using python3.8, the cookie jar would not
correctly parse the cookie file.

R=ayatane

Bug: b/335483238
Change-Id: If44eea00d67cb2716df460ef0af93811e351f764
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5637936
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
10 months ago
Gavin Mak 4d36c419f3 Revert "[presubmit checks] Check if files are written to a dep dir"
This reverts commit 561772c448.

Reason for revert: `KeyError: 'deps'` breaking some builds

Original change's description:
> [presubmit checks] Check if files are written to a dep dir
>
> No files should be written to a directory that's used by CIPD or GCS, as
> defined in DEPS. Git already doesn't allow files to be written to a
> directory that's a gitlink.
>
> R=jojwang@google.com
>
> Bug: 343199633
> Change-Id: I8d3414eac728580eaf9ac7e337bb22bca3989e4e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5633187
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>

Bug: 343199633
Change-Id: I26b8e72320260e394a72aee1f7e67dfc2b3e2987
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5641258
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>
10 months ago
Allen Li c5a846299d [man] Fix make_docs.sh
Change-Id: I14c51773a86f0dc0b0d185d38908fff0d2afa3d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5641213
Commit-Queue: Gavin Mak <gavinmak@google.com>
Auto-Submit: Allen Li <ayatane@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
10 months ago
Josip Sokcevic 561772c448 [presubmit checks] Check if files are written to a dep dir
No files should be written to a directory that's used by CIPD or GCS, as
defined in DEPS. Git already doesn't allow files to be written to a
directory that's a gitlink.

R=jojwang@google.com

Bug: 343199633
Change-Id: I8d3414eac728580eaf9ac7e337bb22bca3989e4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5633187
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
10 months ago
Yiwei Zhang 66df2a3ec7 git cl upload: introduce commit-description option
This new option allows programatically providing new
description when uploading a new patchset.

Bug: 346174899
Change-Id: I6d7e361b7da0fd06675c04df4fd2f68c7954dd40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5620640
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
10 months ago
recipe-roller 90d00845c5 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/8744874653555770529

recipe_engine:
e22ed0d40a
  e22ed0d (mohrr@google.com)
      [step] Drop _StepPresentationProxy

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: I41b9240debecdacd4fc281c6e255e62e6193fe95
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5635201
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
10 months ago
Takuto Ikuta 1d1f17af89 allow v6 ninja log format
This is for https://crrev.com/c/5632535.
v6 in 1.12.1 is the same format with v5 in 1.11.1 actually.
ref: https://github.com/ninja-build/ninja/pull/2240


Bug: 346910589
Change-Id: Id13fc0945d1d7f80b42b87c37969c01ffa113e24
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5633274
Reviewed-by: Junji Watanabe <jwata@google.com>
Commit-Queue: Junji Watanabe <jwata@google.com>
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
11 months ago
Chenlin Fan cf92f43226 New vpython3 to depot_tools.
599223619b47d2ab7a264d9a74e6d3b337dceffc vpython: use fixed temp root directory if possible
cafab8a47525aa82c5a5e06c2bb9424993f932b0 cipkg: add symlink workarounds on windows
0ec59342a4ce767306827b49ae72d342f84de8f2 cipkg: ensure url generates stable action
5efba5dcb2b41708fc829f5881e916feed68b2f0 [chore] Fix formatting of files.
0fad94fa6aad15821c7ec920f00b88c2f4aaf0fb [chore] Fix formatting of files.
b8a75466783276cefb0278329401549031eb6dd9 cipkg: allow n:1 mapping from package to derivation

Bug:341097070
Change-Id: Ib9a16e43e1f8f85e4f8a439699c12f9a10ca4d42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5632854
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Chenlin Fan <fancl@chromium.org>
11 months ago
Aleksey Khoroshilov 093f878224 Fix java format with --diff passed
Accidentally removed few parameters in [1].

1. https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5613673

Change-Id: I944370d13d86980a1dabadb8c9eda69d078de0f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5632781
Reviewed-by: Gavin Mak <gavinmak@google.com>
Auto-Submit: Aleksei Khoroshilov <akhoroshilov@brave.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
11 months ago
Allen Li 02b791b756 [cipd] Add git-credential-luci (reland)
This can be used for OAuth to Gerrit (in lieu of gitcookies).

Originally landed
https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5620638

Reverted due to interfering with git fetch

https://ci.chromium.org/ui/p/infra-internal/builders/cron/build%20recipe%20roller/b8745385521046617057/infra

Fixed by excluding git-credential-luci from recipe bundles

Bug: b/335483238
Change-Id: I9a0887b32596be122509de0ec1c238088e73bb49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5627937
Reviewed-by: Scott Lee <ddoman@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
11 months ago
Robert Iannucci 88a72320ed [gerrit_util] Add dogfoodable luci-auth Authenticator (reland)
Inspired by https://chromium-review.googlesource.com/c/5577744.

This implementation allows toggling the entire new-auth-stack with
the git configuration:

    [depot-tools]
        useNewAuthStack = 1

Additionally, you can set:

    [depot-tools]
        newAuthSkipSSO = 1

To intentionally skip SSOAuthenticator for now while doing local
evaluation of these auth methods.

This CL was uploaded without gitcookies using the new luci-auth
Authenticator.

Subsequent CLs will adjust creds-check and EnsureAuthenticated to
work correctly with the new auth stack.

Originally landed in
https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5590324

Reverted because of the preceding CL
https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5586799

Bug: 336351842, 336652327
Change-Id: I72df6689ec1ea5429fecc86e5752366fcda7465a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5627835
Reviewed-by: Scott Lee <ddoman@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
11 months ago
recipe-roller 3e4ab13934 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/8745233267932272961

recipe_engine:
052fd59531
  052fd59 (kimstephanie@google.com)
      Include is_source_spec_final in resultdb/update_invocation call

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: Idfb5550281999e4c1d0f4ea211c99542b4c3c169
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5629956
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>
11 months ago
recipe-roller a50c940573 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/8745249625280868833

recipe_engine:
8cd7399bda
  8cd7399 (mohrr@google.com)
      [buildbucket] Remove set_buildbucket_host() method

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: I399a0729de0f385452b203ef7becbc7be8537196
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5627327
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
11 months ago
Josip Sokcevic 43c6415bce Add a new possible siso path
We are relocating siso binary from third_party/siso/siso to
third_party/siso/cipd/siso to make it compatible with Cog, which
requires cipd packages to be placed in directories with no Git content.

Bug: 346837573
Change-Id: If40e6033e341dcedfee5670f07d68c14bd923f7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5625091
Reviewed-by: Philipp Wollermann <philwo@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
11 months ago
Robert Iannucci 5f585948d4 [gerrit_util] Add opt-in SSOAuthenticator (reland)
This adds a new authenticator implementation to gerrit_util which
uses the Google corp `git-remote-sso` protocol helper to get
secure tunneled access to the internal hosted Google git services.

It is possible to opt in on Google-managed devices by adding the
following git configuration:

    [url "sso://chromium/"]
        insteadOf = https://chromium.googlesource.com/
        insteadOf = http://chromium.googlesource.com/
    [depot-tools]
      useNewAuthStack = 1

This CL was uploaded using the new authenticator with no
.gitcookies file present on disk.

This was originally landed in
https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5586799

It was reverted because it caused the error:

    AttributeError: module 'functools' has no attribute 'cache'

https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8745365240091840049/+/u/Commit_log_for_uploaded_revision/stdout

So we changed functools.cache -> functools.lru_cache

Bug: 336351842
Change-Id: I0dcb04ada8281a60792ae08777b01ecf116f2a8f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5627834
Reviewed-by: Scott Lee <ddoman@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
11 months ago
Yiwei Zhang fdfc24e36a run tests using python 3.8
This is achieved by duplicating vpython spec in tests directory and
changing the python version to 3.8. The reason for this change is that
even though depot_tools support 3.11, the entire infra is still on
3.8 so any new 3.8+ feature used in depot_tools may break infra test and
it has already happened couple of times.

Bug: 346784198
Change-Id: I7dbd0d926da21854abf47af2c2f6edfeec2c5c4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5625090
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
11 months ago
Aleksey Khoroshilov c0883c509e Fix git diff calls when a lot of files modified in a branch
Running a command line longer that 32k on Windows lead to issues (as
usual). We run git diff in multiple scenarios on a list of changed
files. This list is not partitioned and may lead to a command line
much longer than OS can allow.

This change replaces BuildGitDiffCmd with RunGitDiffCmd that splits
the file list internally and runs git diff multiple times if required.

Change-Id: Icfd8efc7520105b8d98125e90bb96c2bb9bd3a0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5613673
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Aleksei Khoroshilov <akhoroshilov@brave.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
11 months ago
Takuto Ikuta e757e08663 Revert "[gerrit_util] Add opt-in SSOAuthenticator."
This reverts commit 02091c6148.

Reason for revert:
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8745365240091840049/+/u/Commit_log_for_uploaded_revision/stdout

Original change's description:
> [gerrit_util] Add opt-in SSOAuthenticator.
>
> This adds a new authenticator implementation to gerrit_util which
> uses the Google corp `git-remote-sso` protocol helper to get
> secure tunneled access to the internal hosted Google git services.
>
> It is possible to opt in on Google-managed devices by adding the
> following git configuration:
>
>     [url "sso://chromium/"]
>         insteadOf = https://chromium.googlesource.com/
>         insteadOf = http://chromium.googlesource.com/
>     [depot-tools]
>       useNewAuthStack = 1
>
> This CL was uploaded using the new authenticator with no
> .gitcookies file present on disk.
>
> R=ayatane@chromium.org, ayatane@google.com, ddoman@chromium.org
>
> Bug: 336351842
> Change-Id: Ia3eccb77ebf1cdc863513ac095bf65ede6adda43
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5586799
> Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
> Commit-Queue: Allen Li <ayatane@chromium.org>
> Reviewed-by: Scott Lee <ddoman@chromium.org>

Bug: 336351842
Change-Id: I412d560955ff78169a83b527d2fe2dd0a2c5d50d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5624014
Owners-Override: Patti Lor <patricialor@chromium.org>
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Patti Lor <patricialor@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
11 months ago
Takuto Ikuta 58cb6562e3 Revert "[gerrit_util] Add dogfoodable luci-auth Authenticator."
This reverts commit f871d80a7e.

Reason for revert:
This is to revert https://crrev.com/c/5624014.

Original change's description:
> [gerrit_util] Add dogfoodable luci-auth Authenticator.
>
> Inspired by https://chromium-review.googlesource.com/c/5577744.
>
> This implementation allows toggling the entire new-auth-stack with
> the git configuration:
>
>     [depot-tools]
>         useNewAuthStack = 1
>
> Additionally, you can set:
>
>     [depot-tools]
>         newAuthSkipSSO = 1
>
> To intentionally skip SSOAuthenticator for now while doing local
> evaluation of these auth methods.
>
> This CL was uploaded without gitcookies using the new luci-auth
> Authenticator.
>
> Subsequent CLs will adjust creds-check and EnsureAuthenticated to
> work correctly with the new auth stack.
>
> R=ayatane@google.com
>
> Bug: 336351842, 336652327
> Change-Id: I0eb6d82ca106ddd114b74f63d8cda4c5a7b70c86
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5590324
> Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
> Reviewed-by: Scott Lee <ddoman@chromium.org>
> Commit-Queue: Allen Li <ayatane@chromium.org>

Bug: 336351842, 336652327
Change-Id: I7c947760a096f48bdac3d640f71e40ad10fe6f3e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5624015
Owners-Override: Patti Lor <patricialor@chromium.org>
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Patti Lor <patricialor@chromium.org>
Reviewed-by: Patti Lor <patricialor@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
11 months ago
Richard Wang 6f180c0a23 Use $HOME/.config/depot_tools on linux for .cfg files
Or $XDG_CONFIG_HOME/.config/depot_tools if set

A followup CL can add support for win/macos.

Bug: b/345092320
Change-Id: I877baa4d7fd912b42cfcd88ad0aa347b700a89f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5604606
Commit-Queue: Richard Wang <richardwa@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
11 months ago
Allen Li 441cd5c465 Revert "[cipd] Add git-credential-luci"
This reverts commit 165fdee7e6.

Reason for revert: broke build

Original change's description:
> [cipd] Add git-credential-luci
>
> This can be used for OAuth to Gerrit (in lieu of gitcookies).
>
> Bug: b/335483238
> Change-Id: Ief933ca0003b9f85e14aad1596b66b134311ea39
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5620638
> Reviewed-by: Scott Lee <ddoman@chromium.org>
> Commit-Queue: Allen Li <ayatane@chromium.org>

Bug: b/335483238
Change-Id: I95bf6d85313e06afcd6045f93898153ef0118b3b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5620639
Owners-Override: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Vadim Shtayura <vadimsh@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Auto-Submit: Allen Li <ayatane@chromium.org>
11 months ago
Ben Pastene fd85601398 git_cl: Remove support for '--clobber' arg
The chromium recipe (and only the chromium recipe?) currently reads this
prop to trigger a clobber build. But support for that in the recipe is
being removed in https://crrev.com/c/5620860. So this removes the
ability to set that arg via `git cl try`. Across all chrome/chromium
builders, that arg was only passed in six builds in the past year. So
it's very unlikely anyone depends on it, or will notice it's gone.

Bug: 346363294
Change-Id: Icf05c9a2fd6f2e9239c735e4c5507aee9a26e0e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5620634
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
11 months ago
Robert Iannucci f871d80a7e [gerrit_util] Add dogfoodable luci-auth Authenticator.
Inspired by https://chromium-review.googlesource.com/c/5577744.

This implementation allows toggling the entire new-auth-stack with
the git configuration:

    [depot-tools]
        useNewAuthStack = 1

Additionally, you can set:

    [depot-tools]
        newAuthSkipSSO = 1

To intentionally skip SSOAuthenticator for now while doing local
evaluation of these auth methods.

This CL was uploaded without gitcookies using the new luci-auth
Authenticator.

Subsequent CLs will adjust creds-check and EnsureAuthenticated to
work correctly with the new auth stack.

R=ayatane@google.com

Bug: 336351842, 336652327
Change-Id: I0eb6d82ca106ddd114b74f63d8cda4c5a7b70c86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5590324
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Scott Lee <ddoman@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
11 months ago
Allen Li 165fdee7e6 [cipd] Add git-credential-luci
This can be used for OAuth to Gerrit (in lieu of gitcookies).

Bug: b/335483238
Change-Id: Ief933ca0003b9f85e14aad1596b66b134311ea39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5620638
Reviewed-by: Scott Lee <ddoman@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
11 months ago
Yiwei Zhang 413b558c6c remove weekly and wtf commands
Those 2 commands have been broken since the introduction of gcs dep as
it tries to run a git command aginst path to a gcs dep. Since nobody
has complained so far, it's safe to assume the command is never used
by anyone today, therefore, it should be safe to delete.

Bug: 345486495
Change-Id: Ia27e5e8486f790234bd66e890e995f1d5c14f9c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5608374
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
11 months ago
Robert Iannucci 02091c6148 [gerrit_util] Add opt-in SSOAuthenticator.
This adds a new authenticator implementation to gerrit_util which
uses the Google corp `git-remote-sso` protocol helper to get
secure tunneled access to the internal hosted Google git services.

It is possible to opt in on Google-managed devices by adding the
following git configuration:

    [url "sso://chromium/"]
        insteadOf = https://chromium.googlesource.com/
        insteadOf = http://chromium.googlesource.com/
    [depot-tools]
      useNewAuthStack = 1

This CL was uploaded using the new authenticator with no
.gitcookies file present on disk.

R=ayatane@chromium.org, ayatane@google.com, ddoman@chromium.org

Bug: 336351842
Change-Id: Ia3eccb77ebf1cdc863513ac095bf65ede6adda43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5586799
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Scott Lee <ddoman@chromium.org>
11 months ago
recipe-roller 5aedf859be 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/8745401249497488129

recipe_engine:
e0c5ee5115
  e0c5ee5 (bpastene@chromium.org)
      Rename path module's cleanup dir from 'recipe_cleanup' to 'rc'

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: I1bffd90fe29425f0785a13b14b26c9b8041697ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5620633
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>
11 months ago
recipe-roller e30d8fac34 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/8745491846482450177

recipe_engine:
76cc89d9b3
  76cc89d (mohrr@google.com)
      [config_types] Remove deprecated Path methods

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: I27c37cf8270f9792a8eb6114c63ae38dd064fefb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5617610
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
11 months ago