run_presubmit: avoid doing redundant gerrit call.

Example:
https://ci.chromium.org/p/chromium/builders/luci.chromium.try/chromium_presubmit/299268
There are two steps, both querying Gerrit change details:
  (1) gerrit get_patch_destination_branch
  (2) gerrit fetch current CL info

Each maintains its own cache, however (1) only caches branches, while (2) caches
more data (inside api.trysrever recipe module, however).

So, this CL changes this recipe to rely entirely on api.tryserver,
saving ~0.5s in every presubmit job :)

The intended change, however, is only visible in expectation diff of
  v8_with_cache*.json
because only these test cases use named cache.

R=jchinlee

Change-Id: I591c6b0bf2c0dc2ecacc4c11045c65dbcc0b5edd
Reviewed-on: https://chromium-review.googlesource.com/c/1359892
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Jao-ke Chin-Lee <jchinlee@chromium.org>
28 files changed
tree: 164898288b11dce628be9fe934b9d666ef676ac3
  1. infra/
  2. masters/
  3. scripts/
  4. site_config/
  5. slave/
  6. tests/
  7. third_party/
  8. .gitattributes
  9. .gitignore
  10. .vpython
  11. codereview.settings
  12. DEPS
  13. environment.cfg.py
  14. LICENSE
  15. OWNERS
  16. PRESUBMIT.py
  17. README.md
  18. WATCHLISTS
README.md

build

Hi build contributor! If you do any change in scripts/master/ or touching any master's html/ directories, you must restart master.chromium.fyi first and ensure that it still works before restarting other masters.

Recipes

If you're here to make a change to ‘recipes’ (the code located in scripts/slave/recipes*), please take a look at the README for more information pertaining to recipes.