We need to be able to do this from different dirs later.
Bug: b/351071334
Change-Id: I18dd2c71ea52d79a56ccaee88a12be97465b9d2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5723089
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
If git config set is executed, it writes the new content into
a temp file (but called lock-file) and then replace .gitconfig
with it.
However, if it cannot create the lock file, it returns an error.
With this CL, if git config fails with the lock file error,
depot_tools will retry it at most 5 times with 0.2s interval.
It's found that there are applications, such as vscode extensions,
executes `git config set` frequently, and those could often cause
unexpected interruptions to ongoing `git rebase-updates`
by the lock failure.
Bug: 351950514
Change-Id: I985af0d8b7458dbf47cd6baa857dc5adccf15031
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5705561
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Scott Lee <ddoman@chromium.org>
Makes __init__ a bit cleaner, and planning to make _shortname a
property also next, since it can be derived from _remote_url
Bug: b/351071334
Change-Id: I12f4363723172a9cdaba37f6beb8fa37bbf09d72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5718639
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Previously little bits of the scm.GIT were mocked (like SetConfig,
and GetConfig, but not the other config related methods).
This changes things so that the git config state is a class whose
logic is shared between prod and test, with a 'real' and 'test'
implementation which know how to load and save configuration at
a low level.
R=yiwzhang
Change-Id: I1dc11b550908862607ea539de7fa60fbce30e700
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5660891
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Allen Li <ayatane@chromium.org>
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
bot_update sets disk usage before checkout in step_text.
This CL adds disk usage after checkout in step_text.
Bug: 351868766
Change-Id: I2d99c8a3e0bd8829df30d349789ac8be7086ccf4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5717616
Auto-Submit: Fumitoshi Ukai <ukai@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
This reverts commit 1c0a575c4c.
Reason for revert: Suspected of causing infra failures on
bots like https://ci.chromium.org/ui/p/dawn/builders/try/cmake-linux-clang-dbg-x64/b8742144151501823569/infra.
Long-term should be fixed by removing the invalid configs,
but need to prevent these infra failures for now.
Original change's description:
> Add a recipe property to override bot_update's STALE_PROCESS_DURATION.
>
> Bug: 353444802
> Change-Id: I8d174e28fbbd552be591c8a4c1308a29de47d0b6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5713191
> Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
> Commit-Queue: Brian Ryner <bryner@google.com>
Bug: 353444802
Change-Id: I0a109304c6de16f96ceff7ca1e64e3cd10d6cf4a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5718634
Auto-Submit: Brian Sheedy <bsheedy@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Brian Ryner <bryner@google.com>
9eac71489c0776ea43565f9692c96312b2fc1676 3pp: limit the concurrency for compiling pyc to 4
1fadd9de253d2c327a8be880072b80979abe9ae8 cipkg: add support for more cipd package properties
Change-Id: I83bc0ee8a70eba1c4d1ea75e8218369b86418388
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5711210
Commit-Queue: Chenlin Fan <fancl@chromium.org>
Reviewed-by: Brian Ryner <bryner@google.com>
Gated this behind new auth flag explicitly being set (so people who
haven't set anything = default off don't run this, just in case)
Bug: b/351024645
Change-Id: I8498b98404ad89d3ca390d3baa798daee0b4b53b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5698379
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
This feels like bikeshedding, but semantically, we are applying the
changes to a specific repo, and you could take one
GitAuthConfigChanger and apply it to multiple different repos.
(The config host, etc. are usually tied to a specific repo, so there
needs to be some further refactoring to make this actually decoupled
from the working directory, but keeping this small for sane code
review)
Bug: b/351071334
Change-Id: I756f1134be516e19e26e35ffca7f7ceb389aaa30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5699189
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Note that this logic still isn't run yet, because we only call
ConfigureGitRepoAuth behind new auth flag checks.
Bug: b/351024645
Change-Id: Idca4d1ce3ebd3f2c673f244f85b3cae6da39f8e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5699188
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
This should help give additional confidence while refactoring in
gerrit_util.
R=ayatane, yiwzhang
Change-Id: I03927e072e62f6109571ab699f90db7c51ccc6c0
Bug: b/335483238
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5665455
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
With this CL, build time of chrome with non-cache hit case improved a
bit on P620 Linux workstation.
```
Benchmark 1: RBE_local_resource_fraction=0.4 RBE_racing_bias=0.7 RBE_remote_accept_cache=false autoninja -C out/Default chrome
Time (mean ± σ): 337.697 s ± 11.439 s [User: 3086.301 s, System: 1362.952 s]
Range (min … max): 327.732 s … 351.680 s 5 runs
```
```
Benchmark 1: RBE_remote_accept_cache=false autoninja -C out/Default chrome
Time (mean ± σ): 347.795 s ± 15.906 s [User: 2764.181 s, System: 1199.244 s]
Range (min … max): 331.964 s … 367.898 s 5 runs
```
Bug: 352463976
Change-Id: Ic9732583857ce175888a7ec65cf9e323529f0a07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5693250
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Junji Watanabe <jwata@google.com>
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Can be used to remove config changes. Not called yet.
There's some logic duplication, will try to clean up later.
Bug: b/351024645
Change-Id: Ibdda4b93e600efc4b84240374e58478e2cc1501a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5693419
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
I'm planning on adding removal for all of these, so sectioning
everything out.
Change-Id: Ieb4369a267dff323cd644cff00d98761800a8a90
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5691995
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
Potentially makes it easier to test (needs more deps extracted and
injected though).
Change-Id: I3a300264f85f4420d8b41a7cd1155e38341638f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5689683
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
Potentially makes it easier to test (needs more deps extracted and
injected though).
Change-Id: I8c551b39c97ec95291995e614c760073b10a4615
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5689682
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
NoReturn applies to functions that never return. Doesn't make sense
to return None or NoReturn.
Change-Id: I1f1a759999a8dad1c2b2a7fd9623e3ea5216c726
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5688607
Auto-Submit: Allen Li <ayatane@chromium.org>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
This permit downstream clients to retrieve the "source" text and do
their own formatting instead of relying on the format coded in
get_message().
Change-Id: Ia36cbd064ed0781bda76b09b064b97f6dc5e899e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5686730
Commit-Queue: Jiewei Qian <qjw@chromium.org>
Reviewed-by: Anne Redulla <aredulla@google.com>
Scopes needs to be passed as a single CLI argument
Bug: b/351046856
Change-Id: I1c0e78b9bfa9997af3466f5b54ae27a535fa7488
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5689095
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Allen Li <ayatane@chromium.org>
This will replace the user consent logics in ninjalog_uploader_wrapper.py and reclient_metrics.py
See also https://crrev.com/c/5669094 for how this will be used.
Bug: 345113094
Change-Id: Iffc4975c152ba63f7577c09e5254c499fe8973c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5671052
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
Auto-Submit: Junji Watanabe <jwata@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>