Commit Graph

10722 Commits (452fe3be37f78fbecefa1b4b0d359531bcd70d0d)
 

Author SHA1 Message Date
recipe-roller 452fe3be37 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/8743348975542665361

recipe_engine:
6a3d50950c
  6a3d509 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from 9ce18dfea456 to c9c95dda5f31

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: I446f30dbcad8b30a6ab2bdfa130141233c51e530
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5677489
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
Junji Watanabe c117716649 ninjalog_uploader: Handles urllib.error.HTTPError
Bug: 350886098
Change-Id: I5d25c2b979da103b8ab6e61742d5a8da0c07b19d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5675205
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
Commit-Queue: Junji Watanabe <jwata@google.com>
Auto-Submit: Junji Watanabe <jwata@google.com>
10 months ago
Allen Li 21b86f4b1c [gerrit_util] Fix typo
Bug: b/351039944
Change-Id: If906ddfdae10b6ba9051eced2b1e7a2c24d54aad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5677486
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Allen Li <ayatane@chromium.org>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Allen Li 3c93933ce9 [gerrit_util] Add note about workaround
Bug: b/349433100
Change-Id: I287499a339e1f5d3eab9c5a63068ad68ecd67a11
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5677617
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li 41c749b26d [git_cl] Use named fields for URL manipulation
Change-Id: I575b91f6b6e28ac58160e3c0fc59398df222b150
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5677608
Auto-Submit: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Camillo Bruni 9578d67d34 Add fetch config for web-workload
https://chromium-workloads.web.app/ uses DEPS to pull in benchmark
sources from chromium.googlesource.com repositorys.
Adding a fetch config simplifies local setup.

Change-Id: Ibc5f08f61deb4bb0f6a0daec29e9d7cce1e12173
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5664756
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
10 months ago
Allen Li ca091f0d16 [gerrit_util] Update docstring for new param
Change-Id: Ifb6106ad0063183ee0a0377bb3564c4fc99d88ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5673779
Auto-Submit: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Fumitoshi Ukai d7d8221581 gn_helper: ignore spaces on gn lines
Change-Id: I2f676411a5282c938fc1d095acbbde0bbe6efde3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5668281
Commit-Queue: Junji Watanabe <jwata@google.com>
Auto-Submit: Fumitoshi Ukai <ukai@google.com>
Reviewed-by: Junji Watanabe <jwata@google.com>
Commit-Queue: Fumitoshi Ukai <ukai@google.com>
10 months ago
Patrick Monette 367c6f720d Add git squash-branch-tree
This script allows squashing a branch and all of its downstream
branches in one command.

This is useful for squashing stacked branches that have a lot of
commits each just before using `git rebase-update`, as this is
highly likely to run into a lot of rebase conflicts, repeatedly.

This should only be used if the user is okay with losing their
git commit history.

Change-Id: Id28a941d898def73f785d791499c7ee0784e0136
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5659262
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Patrick Monette <pmonette@chromium.org>
10 months ago
Chan Li 5ab4dcc7bf [depot_tools] roll led
To release https://crrev.com/c/5665014

Bug: 324312802
Change-Id: Id39cd950903006eaa5abb616de6aa9ee0395bf66
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5665740
Commit-Queue: Chan Li <chanli@chromium.org>
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
10 months ago
recipe-roller c3f37c111e 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/8743600633358615201

recipe_engine:
1ae58daf64
  1ae58da (mohrr@google.com)
      [path] Remove api.path.eq()

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: I07c035af56212cd428d290beab6698845ab15dc5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5670822
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
Allen Li 6a00e594c9 [gerrit_util] Configure new auth automatically
Because running git cl creds-check in every single repo is poor UX for
early dogfooders.

Bug: b/348024314
Change-Id: Ib5641418de7fa5a55a7f67b7069e63c04403852a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5660338
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li ea366e35f0 [gerrit_util] Use shared SSO logic for SSOAuthenticator
Bug: b/348024314
Change-Id: I1bc9aa297360421fad3fd11b157be3c439f944c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5665454
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Gavin Mak ea802a77b7 Don't show ".gitcookies have credentials" if no creds
Running `git cl creds-check` without any credentials will show:

```
Your .gitcookies have credentials for these hosts:
No Git/Gerrit credentials found
```

The first line of the output should not assume that there are hosts. Don't show this line if credentials are not found.

Change-Id: Ie6eba3518f4b270eef5fbe0c51b4494762a3aef4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5663779
Reviewed-by: Scott Lee <ddoman@chromium.org>
Auto-Submit: Gavin Mak <gavinmak@google.com>
Commit-Queue: Scott Lee <ddoman@chromium.org>
10 months ago
Gavin Mak 280b823136 Link to the new password URL when authentication fails
Instead of just telling users their credentials are missing, link them to the new password URL so they can fix it.

Change-Id: I9559868ae948e6d18cef1205083aee0ad5c2489a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5665862
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Auto-Submit: Gavin Mak <gavinmak@google.com>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
10 months ago
Allen Li 99548b292d [gerrit_util] Fix URLs and hosts in ConfigureGitRepoAuth
Basically there are lots of different formats for everything and
certain things need things in different formats.

Credential helper needs whatever remote the user has configured (which
may or may not have `-review`).

Checking ShouldUseSSO needs the Gerrit host with `-review`.

SSO URL needs the short name (not FQDN), and without `-review`.  I
think.

Anyway, this should work now.  Probably.

Bug: b/348024314
Change-Id: I495686ecfff43c61fe78d72ccd485bc93388e036
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5662256
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Joanna Wang 96b30594ce Skip run() for GCS/CIPD dependencies during runhooks and revinfo.
Bug: 349643421
Change-Id: Ia01e99edf25830e4b2e2038f4a6a0b6b1802f022
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5659261
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
10 months ago
Fumitoshi Ukai 356ef0324e ninja: error if trying to build for use_remoteexec=true
Change-Id: Ia32dd3cba1d1874401c6614f792f212b2cfa60a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5660200
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Junji Watanabe <jwata@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Auto-Submit: Fumitoshi Ukai <ukai@google.com>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
10 months ago
Allen Li f4e8e13e8b [gerrit_util] Add linked account detection for SSO
Bug: b/348024314
Change-Id: Ic982de2892769870805407c6a00856943133dd62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5651293
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
recipe-roller 62b6af34ff 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/8744027194984575153

recipe_engine:
9bb9bf275f
  9bb9bf2 (zijiehe@google.com)
      [exception-db] Include inv_extended_properties_dir in rdb

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: I1bc9bb4201a5c687ac2a43b7ab8d0e1bf211a033
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5660888
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 459e1a54a5 [gerrit_util] Add ChainedAuthenticator
Because we need to dynamically determine whether to use SSO.

Bug: b/348024314
Change-Id: I5ac768f1e0c20254b4cfd4815270ee4e2b9a5544
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5660884
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
10 months ago
Allen Li 9f0e78e146 [git_cl] Append extra credential helper option
Bug: b/348024314
Change-Id: Ic7e1682812edcac878565bd79f002b40c018d95c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5655833
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Allen Li 4f1cfb994f [scm] Add append to SetConfig
Bug: b/348024314
Change-Id: Ib2066594806ffdf5f6941468e91a9ad7b8a02bef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5655832
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Allen Li 7a9bffe87f [scm] Sort SetConfig keyword arguments
Bug: b/348024314
Change-Id: I84cc44b41fbfd90f7b6bd58b6128bc82a1706322
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5655831
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
10 months ago
Peter Birk Pakkenberg 6eeb55de17 Add --tree option to rebase-update.
I often find myself working on stacked changes, and this option will
make it easier to integrate changes into downstream CLs.

With `git rebase-update --current --tree --no-fetch`, it is possible
to only rebase the current chain of changes, without touching any other
local branches that may exist.
This is beneficial both for speed, and to avoid having to resolve merge
conflicts on branches unrelated to the changes you are currently working
on.

Change-Id: I2d3853ad5aad6c74db0ae26ff8d27d14dcaed3e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5546383
Auto-Submit: Peter Pakkenberg <pbirk@chromium.org>
Commit-Queue: Scott Lee <ddoman@chromium.org>
Reviewed-by: Scott Lee <ddoman@chromium.org>
10 months ago
Yiwei Zhang e6f497f72b gclient: resolve symlink in gclient_entries before checking with current path
This allows repo to be symlinked in the workspace and gclient config is
pointing to the symlink. For example, if repo is checked out at
`${WS}/chromium`, a symlink is created from `${WS}/src` and ${WS}/.gclient 
is pointing to `${WS}/src`, when the code is trying to determine the
gclient root with cwd=`${WS}/chromium/XXX/XXX`, the code won't treat ${WS}
as the workspace root. Because .gclient_entries all started with `src/`
and `${WS}/chromium/XXX/XXX` won't match anything in .gclient_entries.

The fix here is to calculate the realpath (i.e. resolving the symlink)
for all paths in .gclient_entries and path_to_check before comparison.

Change-Id: I914ba5a7131588fa99d6900ada954f3694dda197
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5656593
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
10 months ago
Jordan 7e547050e8 Updating Revision presubmit to check for valid commit hash
Bug:b/349274008
Change-Id: I6ce8f1993bcf78514111d709b69b109e481d18b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5652700
Reviewed-by: Jiewei Qian <qjw@chromium.org>
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
10 months ago
recipe-roller bdcdd7c228 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/8744103321749953329

recipe_engine:
37f8ad4242
  37f8ad4 (gbeaty@chromium.org)
      Allow recipes to import the typing module.

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: I10716afee707cd5a43cd26fda6643ccd6e72b1e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5657730
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 0d470211d6 [git_cl] Move new auth handling up in creds-check
The CookiesAuthenticator is mutually exclusive with new auth.

Bug: b/348024314
Change-Id: I70f2e1976b54572c330fcc8acff30e8448e540ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5651990
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li cb5a8a3315 [git_cl] Fix ShouldUseSSO call
(This did not error since this code path is unreachable, to be fixed
in future CL)

Bug: b/348024314
Change-Id: I115b36a828d5e525c54cebdbec5480514e395da7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5651989
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
recipe-roller 0525d8afa7 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/8744139811402458369

recipe_engine:
5563d3930b
  5563d39 (nqmtuan@google.com)
      [Recipe-py] Regenerate protos

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: Ie132627ed7e7523ef38003234196a9dc3eac580a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5655370
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
Yiwei Zhang 89bb8601f8 roll lucicfg to v1.43.8
To pick up https://crrev.com/c/5651267

Change-Id: I2aa890158c3b5a6db867e01b55fc9f64f49a3ab1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5653561
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Scott Lee <ddoman@chromium.org>
Reviewed-by: Scott Lee <ddoman@chromium.org>
10 months ago
Camillo Bruni f1c7c96958 Add crossbench fetch config
Change-Id: I0ea9d4543e5ace42ee4d42a8ac49d7c77db27d90
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5648655
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Alexander Schulze <alexschulze@chromium.org>
10 months ago
Allen Li 334a3acddb [gerrit_util] Fix typo
Bug: b/348024314
Change-Id: I6419ad006535d2763b190d2e4f354816e3fd1c8f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5651991
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
10 months ago
Robert Iannucci 821e028ffd [git_cl] Add missing_ok to SetConfig
Split from https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5648617

Change-Id: Id33b509937c4eb9a95f5f603593a79a1c5a3c109
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5651982
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li 24e9380bc5 [gerrit_util] Add explicit authenticator param
We need this to figure out which authenticator to use, so we need to
override the initial "bootstrap" authenticator.

Bug: b/348024314
Change-Id: I52c5b1db83bc4e2a0a1ec2a07155d352b593cde4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5651288
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
Allen Li 3a5d348a0b [gerrit_util] Add ShouldUseSSO helper
Bug: b/348024314
Change-Id: I5b061bc6afeffbc84aee12250732e96a0ad0f32b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5651287
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
10 months ago
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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 months ago