Commit Graph

657 Commits (e6f40ea0341552c3e78fb107fe9f37b87d95f321)

Author SHA1 Message Date
Gavin Mak a5f17dd7b3 Revert "Drop py2 support in recipe modules"
This reverts commit 5819c303f0.

Reason for revert: breaking dart builds

Original change's description:
> Drop py2 support in recipe modules
>
> python3 is the only supported version of python in depot_tools.
>
> Bug: 1475402
> Change-Id: I479de09a0c34b438aced35e4ced58a5972108132
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4808518
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> Commit-Queue: Gavin Mak <gavinmak@google.com>

Bug: 1475402
Change-Id: I0fef7581835bb25ea7e4f22303eef11e72df9536
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4811596
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Gavin Mak 5819c303f0 Drop py2 support in recipe modules
python3 is the only supported version of python in depot_tools.

Bug: 1475402
Change-Id: I479de09a0c34b438aced35e4ced58a5972108132
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4808518
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Josip Sokcevic 3869a16107 [recipe] Support stripping dep prefix
It's the only roll that uses use_relative_path = False. Instead of fully
supporting that case, we will ask user to provide prefix that should be
removed when gitlinks are added.

Change-Id: I1e39d0ce145a246e5b69b7cf64e6b9471bcb1aea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4794721
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Keybo Qian <keybo@google.com>
2 years ago
Josip Sokcevic 2a951b8648 [recipes] Add roll_deps to gclient
roll_deps method in gclient recipe_module allow users to pass DEPS file
together with recipes that need to be rolled. It returns a list of files
that need to be edited in addition to the modified DEPS file (replaced
inline).

R=jojwang, keybo

Change-Id: I6987849f0ebacbb063d6f6186af1dba1647550a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4785897
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Xinan Lin <linxinan@chromium.org>
2 years ago
Gavin Mak 7131bc5609 Remove chromium style plugin solution
The chromium-style plugin was replaced last year with cl/495068108.

Change-Id: Ifce7cf5e22f10681ffe743572182d759ae51fed2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4743665
Auto-Submit: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
2 years ago
Gavin Mak e13840bd9a Remove explicit refs/heads/master revision from gerrit solution
Recipe-Nontrivial-Roll: infra
Bug: 1469734
Change-Id: I7c84383525351798c270cdc3b2f239493f1349e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4743948
Reviewed-by: Arthur Bello <artbello@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
recipe-roller 72d05d0d22 Roll recipe dependencies (nontrivial).
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/8775574442380992545

Please review the expectation changes, and LGTM+CQ.

recipe_engine:
a25e256b7c
  a25e256 (gbeaty@chromium.org)
      Remove json python2 backwards-compatibility separators value.

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: Icb78a982055ee8aa9b0551ac8d6dea80a7fa7dd9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4687678
Reviewed-by: Garrett Beaty <gbeaty@google.com>
Commit-Queue: Garrett Beaty <gbeaty@google.com>
Auto-Submit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2 years ago
Robert Iannucci d78d8ab771 [gclient] Export CONFIG_CTX for other modules to extend.
The recipe engine has a refactor coming up where CONFIG_CTX needs to
be explicitly exported for other modules to extend it. Currently
a handful of modules in the build, build_internal and
release_scripts repos extend the gclient configuration context.

Exporting it like this should have no functional effect, but is just
in preparation for the upcoming refactor.

R=gavinmak

Bug: 1462728
Change-Id: I5871d472f7e28d38eefa9b1e89cfcc804823a1bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4680284
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Yue She 7b0a195903 [mac_toolchain] Roll mac_toolchain version for builders using osx_sdk
This rolls adds support for xcode15 adoption, in case builders using osx recipes want to roll to xcode15 in the future

Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: infra
Bug: 1457029
Change-Id: I958d1ac03281d5663ff3a0df4f0812bde863df2e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4675569
Reviewed-by: Jeff Yoon <jeffyoon@google.com>
Commit-Queue: Yue She <yueshe@google.com>
2 years ago
Robert Iannucci 247429efd9 [git_cl] Remove config from git_cl module.
No downstream repos use this functionality now, using instead the
simpler, explicit, set_default_repo_location method.

Bug: 1462728
Change-Id: Iaf3836b30234f0b798c53f27639ab19c1b134ac9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4669517
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
2 years ago
Robert Iannucci d0b85e47dc [recipe_modules/git_cl] Add migration path away from using config.py.
The usage of config in the git_cl module is wholly unnecessary - This
CL gives a trivial way to change downstream repos to use a normal method
in place of configs, which will ultimately let us remove config.py from
this module.

Change-Id: Ia02ad110c41fadcd3bada0258ba96cbe70d0e43c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4662591
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
2 years ago
Gavin Mak 60c4b8810b Reserve time from soft_deadline to upload traces if bot_update times out
The "upload traces" step is skipped if bot_update times out and is in
the grace_period. Reserve 1 minute to upload traces.

Bug: 1351547, 1456840
Change-Id: Idb191735a07d245575ff4c79375a976750522fa5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4651461
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
2 years ago
Gavin Mak 94761e3305 Fix bot_update _trace_dir
The traces dir isn't created yet and fails to upload traces.

Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: build_limited
Recipe-Nontrivial-Roll: chrome_release
Recipe-Nontrivial-Roll: chromiumos
Recipe-Nontrivial-Roll: infra
Bug: 1351547, 1456880
Change-Id: I635ad02168c918028a3bd4ad6f914f5835dad9b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4633186
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Yiwei Zhang b56b654322 bot_update: fix the check for is running on linux
Since python3.3, the platform value has been changed from linux2 or
linux3 to linux. The bug has stopped bot_update script from emitting
proces tree periodically that will be helpful when debugging.

R=sokcevic

Bug: 1455926
Change-Id: Id6ab4ddf46eaa322a8b5470baa7ba6cc656a6bb3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4654290
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
2 years ago
recipe-roller 4ec095fa85 Roll recipe dependencies (nontrivial).
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/8777726121979453601

Please review the expectation changes, and LGTM+CQ.

recipe_engine:
3b628ec844
  3b628ec (iannucci@chromium.org)
      [json] Add ability to dump json with unsorted keys.

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: I941000effd8a6e7fb01a662a0dccdf90d1d3fe8a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4630530
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Auto-Submit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
2 years ago
Robert Iannucci c868adc368 Remove OrderedDict from test expectation
`api.json.output` is going to start returning regular dict soon
(https://chromium-review.googlesource.com/c/infra/luci/recipes-py/+/4616531)

Note that in python3 (which in this context means 3.8+), dictionaries are
ordered by insertion order.

R=gbeaty

Change-Id: I3358ca32376512d13da945f13ea2c52acf07b404
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4630528
Reviewed-by: Garrett Beaty <gbeaty@google.com>
Commit-Queue: Garrett Beaty <gbeaty@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
2 years ago
Xinan Lin 66ab0a5131 Allow existent branch when creating branches via recipe
BUG=1433047
TEST=train

Change-Id: Iafa16840f7ead393ccd09dd483e45e9098358755
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4629867
Commit-Queue: Xinan Lin <linxinan@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Garrett Beaty 3ffad8166e Don't set blamelist_pins on the json output.
The blamelist_pins attribute is being set on the json output, which is a
dictionary. This only works right now because json.output currently uses
OrderedDict as the dict type. With removal of support for python2, dict
could be used since its iteration order is insertion order in python3.
This change removes setting the blamelist_pins attribute since its not
used anywhere and it will allow json.output to use plain dict.

Change-Id: Ie19b87d61903774454df2d395acf695eaa39b201
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4617204
Commit-Queue: Garrett Beaty <gbeaty@google.com>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Auto-Submit: Garrett Beaty <gbeaty@google.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
2 years ago
Gavin Mak 6fde53139b Upload git traces from bot_update
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: chromiumos
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: build_limited
Recipe-Nontrivial-Roll: chrome_release
Bug: 1351547
Change-Id: I1e018a8407c10ad4f9b6674d4b17ccae1e863389
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4568628
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Lei Zhang 14123b76a8 Update Xcode for macOS 11 and 12
Switch from Xcode 13.0 to 13.2.1 to update the macOS SDK from 11.3 to
12.1. This is needed for bots that use this receipe, like PDFium Mac
bots, after crrev.com/1154867 made macOS 12 mandatory. This also has the
effect of updating the iOS SDK from 15.0 to 15.2.

Change-Id: I4c91b2c23bd8eaacac6cef6afe71fed3533fd838
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4605813
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lindsay Pasricha <lindsayw@chromium.org>
2 years ago
Arthur Eubanks 5fb55cf84e Use xcode 14c18 for macos 13.3+
Bug: chromium:1453280
Change-Id: I912bff9864af30761287500083d93becd07a79d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4602108
Reviewed-by: Yue She <yueshe@google.com>
Commit-Queue: Jeff Yoon <jeffyoon@google.com>
Auto-Submit: Arthur Eubanks <aeubanks@google.com>
Reviewed-by: Jeff Yoon <jeffyoon@google.com>
2 years ago
Takuto Ikuta 37d1312fcd presubmit: remove reference to omit_python2 experiment
This is not used now.

Bug: 1441784
Change-Id: I7c332ff2738c697bb5ea4c14d4b938a2cdab9221
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4584391
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
2 years ago
Mike Frysinger 9e0ff22bfb gsutil: don't warn/log if ~/.gsutil doesn't exist to clean
Make errors less chatty in builders.

Bug: b/285376658
Change-Id: I9ffda16e97900d0a3bbc27b588ce9806a73780ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4582290
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Mike Frysinger 6d5fa4a45e gsutil: move unnecessary logic out of try block
The logging & path expansion shouldn't trigger exceptions, so move
them out of the try block to reduce the scope for this.

Bug: b/285376658
Change-Id: I617d572d997f8eaafa222cdb6c1d984c459d9733
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4582289
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
2 years ago
Mike Frysinger d8670c5709 gsutil: use os.path.expanduser
Makes the code a little simpler and avoids relying on the env directly.

Bug: b/285376658
Change-Id: Iae8300059b3418e0a9224eb555df6eb6cafa9437
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4582288
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
2 years ago
Aravind Vasudevan 12b45d719a Reland "Add git_cache epoch to bot_update output.properties"
This reverts commit ede859f9ee.

Reason for revert: This change includes a fix for the missing path issue. if the `cache_path` doesn't exist, it runs os.mkdirs before setting the cache epoch marker.

Original change's description:
> Revert "Add git_cache epoch to bot_update output.properties"
>
> This reverts commit 867d3267c1.
>
> Reason for revert: breaks some builders, https://crbug.com/1448769#c5
>
> Original change's description:
> > Add git_cache epoch to bot_update output.properties
> >
> > This change adds git cache's epoch timestamp to bot_update's output.properties. It achieves this by adding a marker file to the cache directory which stores the epoch time.
> >
> > Design: go/query-bot-update-cache-age
> >
> > Bug: 1448769
> > Change-Id: I610c6bca5ced7e2a0fe3ee8570decf0f135fe54c
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4563726
> > Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> > Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
>
> Bug: 1448769
> Change-Id: I29db9ac364a9cf1d615b00ed75c1346e56b3f3b6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4582291
> Commit-Queue: Gavin Mak <gavinmak@google.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>

Bug: 1448769
Change-Id: Ia6fd5b27f7556dd81f65011364506d3aa535de62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4583007
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
2 years ago
Gavin Mak ede859f9ee Revert "Add git_cache epoch to bot_update output.properties"
This reverts commit 867d3267c1.

Reason for revert: breaks some builders, https://crbug.com/1448769#c5

Original change's description:
> Add git_cache epoch to bot_update output.properties
>
> This change adds git cache's epoch timestamp to bot_update's output.properties. It achieves this by adding a marker file to the cache directory which stores the epoch time.
>
> Design: go/query-bot-update-cache-age
>
> Bug: 1448769
> Change-Id: I610c6bca5ced7e2a0fe3ee8570decf0f135fe54c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4563726
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>

Bug: 1448769
Change-Id: I29db9ac364a9cf1d615b00ed75c1346e56b3f3b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4582291
Commit-Queue: Gavin Mak <gavinmak@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
2 years ago
Aravind Vasudevan 867d3267c1 Add git_cache epoch to bot_update output.properties
This change adds git cache's epoch timestamp to bot_update's output.properties. It achieves this by adding a marker file to the cache directory which stores the epoch time.

Design: go/query-bot-update-cache-age

Bug: 1448769
Change-Id: I610c6bca5ced7e2a0fe3ee8570decf0f135fe54c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4563726
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
2 years ago
Joanna Wang 4dfbc0a3a9 Add superproject got_revisions.
(1) bot_update (http://shortn/_I814yt6r9U) will use got_revision_mapping
in these configs to create builder properties
{
'got_revision': <revision>
'got_revision_superroject': <revision>
}
(2)
recipe testing a change will use these configs to go from:
CL's project -> project's name in gclient solutions -> got_revision string
(e..g 'https...infra/infra_superproject' -> '.' -> 'got_revision_superproject'

(3) then use e.g. 'got_revision_superproject' to get the <revision> it should use from (1) and pass to wherever. in the presubmit recipes case, we're passing it as upstream to presubmit_support.py http://shortn/_BHBdN9p7ja

After this change we can add infra and internal presubmit tryjobs to the infra_superproject repo.

Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: chromiumos
Bug: 1415507
Change-Id: Ia9804325c35b6071afa73d1b1099695ea6ae0b03
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4570829
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Joanna Wang b52b190cb8 Add explicit path for infra in infra_superproject gclient config.
Recipe-Nontrivial-Roll: infra
Bug:1415507
Change-Id: Ic6973c4f0c9fa011549d44a89205a0731c3ff944
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4566110
Reviewed-by: Gavin Mak <gavinmak@google.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Yue She c83abb3247 Roll mac_toolchain version for builders using osx_sdk
This would add support for uploading/installing Xcode with MacOS13 adoption

Recipe-Nontrivial-Roll: build_limited
Bug: 1441931
Change-Id: I7496a80a6876fc4b0df712ce1634611f59240e67
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4566408
Reviewed-by: Garrett Beaty <gbeaty@google.com>
Reviewed-by: Jeff Yoon <jeffyoon@google.com>
Commit-Queue: Yue She <yueshe@google.com>
2 years ago
Joanna Wang 1affd9c35d Add arg in bot_update recipes api to override deps revisions.
Bug: 1415507
Change-Id: I0bb224eb2b9b4f37d56543c40612736c3c8322a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4561776
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Joanna Wang 9c32c9240c Add explicit path for infra_internal in infra_internal_superproject gclient config.
Fixes this error:
http://shortn/_MMjWQ6UDNN

presubmit.execute() (http://shortn/_IqUEskOvZy) calls get_project_revision_properties (http://shortn/_2YWZfKEBWb).
the `project_name` passed in was '.' (the solution root) so get_project_revision_properties was returning nothing.

setting 'infra_internal' in repo_path_map leads to this code (http://shortn/_7cO431MLDm) setting `self._relative_root` to `infra_internal` as expected. So `project_name` above will be `infra_internal` not '.'

In this case, also seems to fix the empty commit patch issue, as the `git commit` gets executed in infra_internal now.

led run: http://shortn/_UM6iapZUkx

Bug: 1415507
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: build
Change-Id: Ib457ded91ffe5b9041b8b1bb0345229bfd07d1f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4545587
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang 44a278067b Allow empty commits in presubmit recipe.
Bug:1415507
Recipe-Nontrivial-Roll: build
Change-Id: I6f9833603b2fd1cad0665da762e0a2cd47d4fabd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4547402
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Robert Iannucci 3d6d2d2500 [git-cl][presubmit] Remove references to LUCI_OMIT_PYTHON2.
This changes all references to the LUCI_OMIT_PYTHON2 environment
variable to instead assume that it is `'true'`.

R=sokcevic, tikuta

Bug: 1441784
Recipe-Nontrivial-Roll: build
Change-Id: Iea161a372adb68cdcb330d131df2c19ca2fe7b37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4522480
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Robert Iannucci 330de93b15 [recipe_modules/presubmit] Only run with vpython3.
The time has come :).

R=aravindvasudev@google.com

Bug: 1413668
Recipe-Nontrivial-Roll: build
Change-Id: Ie6e26cc87a22d17eb2e4bc6b8f86895738670eea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4389545
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
2 years ago
Takuto Ikuta d37c0b505e Revert "presubmit: remove presubmit step running python2"
This reverts commit f155639336.

Reason for revert:
https://ci.chromium.org/ui/p/infra/builders/try/infra-try-presubmit/b8781520593544576993/overview

Original change's description:
> presubmit: remove presubmit step running python2
>
> This is to deactivate `luci.buildbucket.omit_python2` experiment.
>
> I'll submit this after https://crrev.com/c/4515085 is submitted.
>
> Bug: 1401307, 1441784
> Recipe-Nontrivial-Roll: build
> Change-Id: I0aec58e9b96c961da21f0de0850c4078bb679c33
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4513661
> Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> Commit-Queue: Takuto Ikuta <tikuta@chromium.org>

Bug: 1401307, 1441784
Change-Id: I47a9921b74917a4b0caa6f577c9fc6d3542f8b54
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4519043
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2 years ago
Takuto Ikuta f155639336 presubmit: remove presubmit step running python2
This is to deactivate `luci.buildbucket.omit_python2` experiment.

I'll submit this after https://crrev.com/c/4515085 is submitted.

Bug: 1401307, 1441784
Recipe-Nontrivial-Roll: build
Change-Id: I0aec58e9b96c961da21f0de0850c4078bb679c33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4513661
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
2 years ago
Garrett Beaty 37f499daec Default to an empty footers dict instead of None.
By default during tests, the _get_footers_step call will return None for
the returned footers because it does not set any test data. This does
not match the actual behavior of the recipe because git_footers.py
returns an empty json object if the commit message has no footers. This
change updates it to return an empty dict instead of None and checks for
the cached footers value to be None instead of any non-true value so
that a commit message without footers doesn't get parsed multiple times.

Change-Id: I716a27e964eb92de138228df5cc0876322d82823
Recipe-Manual-Change: build
Recipe-Nontrivial-Roll: build_limited
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4492269
Commit-Queue: Garrett Beaty <gbeaty@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Ariel Zhang 2d1c655c2c Add CL description getter
For context crrev.com/c/4450427.

R=gbeaty@google.com

Change-Id: Ic0a7847009be274010daeaf3181242ae34477a39
Bug: b/214597409
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: build_limited
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4451469
Commit-Queue: Ariel Zhang <arielzhang@google.com>
Reviewed-by: Garrett Beaty <gbeaty@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 years ago
Joanna Wang fd9cea79c1 Use --upstream when calling bot_update (passed to gclient sync).
Should resolve this flaky issue in infra-try builds : https://ci.chromium.org/ui/p/infra/builders/try/infra-try-bionic-64/b8783448305870388449/overview

in logs we see

'''
________ running 'git reset --hard HEAD' in '/b/s/w/ir/cache/builder/infra'
[0:00:02] HEAD is now at 64b4e8f867 Committed patch
[0:00:03] Finished running: git -c core.quotePath=false status --porcelain
[0:00:03] Attempting rebase onto d94466a8462dd19c2a3fc0ca173fd1c89a1f3f28...
[0:00:04] Current branch tmp_checkin_branch is up to date.
[0:00:04] Finished running: git rev-parse HEAD
Checked out revision 64b4e8f867c7b8757438b7e64985654d80a3b135
'''
64b4e8f867 is not a valid infra/infra commit. It is a local commit created from the patch of the last try-job run.

Prior to switching recipes to infra_superproject, we have been depending on https://source.chromium.org/chromium/chromium/tools/depot_tools/+/main:recipes/recipe_modules/bot_update/resources/bot_update.py;l=753;drc=489304d94984bb006a03e842cf2c171c73e7d367 to bring the checkout back to a valid remote infra/infra commit before we get to `gclient sync`. But with infra_superproject as the new root solution, `git checkout --force <pin>` runs for infra_superproject.

'git reset --hard HEAD' is coming from:
https://source.chromium.org/chromium/chromium/tools/depot_tools/+/main:gclient_scm.py;l=786-791;drc=cf4658579326856b9b25cfe2efbfc8683af88814

This is noop. The previous patch commit IS HEAD.

With --upstream we get: `git reset --hard refs/remotes/origin/main`


Bug: 1421776, 1434522
Change-Id: I0d192a160fcc7c3d405765e2e03e05aeb60f6875
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4445126
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Ben Pastene 97dadd025f Apply the gerrit REST timeout to only 'GetChanges' calls
https://crrev.com/c/4420526 put a 10s timeout on all calls made via
this script.

But it appears there are a variety of endpoints that take more than
10s, the latest being "SubmitChange", eg:
https://ci.chromium.org/ui/p/chromeos/builders/release/release-R113-15393.B-orchestrator/25/overview

So instead of applying the timeout to everything, and then opting
certain long-running calls out of it, this just opts-in the
"GetChanges" call to the timeout. This should cover the failure mode
that was originally solved for chrome's bots. And also bump the
timeout to 30s since we don't trust all get-changes queries to
reliably finish in under 10s.

This also bumps the step level timeout for the query in tryserver
recipe_mod to 8 min since there could be ~5min worth of sleeping +
150s worth of waiting+timing-out. So worst case the step will now
take 8min to fully exhaust all timeouts/sleeps.

Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: build_limited
Recipe-Nontrivial-Roll: chromiumos
Recipe-Nontrivial-Roll: infra
Bug: b/278083716
Change-Id: Ib366e004e0bb07297ba732590d488cae779e38ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4426524
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
2 years ago
Ben Pastene 9519fc1300 Add timeouts to the actual http calls in gerrit_util.py
When gerrit's availability drops, chrome's builds see an excessive
amount of failures, eg:
https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/1359780/overview
https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/1359594/overview
https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/1359564/overview
https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/1359630/overview

Seemingly all failures occur in either the `gerrit fetch current CL
info` step or the `gerrit changes` step. Both steps have a 60s timeout
and shell out to depot_tools' gerrit_client.py. That script essentially
makes a single http call to gerrit. That request has no configured
timeout. So when gerrit's MIA and the call hangs indefinitely, so too
will the step hang. 60s after that, the step timeout is reached, and the
entire build crashes with an infra-failure.

However, one single retry has been shown to sufficiently work around
at least one instance of that failure:
dea9a6eca26f690ce10a959701a8fb51ad/+/build.proto

So this incorporates timeouts into the requests made by
gerrit_util.py. Each request is given a 10s timeout, which should be
enough for most/all gerrit calls. (Both steps have a p90 of less than
1sec.) When a timeout is reached, the script will automatically retry
up to 4 times.

This also bumps the timeouts of the step calls to gerrit_client.py to
6min since the script can now take up to 5 minutes to fail, ie:
the sequence of sleeps is roughly 10s, 20s, 40s, 80s, 160s, which is
about 5min. So a 6min timeout should cover all those retries.

This also passes in "--verbose" to all step calls to this script, so
the logging that prints out the retry + sleep log lines will be
visible in build logs.

Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: build_limited
Recipe-Nontrivial-Roll: chrome_release
Recipe-Nontrivial-Roll: chromiumos
Recipe-Nontrivial-Roll: infra
Bug: 1432638
Change-Id: I9dc47f4beeda3783ae4f9152bd29ee441ac3e197
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4420526
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
2 years ago
Joanna Wang 95a28c5a14 Update infra contexts to use infra_superproject.
Recipe-Nontrivial-Roll: infra
Bug: 1415507
Change-Id: I92a60640679115ae188c6de610ef695876a536b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4378428
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
2 years ago
Greg Edelston 02349da2cb recipe_modules/gsutil: Add `dry_run` kwarg
This kwarg will display the command that would have been run, without
actually running it. I plan to use this kwarg on some ChromeOS staging
builders.

BUG=b:270142110
TEST=./recipes.py test train

Change-Id: I20194152e305dc6bae71a58b94de71d414839643
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4382316
Reviewed-by: Gavin Mak <gavinmak@google.com>
Auto-Submit: Greg Edelston <gredelston@google.com>
Commit-Queue: Greg Edelston <gredelston@google.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
2 years ago
Joanna Wang 489304d949 Use os.renames() in remove() to auto-create subdirectories.
Bug: 1415507
Change-Id: Ie52123dc0844639116b55bc7f6a2734aaf7df33e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4378417
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang df528a9d7a Fix multiple endswith values.
Bug: 1421776
Change-Id: I6ca45a7aa086da4356302a7b9aa588bf60888129
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4375877
Reviewed-by: Gavin Mak <gavinmak@google.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang d9717259ee Adjust bot_update recipes to work with infra_superproject context.
Bug: 1415507
Change-Id: I0774eb4f2b7ea43b04a715c295f89e3adda6a9aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4347772
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago
Joanna Wang d99bfd79b4 Add infra_superproject context.
Bug: 1415507
Change-Id: I89921959b6de164decd58aede3de7c8a6b504b7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4368458
Commit-Queue: Yulan Lin <yulanlin@google.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Yulan Lin <yulanlin@google.com>
2 years ago
Joanna Wang d04720454a Update recipes python tests.
For: http://shortn/_j5mixA1Mjr

Change-Id: I7ac4471fbb1e0629d59263266b3470e372d03a19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4368938
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
2 years ago