master->main branch migration left the cache in some builders to have its HEAD still pointing to refs/heads/master. This causes bot_update to fail. If in this state, delete the cache and force bootstrap.
Bug: 1418866
Change-Id: Id716a013833d459ee37306d27b369099faf846ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4310522
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
This reverts commit 63fea808b0.
Reason for revert: broke bot_update for dart, b/259380822
Original change's description:
> Reset origin/HEAD in git_cache if it points to master
>
> This change resets refs/remotes/origin/HEAD if it points to master. With the master to main migration going on with chromium repositories, some of the cached git repositories end up pointing to master instead of main. This change aids in fixing this issue.
>
> Bug: 1364030
> Change-Id: Ic181b0179daf7b2b842cff7f7187d94d9fb20007
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4029356
> Auto-Submit: Aravind Vasudevan <aravindvasudev@google.com>
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Bug: 1364030
Change-Id: I96842c15eba886f5b95cdd10f323b907d5ea165d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4030304
Reviewed-by: Gavin Mak <gavinmak@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
This change resets refs/remotes/origin/HEAD if it points to master. With the master to main migration going on with chromium repositories, some of the cached git repositories end up pointing to master instead of main. This change aids in fixing this issue.
Bug: 1364030
Change-Id: Ic181b0179daf7b2b842cff7f7187d94d9fb20007
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4029356
Auto-Submit: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
os.remove can't be used to remove non empty directory. Use rmtree from
gclient_utils.
R=jojwang@google.com
Bug: 1372658
Change-Id: I5c08bad9778396cb9b1ec0bebe6287a0f3823fab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3950469
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
When initializing git_cache repository, we can't assume the default
branch is main. This results in HEAD pointing to invalid ref for repos
that don't have main branch.
Instead, fetch information from remote git repository.
R=gavinmak@google.com
Fixed: 1334889
Change-Id: I84e6d8e09c81bdae7e5e31af88973534431824e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3696906
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
This includes a few fixes for specific errors, and disables several new
warnings introduced in this version, in order to allow for an incremental migration.
Bug:1262286
Change-Id: I4b8f8fc521386419a3121bbb07edc8ac83170a94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3413679
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
This reverts commit 22bf605bb6.
Reason for revert: breaks gclient sync
Original change's description:
> Use pylint 2.7 for depot_tools
>
> This includes a few fixes for specific errors, and disables several new
> warnings introduced in this version, in order to allow for an incremental migration.
>
> Bug:1262286
> Change-Id: Ie97d686748c9c952e87718a65f401c5f6f80a5c9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3400616
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Bug: 1262286
Change-Id: Ieb946073c7886c7bf056ce843a5a48e82becf7a5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3413672
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
This includes a few fixes for specific errors, and disables several new
warnings introduced in this version, in order to allow for an incremental migration.
Bug:1262286
Change-Id: Ie97d686748c9c952e87718a65f401c5f6f80a5c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3400616
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
The command is used for verification purposes when git index is fetched
from GS. The output is verbose for chromium/src and not useful at all.
R=gavinmak@google.com
Bug: 1255228
Change-Id: Ie95963a23ef397e9fd6ce7bcf959ec9964d21ba7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3227145
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
This is a reland of d3cfea0c78
Original change's description:
> Limit number of concurrent gsutil cp calls
>
> gsutil utilizes as many cores as possible, and will create many threads
> too. In combination with gclient doing the same thing (utilize as many
> cores as possible), this results in creating way too many processes and
> some builders are running out of resources (e.g. can't create threads).
>
> This limits number of gsutil cp commands in git_cache to two.
>
> R=apolito@google.com, dpranke@google.com
>
> Bug: 1255228, 1249003
> Change-Id: Ifcccaacde6c9e1c60c1da0a0bc5a3e512e158dcc
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3219900
> Reviewed-by: Dirk Pranke <dpranke@google.com>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Bug: 1255228, 1249003
Change-Id: I712bf5f625fd42992e7b5310ae005fad2633e1a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3223155
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
We only build git_cache if main branch exists, and newly boostrap caches
have main as default. This sets HEAD for already boostrapped caches, in
case they were boostrapped before the default branch change.
R=gavinmak@google.com
Bug: 1251783
Change-Id: I715329ee06cf523f9fe2e6a324381dc5703bac34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3218281
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
This reverts commit d3cfea0c78.
Reason for revert: using self.GSUTIL_CP_SEMAPHORE instead of
global GSUTIL_CP_SEMAPHORE
Original change's description:
> Limit number of concurrent gsutil cp calls
>
> gsutil utilizes as many cores as possible, and will create many threads
> too. In combination with gclient doing the same thing (utilize as many
> cores as possible), this results in creating way too many processes and
> some builders are running out of resources (e.g. can't create threads).
>
> This limits number of gsutil cp commands in git_cache to two.
>
> R=apolito@google.com, dpranke@google.com
>
> Bug: 1255228, 1249003
> Change-Id: Ifcccaacde6c9e1c60c1da0a0bc5a3e512e158dcc
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3219900
> Reviewed-by: Dirk Pranke <dpranke@google.com>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Bug: 1255228, 1249003
Change-Id: I0fde2477ea620c683b49efaa2a70262bd8e615e2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3221900
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
gsutil utilizes as many cores as possible, and will create many threads
too. In combination with gclient doing the same thing (utilize as many
cores as possible), this results in creating way too many processes and
some builders are running out of resources (e.g. can't create threads).
This limits number of gsutil cp commands in git_cache to two.
R=apolito@google.com, dpranke@google.com
Bug: 1255228, 1249003
Change-Id: Ifcccaacde6c9e1c60c1da0a0bc5a3e512e158dcc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3219900
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Currently, git cache depends on the global default branch. Set it to
main explicitly instead.
Bug: 3082645, b/195975120
Change-Id: Ia9331d479dbe9547b6913c74bbf86852fff3a596
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3083251
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Anthony Polito <apolito@google.com>
This is a reland of 4c67f856f0
Issues should have been fixed by crrev.com/c/2838026
Original change's description:
> git-cache: Add option to fetch commits.
>
> Add option to git cache to fetch commits.
> And use it in bot_update and gclient sync to make sure
> the needed commits are present on the checkout.
>
> Change-Id: I9e90da9e3be6e7bacf714b22bf0b735463e655b6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2829942
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Change-Id: Ie5a29737f5a75d28bc7c5c2f6cb99ec7f87cd9e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2841046
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This reverts commit 4c67f856f0.
Reason for revert: crbug.com/1200657
Original change's description:
> git-cache: Add option to fetch commits.
>
> Add option to git cache to fetch commits.
> And use it in bot_update and gclient sync to make sure
> the needed commits are present on the checkout.
>
> Change-Id: I9e90da9e3be6e7bacf714b22bf0b735463e655b6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2829942
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Change-Id: I31a1defb26119bcb46894ab4084d626b65c45fed
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2837413
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Add option to git cache to fetch commits.
And use it in bot_update and gclient sync to make sure
the needed commits are present on the checkout.
Change-Id: I9e90da9e3be6e7bacf714b22bf0b735463e655b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2829942
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
logging.warn is deprecated and should be replaced with logging.warning.
Bug:1097402
Change-Id: I55ce007bec47608eeafcf3cd9ac2b90f60073115
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2575621
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
It worked only because of an all-powerful service account on each bot,
which isn't the case any more.
R=sokcevic@google.com
Change-Id: Id66f9cc44cd416e5b61745c0f690d5a91b3b4c67
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2225976
Auto-Submit: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This is a reland of d3affaa624
Original change's description:
> Use OS level locking in git_cache.py
>
> Without OS level locking it's possible to leave "lock" files on disk
> which will prevent next run to acquire those locks. This can easily
> happen if SIGKIL is issued.
>
> R=apolito@google.com, ehmaldonado@chromium.org
>
> Bug: 1049610
> Change-Id: Id87aa1376b9ea5ff0c2d14f3603636493ed1dd5b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2189333
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Bug: 1049610
Change-Id: I58e65a10f7c779e0de1121ba7167c694996e390c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2211189
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
This reverts commit d3affaa624.
Reason for revert: no attribute ignore_lock
Original change's description:
> Use OS level locking in git_cache.py
>
> Without OS level locking it's possible to leave "lock" files on disk
> which will prevent next run to acquire those locks. This can easily
> happen if SIGKIL is issued.
>
> R=apolito@google.com, ehmaldonado@chromium.org
>
> Bug: 1049610
> Change-Id: Id87aa1376b9ea5ff0c2d14f3603636493ed1dd5b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2189333
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
TBR=iannucci@chromium.org,ehmaldonado@chromium.org,apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com,sokcevic@google.com
Change-Id: Iecc963e0a99d7f59f3f8801e529839346f9fbaf3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1049610
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2211186
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Without OS level locking it's possible to leave "lock" files on disk
which will prevent next run to acquire those locks. This can easily
happen if SIGKIL is issued.
R=apolito@google.com, ehmaldonado@chromium.org
Bug: 1049610
Change-Id: Id87aa1376b9ea5ff0c2d14f3603636493ed1dd5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2189333
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
If a local branch tracks removed remote tracking branch (e.g. foo) and
remote has a branch that starts with such name (e.g. foo/bar), git fetch
will fail. --prune flag removes any remote-tracking branches that no
longer exist.
R=apolito@google.com, ehmaldonado@chromium.org
Bug: 1079483
Change-Id: I9bc31bf961d52a86b6fa2342249971b99a003666
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2190341
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
This can happen if the cache repo was init'd, but has no pack files;
previously it would try to fetch from scratch.
Change-Id: I71689e30bdede392588c69e118e9297d86a134a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2120281
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This reverts commit 32a801b5da.
Reason for revert:
It's causing depot tools presubmit to time out
(Also, introduces a Python 3 error for git_cache).
Original change's description:
> [bot_update] Also bootstrap in the case that there are 0 pack files
>
> This can happen if the cache repo was init'd, but has no pack files;
> previously it would try to fetch from scratch.
>
> R=ehmaldonado@chromium.org, tandrii@chromium.org
>
> No-Presubmit: true
> Change-Id: I97e863dd6c2ecfd00fdb4238dda48e0d3929c4f2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1941337
> Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
TBR=iannucci@chromium.org,tandrii@google.com,ehmaldonado@chromium.org
Change-Id: I93366bcc6ff1df579a67d51c2cda812c84a06215
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1951985
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This can happen if the cache repo was init'd, but has no pack files;
previously it would try to fetch from scratch.
R=ehmaldonado@chromium.org, tandrii@chromium.org
No-Presubmit: true
Change-Id: I97e863dd6c2ecfd00fdb4238dda48e0d3929c4f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1941337
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
I noticed that chromium/src archive grew 2x from 7.3GiB in August
to 15+ GiB now. Turns out --aggressive-gc had no effect.
R=iannucci
Change-Id: I6a27f67f5a4dd2101ac1622221106e094af4688a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1928583
Auto-Submit: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Running gclient_smoketests times out on windows when using git daemon,
so use a local directory as remote instead.
Bug: 1024683
Change-Id: I6ca506d74de463d914317f176eefbe74996298c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1879723
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
There are 3 layers modified, starting from the bottom up:
1. git_cache.py populate
Now takes a --no-fetch-tags option. If specified, the cache will not
fetch updated tags from the server by passing --no-tags to git fetch.
This prevents the server from sending all the tag refs. In chromium
this prevents significant time bottlenecks dealing with 10k+ tags.
2. bot_update.py
bot_update has to deal with multiple git repos, it has the root repo
that is checked out through git-cache, as well as repos synched via
DEPS and gclient.
The script now takes a --no_fetch_tags option. If specified,
the git-cache populate call will include --no-fetch-tags. Otherwise, it
won't. So this controls (for chromium) if fetches to the src.git server
are passed --no-tags.
3. bot_update/api.py
This is the entry point for recipes and also has to deal with multiple
git repos. The behaviour at this point is not changed from the default.
A |no_fetch_tags| parameter is added to ensure_checkout() that defaults
to False.
This CL is a refactor with no intended behavior change.
The next step will be to change the chromium build repo to pass True
for ensure_checkout(no_fetch_tags) on chromium trybots.
This represents solution #2 in
https://docs.google.com/document/d/1hDIunJjjfpmr50y3YnZ4o3aq1NZF4gJa1TS0p7AIL64/edit#
Bug: 1019824
Change-Id: I935430603299daa9e301a95a5184c0ce486fd912
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1894352
Reviewed-by: Aaron Gable <agable@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Auto-Submit: danakj <danakj@chromium.org>
This reverts commit 1e4dbf3f64.
Reason for revert: unlikely but possible cause of http://shortn/_sgL4PqICVB
Original change's description:
> Add more git tracing.
>
> This CL adds more perf tracing to `git fetch` from bot_update.py and
> git_cache.py
>
> Change-Id: I9b69c60b6c81fc0c5f23f82fcc889b4d45a27556
> Recipe-Nontrivial-Roll: build_limited_scripts_slave
> Recipe-Nontrivial-Roll: build
> Recipe-Nontrivial-Roll: infra
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1888433
> Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
> Commit-Queue: Erik Chen <erikchen@chromium.org>
> Auto-Submit: Erik Chen <erikchen@chromium.org>
TBR=danakj@chromium.org,tandrii@google.com,erikchen@chromium.org
Change-Id: I03b33bf1532212f83a6b89b1de32fafb6b8aafc4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1891001
Reviewed-by: John Budorick <jbudorick@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>