Commit Graph

115 Commits (3774c589cb395e9949f5e7d92f837e4a424617d8)

Author SHA1 Message Date
Stephanie Kim 3774c589cb Reland "Add optional enforce_fetch kwarg to fetch and refresh git cache"
This is a reland of f38f54f2f1

Original change's description:
> Add optional enforce_fetch kwarg to fetch and refresh git cache
>
> Allows builders to do a force refresh of the git cache to ensure a new
> fetch happens. android-binary-size needs this to get an accurate diff
> of the passed in src revision and the applied patch:
> https://bugs.chromium.org/p/chromium/issues/detail?id=1129235#c19
>
> Bug: 1129235
> Change-Id: I993521cdde2a491fc9d42d75ff28dedcd2cea64e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2438802
> Commit-Queue: Stephanie Kim <kimstephanie@google.com>
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>

Bug: 1129235
Change-Id: I034a91a8b57821d08b10042f7fc94d32350540ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2443235
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Stephanie Kim <kimstephanie@google.com>
5 years ago
Stephanie Kim 98218e9219 Revert "Add optional enforce_fetch kwarg to fetch and refresh git cache"
This reverts commit f38f54f2f1.

Reason for revert: Seeing errors about missing args 007f2e16445872d9237cec0f72bb239fd6/+/steps/bot_update/0/stdout

Original change's description:
> Add optional enforce_fetch kwarg to fetch and refresh git cache
>
> Allows builders to do a force refresh of the git cache to ensure a new
> fetch happens. android-binary-size needs this to get an accurate diff
> of the passed in src revision and the applied patch:
> https://bugs.chromium.org/p/chromium/issues/detail?id=1129235#c19
>
> Bug: 1129235
> Change-Id: I993521cdde2a491fc9d42d75ff28dedcd2cea64e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2438802
> Commit-Queue: Stephanie Kim <kimstephanie@google.com>
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>

TBR=tandrii@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com,sokcevic@google.com,kimstephanie@google.com

Change-Id: Ib867742c624f085d3dd56422c2d63c15fdc84f06
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1129235
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2443231
Reviewed-by: Stephanie Kim <kimstephanie@google.com>
Commit-Queue: Stephanie Kim <kimstephanie@google.com>
5 years ago
Stephanie Kim f38f54f2f1 Add optional enforce_fetch kwarg to fetch and refresh git cache
Allows builders to do a force refresh of the git cache to ensure a new
fetch happens. android-binary-size needs this to get an accurate diff
of the passed in src revision and the applied patch:
https://bugs.chromium.org/p/chromium/issues/detail?id=1129235#c19

Bug: 1129235
Change-Id: I993521cdde2a491fc9d42d75ff28dedcd2cea64e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2438802
Commit-Queue: Stephanie Kim <kimstephanie@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
5 years ago
Garrett Beaty 71198cd4a2 Handle failures in the bot_update script.
Currently, if the bot_update script fails, then recipe code that makes
assumptions about the returned output JSON cause exceptions to be
raised. This fixes a couple instances in the code so that the bot_update
failure should surface instead of an uncaught exception.

Change-Id: I031e613841b03e5eb4f6d9ca7adb5085088a3077
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2405708
Auto-Submit: Garrett Beaty <gbeaty@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
5 years ago
Garrett Beaty 6c484875cd Ensure all keys in the bot_update revisions dict use forward slash.
On Windows, the path that gets computed from the gitiles commit uses
backslashes, which won't match the format of the paths that
bot_update.py uses.

Bug: 1047893
Change-Id: Ie1f6c070558fe00d6f4b1f2fd453e430b21a55ed
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2380590
Commit-Queue: Garrett Beaty <gbeaty@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
5 years ago
Garrett Beaty 6081b23b29 Modify bot_update to support setting blamelist pins.
This adds a parameter to bot_update.ensure_checkout that will cause
blamelist pins to be set for all of the repos whose revision is not
determined by DEPS files: the repo for the gitiles input, the repo for
each solution in the gclient config and any repos with the revision set
by the revisions field of the gclient config.

Bug: 1047893
Change-Id: Ie3eee41dbf15be014185b6f255ee3d4cfd40b4e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2293514
Commit-Queue: Garrett Beaty <gbeaty@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Robert Iannucci d56d2c282f Remove source_manifest functionality from depot_tools.
This is essentially defunct; We will want to add something like this
back in, but it's so sparsely used right now that it's better to just
remove it and then add it back properly when we're ready to support
it across all of LUCI.

R=yiwzhang@google.com

Bug: 1093959
Change-Id: I72673515d860234daa3b01514ac38168ebb4825a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2250403
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
5 years ago
Josip Sokcevic a01816b0ba Set git low speed detection on bot_update
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: build_limited
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: release_scripts
Recipe-Nontrivial-Roll: skia
Change-Id: Iacf276bd53fdca37994b6d6fe1e5db71f844a3fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2147833
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
5 years ago
Andrii Shyshkalov ef7a33909e bot_update: tell CQ to not retry patch application failures.
R=erikchen

Recipe-Nontrivial-Roll: build
Change-Id: I171daa3d61b2c20f963b8d587df8662740d80e71
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2050537
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Andrii Shyshkalov <tandrii@google.com>
5 years ago
John Budorick e9aeaee522 bot_update: only add input commit refs for gclient solution roots.
Bug: 1031805
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: infra
Change-Id: I6edd221900eadd4d621d6190e08b61fdbc2f8621
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1958706
Commit-Queue: John Budorick <jbudorick@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
5 years ago
Garrett Beaty 90c88f0973 Reland "Fetch the input commit ref when both ref and id are specified."
This is a reland of 72a245e4c6

The "git checkout master --detach" operation has been modified to run in the solution
directory.

Original change's description:
> Fetch the input commit ref when both ref and id are specified.
>
> This causes --refs refs/head/master to be added to bot_update calls when
> the input build message contains a commit id and the refs/head/master
> ref. This is an effective no-op.
>
> When bot_update clones a git repository, it results in HEAD referring to
> master in contrast to the non-clone case which results in a detached
> HEAD. This prevents fetching refs/heads/master, so detach the HEAD after
> cloning.
>
> Bug: 922150
> Change-Id: I357a78305020218e9f5d350832a706b8f2b27967
> Recipe-Nontrivial-Roll: build
> Recipe-Nontrivial-Roll: build_limited_scripts_slave
> Recipe-Nontrivial-Roll: infra
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1900735
> Commit-Queue: Garrett Beaty <gbeaty@chromium.org>
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>

Bug: 922150
Change-Id: I7dc6ebed2dcbd880ff4d515f7e9fc6428ff24099
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: infra
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1910260
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Garrett Beaty <gbeaty@chromium.org>
6 years ago
Stephen Martinis 1917f7a099 Revert "Fetch the input commit ref when both ref and id are specified."
This reverts commit 72a245e4c6.

Reason for revert: crbug.com/1022617

Original change's description:
> Fetch the input commit ref when both ref and id are specified.
> 
> This causes --refs refs/head/master to be added to bot_update calls when
> the input build message contains a commit id and the refs/head/master
> ref. This is an effective no-op.
> 
> When bot_update clones a git repository, it results in HEAD referring to
> master in contrast to the non-clone case which results in a detached
> HEAD. This prevents fetching refs/heads/master, so detach the HEAD after
> cloning.
> 
> Bug: 922150
> Change-Id: I357a78305020218e9f5d350832a706b8f2b27967
> Recipe-Nontrivial-Roll: build
> Recipe-Nontrivial-Roll: build_limited_scripts_slave
> Recipe-Nontrivial-Roll: infra
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1900735
> Commit-Queue: Garrett Beaty <gbeaty@chromium.org>
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>

TBR=ehmaldonado@chromium.org,gbeaty@chromium.org

Change-Id: Ibd6c6ed272b0c98f82be50cefa521aaee0444f11
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 922150, 1022617
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1904099
Reviewed-by: Stephen Martinis <martiniss@chromium.org>
Commit-Queue: Stephen Martinis <martiniss@chromium.org>
6 years ago
Garrett Beaty 72a245e4c6 Fetch the input commit ref when both ref and id are specified.
This causes --refs refs/head/master to be added to bot_update calls when
the input build message contains a commit id and the refs/head/master
ref. This is an effective no-op.

When bot_update clones a git repository, it results in HEAD referring to
master in contrast to the non-clone case which results in a detached
HEAD. This prevents fetching refs/heads/master, so detach the HEAD after
cloning.

Bug: 922150
Change-Id: I357a78305020218e9f5d350832a706b8f2b27967
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: infra
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1900735
Commit-Queue: Garrett Beaty <gbeaty@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
danakj 23247b9932 Don't fetch tags when fetching to deapply a patch.
Bug: 1019824
Change-Id: Ibec0b47067345150dbd2083265c49fb9b6769a3a
Recipe-Nontrivial-Roll: build
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1894408
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
6 years ago
danakj c41f72cf44 Allow the bot_update api to not fetch tags from the git server.
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>
6 years ago
Haiyang Pan 7a77984331 Revert "Fetch the input commit ref when both ref and id are specified."
This reverts commit 512f92b731.

Reason for revert: bot_update is having infra failure on ci bots.
For example https://ci.chromium.org/p/chromium/builders/ci/Closure%20Compilation%20Linux/249684.

Original change's description:
> Fetch the input commit ref when both ref and id are specified.
>
> This causes --refs refs/head/master to be added to bot_update
> calls when the input build message contains a commit id and the
> refs/head/master ref. This is an effective no-op.
>
> Bug: 922150
> Change-Id: I119d9b3cede727713a0b66bff83b5ee4e1848790
> Recipe-Nontrivial-Roll: build
> Recipe-Nontrivial-Roll: infra
> Recipe-Nontrivial-Roll: build_limited_scripts_slave
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1884457
> Commit-Queue: Garrett Beaty <gbeaty@chromium.org>
> Auto-Submit: Garrett Beaty <gbeaty@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@google.com>

TBR=tandrii@google.com,gbeaty@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 922150
Change-Id: Ie9275c21827688f59449f052c768452a8652e139
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1891000
Commit-Queue: Haiyang Pan <hypan@google.com>
Reviewed-by: Haiyang Pan <hypan@google.com>
6 years ago
Garrett Beaty 512f92b731 Fetch the input commit ref when both ref and id are specified.
This causes --refs refs/head/master to be added to bot_update
calls when the input build message contains a commit id and the
refs/head/master ref. This is an effective no-op.

Bug: 922150
Change-Id: I119d9b3cede727713a0b66bff83b5ee4e1848790
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1884457
Commit-Queue: Garrett Beaty <gbeaty@chromium.org>
Auto-Submit: Garrett Beaty <gbeaty@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
6 years ago
Marc-Antoine Ruel 8e57b4bc55 python3 improvements
Ran:
  vi $(git grep --name-only iteritems | grep -v third_party)
  vi $(git grep --name-only itervalues | grep -v third_party)
  vi $(git grep --name-only 'print ' | grep -v third_party)

and edited the files quickly with adhoc macros. Then ran in recipes/:
  ./recipes.py test train

There was only a small subset of files that had been updated to use
six.iteritems() and six.itervalues(). Since the dataset size that is
being used in gclient is small (pretty much always below 200 items),
it's better to just switch to .items() right away and take the temporary
performance hit, so that we don't need to come back to rewrite the code.

Recipe-Nontrivial-Roll: build
Bug: 984182
Change-Id: I5faf11486b66b0d73c9098ab0f2ce1b15a45c53e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854900
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Marc-Antoine Ruel <maruel@chromium.org>
6 years ago
Andrii Shyshkalov 2025b98401 recipes: update to stop using legacy properties.
The only exception is 'revision' of gclient's weird RevisionResolver,
which will be tackled in https://crbug.com/949334

R=ehmaldonado

Bug: 877161
Change-Id: Ic65a2d13578802cf093f2a1cfb4002fe97509b3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1818973
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
6 years ago
Tamer Tas c5656169e4 Add optional target selection for resolving fixed revisions
{_resolve_fixed_revisions} resolves every revision property. After a test
failure, we don't want to resolve every revision always.

This CL allows updating a subset of revisions for a new checkout.

R=machenbach@chromium.org
TBR=tandrii@chromium.org

Bug: 950731, 982711
Change-Id: I3cdc5cdb882009886b82557427fdf9b02e860b39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1720929
Commit-Queue: Tamer Tas <tmrts@chromium.org>
Auto-Submit: Tamer Tas <tmrts@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
6 years ago
Edward Lemur 99fe071354 Reland "bot_update: Pass target-ref to gclient."
This is a reland of f61af56950

crrev.com/c/1592577 should fix the issues with the original change.

Original change's description:
> bot_update: Pass target-ref to gclient.
>
> Bug: 956807
> Recipe-Nontrivial-Roll: infra
> Recipe-Nontrivial-Roll: skia
> Recipe-Nontrivial-Roll: build_limited_scripts_slave
> Recipe-Nontrivial-Roll: build
> Change-Id: I4d786d989446b8c1e3f39ef78c3c99cfe70808c0
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1588502
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

Bug: 956807
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: skia
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: build
Change-Id: I16c22cb6aeb8e9dc1f55d77b1f12987720da3480
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1613341
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Oleh Prypin 5b1f4aaf31 Revert "Reland "bot_update: Pass target-ref to gclient.""
This reverts commit 867e3c9511.

Reason for revert: Fails to apply patch onto a branch head.
Example failure: https://ci.chromium.org/p/webrtc/builders/try/linux_compile_rel/13395
vs previous successful run: https://ci.chromium.org/p/webrtc/builders/try/linux_compile_rel/13307

Original change's description:
> Reland "bot_update: Pass target-ref to gclient."
>
> This is a reland of f61af56950
>
> gclient was updated to handle these refs on
> https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1590495
>
> Original change's description:
> > bot_update: Pass target-ref to gclient.
> >
> > Bug: 956807
> > Recipe-Nontrivial-Roll: infra
> > Recipe-Nontrivial-Roll: skia
> > Recipe-Nontrivial-Roll: build_limited_scripts_slave
> > Recipe-Nontrivial-Roll: build
> > Change-Id: I4d786d989446b8c1e3f39ef78c3c99cfe70808c0
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1588502
> > Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> > Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
>
> Bug: 956807
> Recipe-Nontrivial-Roll: infra
> Recipe-Nontrivial-Roll: build_limited_scripts_slave
> Recipe-Nontrivial-Roll: build
> Change-Id: I06b2b517d3f1aeb0a12b7c5fc58f1621533dae5c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1592214
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

TBR=nodir@chromium.org,tandrii@chromium.org,ehmaldonado@chromium.org

Bug: 956807, webrtc:10406
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: skia
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: build
Change-Id: I6db0802e1951c3241d0a3c080bea51423582cb3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1593052
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Oleh Prypin <oprypin@chromium.org>
Auto-Submit: Oleh Prypin <oprypin@chromium.org>
6 years ago
Edward Lemur 867e3c9511 Reland "bot_update: Pass target-ref to gclient."
This is a reland of f61af56950

gclient was updated to handle these refs on
https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1590495

Original change's description:
> bot_update: Pass target-ref to gclient.
>
> Bug: 956807
> Recipe-Nontrivial-Roll: infra
> Recipe-Nontrivial-Roll: skia
> Recipe-Nontrivial-Roll: build_limited_scripts_slave
> Recipe-Nontrivial-Roll: build
> Change-Id: I4d786d989446b8c1e3f39ef78c3c99cfe70808c0
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1588502
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

Bug: 956807
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: build
Change-Id: I06b2b517d3f1aeb0a12b7c5fc58f1621533dae5c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1592214
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Stephen Martinis b3aca437d0 Revert "bot_update: Pass target-ref to gclient."
This reverts commit f61af56950.

Reason for revert: Broke bot update, https://ci.chromium.org/p/chromium/builders/try/win7-rel/80552

Original change's description:
> bot_update: Pass target-ref to gclient.
> 
> Bug: 956807
> Recipe-Nontrivial-Roll: infra
> Recipe-Nontrivial-Roll: skia
> Recipe-Nontrivial-Roll: build_limited_scripts_slave
> Recipe-Nontrivial-Roll: build
> Change-Id: I4d786d989446b8c1e3f39ef78c3c99cfe70808c0
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1588502
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

TBR=nodir@chromium.org,tandrii@chromium.org,ehmaldonado@chromium.org

Change-Id: Ib91ed0d40c49acbd2a85c440ea1923cb9e387353
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 956807
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1590526
Reviewed-by: Stephen Martinis <martiniss@chromium.org>
Commit-Queue: Stephen Martinis <martiniss@chromium.org>
6 years ago
Edward Lemur f61af56950 bot_update: Pass target-ref to gclient.
Bug: 956807
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: skia
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: build
Change-Id: I4d786d989446b8c1e3f39ef78c3c99cfe70808c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1588502
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Nodir Turakulov c7acd584e3 [bot_update] Use got_revision for output commit
got_revision and got_revision_cp point to the commit that
Build.output.gitiles_commit should point to.
Therefore, derive output commit from these properties.

Derive output ref from got_revision_cp if it available.
Otherwise, try to read it from input commit

Bug: 940214
Change-Id: I108d782ad93c70114581830d7427b95d3efd9d98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1588506
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
6 years ago
John Budorick 0b62ed79ed Revert "[bot_update] Default to refs/heads/master"
This reverts commit 9198ef8ede.

Reason for revert: Spec revert: appears to be causing large number of chromium CQ failures on patch application.

Original change's description:
> [bot_update] Default to refs/heads/master
> 
> When revision is not specified, currently HEAD is checked out.
> Change the default to refs/heads/master
> 
> Recipe-Nontrivial-Roll: infra
> Recipe-Nontrivial-Roll: build
> Recipe-Nontrivial-Roll: build_limited_scripts_slave
> Bug: 940214
> Change-Id: I8be59095d90447ea898d5247a6433f0734f5e63b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1554862
> Commit-Queue: Nodir Turakulov <nodir@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

TBR=nodir@chromium.org,tandrii@chromium.org,jbudorick@chromium.org

Change-Id: Icafd817d8f044a4347342bd85dc97d193329a704
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 940214
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1555514
Reviewed-by: John Budorick <jbudorick@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
6 years ago
Nodir Turakulov 9198ef8ede [bot_update] Default to refs/heads/master
When revision is not specified, currently HEAD is checked out.
Change the default to refs/heads/master

Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Bug: 940214
Change-Id: I8be59095d90447ea898d5247a6433f0734f5e63b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1554862
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
Nodir Turakulov fdd2581115 [bot_update] Set output commit of the build
Add set_output_commit param to bot_update.ensure_checkout, false by default.
If true, call api.buildbucket.set_output_gitiles_commit to set the output commit
of the build. This generally supersedes got_revision and got_revision_cp.

Bug: 940214
Change-Id: I5ffc790a6b12c8bf4a56469b3ecc567141c0d735
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1548256
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
6 years ago
Andrii Shyshkalov 5585c87a78 Revert "Pass target branch from tryserver in bot_update module"
This reverts commit 245337d62e.

Reason for revert: broke presubmit builders running run_presubmit.py recipe.

Original change's description:
> Pass target branch from tryserver in bot_update module
> 
> Change-Id: I9d250c87355833ddc6c7d8f41e9e43575713925f
> 
> Recipe-Nontrivial-Roll: build_limited_scripts_slave
> Recipe-Nontrivial-Roll: skia
> Recipe-Nontrivial-Roll: infra
> Recipe-Nontrivial-Roll: build
> Recipe-Nontrivial-Roll: release_scripts
> Change-Id: I9d250c87355833ddc6c7d8f41e9e43575713925f
> Reviewed-on: https://chromium-review.googlesource.com/c/1420977
> Commit-Queue: William Hesse <whesse@google.com>
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>

TBR=whesse@google.com,ehmaldonado@chromium.org

Change-Id: I89513b5bb053788291e79340c1685189adc794ec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/1484655
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
6 years ago
William Hesse 245337d62e Pass target branch from tryserver in bot_update module
Change-Id: I9d250c87355833ddc6c7d8f41e9e43575713925f

Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: skia
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: release_scripts
Change-Id: I9d250c87355833ddc6c7d8f41e9e43575713925f
Reviewed-on: https://chromium-review.googlesource.com/c/1420977
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
John Budorick 1333933200 bot_update: stop failing with a KeyError in the recipe on failure.
This has been low-key driving me bananas for a while, and I've seen
it confuse sheriffs etc many times.

Change-Id: If46ab55821447a3a70a3f0ea774c017f29fc7400
Reviewed-on: https://chromium-review.googlesource.com/c/1286819
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
7 years ago
Edward Lemur 0c3bd49069 bot_update: Don't use apply_patch_on_gclient.
It has been True by default for a while, and there is no need to override it.

Bug: 891917
Change-Id: I2598a2230b0ea38a647a533757331c541b871971
Reviewed-on: https://chromium-review.googlesource.com/c/1260057
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Nodir Turakulov 78eed01c0b [bot_update] Use get_gerrit_patch_root
Use get_gerrit_patch_root in bot_update.ensure_checkout.

This fixes some tests expectations that expected CI builds to pass --patch_root
flag.

Also unify "root" and "patch_root" variables in ensure_checkout. Simpler.

This CL requires nontrivial rolls in all downstream packages because all
packages have incorrect expectations and/or tests.
In particular, this removes --patch_root flag from non-tryjob test
cases. Some tests are supposed to test tryjob scenario, but they use
properties.generic instead of properties.tryserver (or buildbucket.try_build)

Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: release_scripts
Recipe-Nontrivial-Roll: skiabuildbot
Bug: 694348
Change-Id: Ibc594fa42e3b4d2823672b41dda2d97154b10d38
Reviewed-on: https://chromium-review.googlesource.com/1231280
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Nodir Turakulov dd2ce986ce [gclient] Update set_patch_project_revision
Update set_patch_project_revision to use repo_path_map instead of
patch_projects.
Also rename to set_patch_repo_revision.

Bug: 694348
Change-Id: Iba31f4910f8282160000b8fcef197052597530a4
Reviewed-on: https://chromium-review.googlesource.com/1226107
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Nodir Turakulov 0f322bfcf5 [bot_update] Add gclient.get_gerrit_patch_root
Add a shortcut for getting local path to the patch repo.

In bot_update.api._destination_branch, start using it instead of reading
gclient config directly. This removes one more patch_project usage.

Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: infra
Bug: 694348
Change-Id: If05371d0f6d11be6803ffa8392e029f5860dda25
Reviewed-on: https://chromium-review.googlesource.com/1217670
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Nodir Turakulov ddda0b5b8a Fetch current Gerrit CL info in tryserver
Add tryserver.api.gerrit_change_info that returns detailed info about the
current Gerrit CL. It makes a Gerrit RPC in the background on the first read.
This step will be present in all tryjobs.

This mechanism can be used for extra details about the current CL.
This CL starts to use this in bot_update for gerrit_ref, and stops using
patch_ref property, and also update bot_update to use when the destination
branch is needed.

Also this CL removes no longer used properties in bot_update,
namely most of patch_* properties.

build.git manual roll: https://chromium-review.googlesource.com/c/chromium/tools/build/+/1217626

Recipe-Manual-Change: build
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: skia
Recipe-Nontrivial-Roll: skiabuildbot
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: release_scripts
R=tandrii@chromium.org
Bug: 694348
Change-Id: I945d061b74278c3d1d227578abe16a64cdaca647
Reviewed-on: https://chromium-review.googlesource.com/1213557
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Nodir Turakulov 11bc399153 [bot_update] add ignore_input_commit parameter
CrOS chromium-pfq builder uses bot_update, but checks out Chromium on its own,
effectively ignoring input commit in bot_update.
To resolve a P0, add ignore_input_commit parameter.
Long term, bot_update API must be redesigned.

TBR=tandrii@chromium.org
Bug: 882094
Change-Id: I4f43348e3d5f81bf603dd2c110829bce58acad16
Reviewed-on: https://chromium-review.googlesource.com/1216787
Reviewed-by: Lann Martin <lannm@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
7 years ago
Nodir Turakulov d91f0adca2 Reland "[bot_update] Stop using repository properties"
This is a reland of 4d2b901804
verbatim. The problem was in the buildbucket recipe module, see
https://chromium-review.googlesource.com/c/infra/luci/recipes-py/+/1215002#message-2351f1089af71655dbaff576aa4d11f1dedc800b

Original change's description:
> [bot_update] Stop using repository properties
>
> Stop using repository and patch_repository_url properties.
> Use self.m.buildbucket.build.input.gerrit_changes[0].{host, project}
> instead.
>
> R=ehmaldonado@chromium.org, tandrii@chromium.org
>
> Recipe-Nontrivial-Roll: build
> Bug: 877161, 694348
> Change-Id: Ideb069c6c8f8b6e6cfb5217f8a04ea18f16d3056
> Reviewed-on: https://chromium-review.googlesource.com/1208368
> Commit-Queue: Nodir Turakulov <nodir@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: skia
Bug: 877161, 694348
Change-Id: I0a10ca7814a8f5bdfd30a491e36fb7261cdaf225
Reviewed-on: https://chromium-review.googlesource.com/1214705
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
7 years ago
Nodir Turakulov f022f91453 Revert "[bot_update] Stop using repository properties"
This reverts commit 4d2b901804.

Reason for revert: https://chromium-review.googlesource.com/c/chromium/tools/build/+/1214622

Original change's description:
> [bot_update] Stop using repository properties
> 
> Stop using repository and patch_repository_url properties.
> Use self.m.buildbucket.build.input.gerrit_changes[0].{host, project}
> instead.
> 
> R=​ehmaldonado@chromium.org, tandrii@chromium.org
> 
> Recipe-Nontrivial-Roll: build
> Bug: 877161, 694348
> Change-Id: Ideb069c6c8f8b6e6cfb5217f8a04ea18f16d3056
> Reviewed-on: https://chromium-review.googlesource.com/1208368
> Commit-Queue: Nodir Turakulov <nodir@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

TBR=nodir@chromium.org,tandrii@chromium.org,ehmaldonado@chromium.org

Change-Id: I825242124382e9f1789d4a3da0a3bdd2a5fcab37
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 877161, 694348
Reviewed-on: https://chromium-review.googlesource.com/1214703
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
7 years ago
Nodir Turakulov 4d2b901804 [bot_update] Stop using repository properties
Stop using repository and patch_repository_url properties.
Use self.m.buildbucket.build.input.gerrit_changes[0].{host, project}
instead.

R=ehmaldonado@chromium.org, tandrii@chromium.org

Recipe-Nontrivial-Roll: build
Bug: 877161, 694348
Change-Id: Ideb069c6c8f8b6e6cfb5217f8a04ea18f16d3056
Reviewed-on: https://chromium-review.googlesource.com/1208368
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Nodir Turakulov 60e7f52377 [bot_update] Stop using revision and parent_got_revision properties
Use self.m.buildbucket.build.input.gitiles_commit.id instead.
It encapsulates revision and parent_got_revision properties.

Also, honor host and project of the specified commit.
This enables overriding non-first gclient solution at the build-level
for arbitrary buildbucket builds.


Bug: 877161
Change-Id: I3f92f04ca84a1d30cbbb2670f62bea2bd9ee5932
Reviewed-on: https://chromium-review.googlesource.com/1200066
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Nodir Turakulov 9af7d107de Revert "bot_update: Specify the target branch for patch_refs."
This reverts commit 01f0c698fb.

Reason for revert: https://chromium-review.googlesource.com/c/chromium/tools/build/+/1211422

Original change's description:
> bot_update: Specify the target branch for patch_refs.
> 
> Bug: 870279
> Recipe-Manual-Change: build
> Recipe-Manual-Change: infra
> Recipe-Manual-Change: build_limited_scripts_slave
> Recipe-Manual-Change: skia
> Recipe-Manual-Change: release_scripts
> Change-Id: I58110ff8c5a6ca6906bbbf3eafa09dcbaf39f777
> Reviewed-on: https://chromium-review.googlesource.com/1174988
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

TBR=tandrii@chromium.org,ehmaldonado@chromium.org,jbudorick@chromium.org

Change-Id: Ic78a264ccf5e2ca15452659e17d41da264560eb8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 870279
Reviewed-on: https://chromium-review.googlesource.com/1211462
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
7 years ago
Edward Lemur 01f0c698fb bot_update: Specify the target branch for patch_refs.
Bug: 870279
Recipe-Manual-Change: build
Recipe-Manual-Change: infra
Recipe-Manual-Change: build_limited_scripts_slave
Recipe-Manual-Change: skia
Recipe-Manual-Change: release_scripts
Change-Id: I58110ff8c5a6ca6906bbbf3eafa09dcbaf39f777
Reviewed-on: https://chromium-review.googlesource.com/1174988
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Nodir Turakulov efc95d6b9a [bot_update] Untie revision and repository properties
repository and revision have less to do with each other than it seems:
revision is for checkout and the part of code that reads revision does not
read repository.
repository property is used to determine what to apply the patchset to.

When initializing their values from buildbucket.build.input, do it separately.
Also, initialize repository from Gerrit changes, not Gitiles commit.

See also
https://chromium-review.googlesource.com/c/infra/luci/recipes-py/+/1199854
https://chromium-review.googlesource.com/c/infra/luci/recipes-py/+/1199856
Bug: 877161, 694348
Change-Id: I4907a31ce055a3526b15f1a3c8e8f15c2c831437
Reviewed-on: https://chromium-review.googlesource.com/1200065
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
7 years ago
Nodir Turakulov f20c5a4a3c [bot_update] Fix initialization from buildbucket
When checking if buildbucket.build_input.gitiles_commit exists, use
HasField protobuf method, as opposed to truth check. A protobuf message
field is always true.

Bug: 877161
Change-Id: Ie4a7e22b985776441a74283b09646e8837c326f1
Reviewed-on: https://chromium-review.googlesource.com/1196930
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
John Budorick 7de5f08c45 bot_update: remove --gerrit_repo and --gerrit_ref.
Bug: 865882
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: release_scripts
Recipe-Nontrivial-Roll: skia
Recipe-Nontrivial-Roll: skiabuildbot
Change-Id: I4a04c4c28c7dc63ad282f54604c300bbfe654f11
Reviewed-on: https://chromium-review.googlesource.com/1157687
Commit-Queue: John Budorick <jbudorick@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
John Budorick ba883cb5ed bot_update: only fetch explicit refs for the main solution.
Bug: 865882
Change-Id: I27bfbeaf7395a05ce660e9e961550233461acb3d
Reviewed-on: https://chromium-review.googlesource.com/1175857
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
7 years ago
John Budorick e94deafd14 bot_update: pull revisions from provided cfg if present.
Bug: 873186
Change-Id: I91649cc5f4ba8f81f982463aa534e77d88f87ac0
Reviewed-on: https://chromium-review.googlesource.com/1175099
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
7 years ago
John Budorick 5300616351 bot_update: expose patch_refs as an option to ensure_checkout.
Bug: 865882
Change-Id: Icd143fcb6abe1e880dec46a6d26a84103ab4e6d2
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: release_scripts
Recipe-Nontrivial-Roll: skia
Recipe-Nontrivial-Roll: skiabuildbot
Reviewed-on: https://chromium-review.googlesource.com/1157514
Commit-Queue: John Budorick <jbudorick@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
7 years ago