commit | 82d549a81d6a10d8ccc2fc660baa9216f982a081 | [log] [tgz] |
---|---|---|
author | Vadim Shtayura <vadimsh@chromium.org> | Thu Jun 23 00:00:13 2022 |
committer | LUCI CQ <infra-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Jun 23 00:00:13 2022 |
tree | 567f4ea56e5b11f806870c038c788eab0e85f397 | |
parent | ee2c632ce9a2db916bfa3fd1e0970d92227c7b0c [diff] |
[cipd] Add NewClientFromEnv to simplify creating clients. I noticed that cipd.NewClient is often misused in infra.git codebase. It almost always needs to be paired with ClientOptions.LoadFromEnv to pick up env vars such as CIPD_CACHE_DIR, and it is almost always forgotten. NewClientFromEnv makes it easier to construct cipd.Client that looks more like `cipd` CLI's internal client (which what people usually want). Whether directly linking to CIPD client library (vs calling `cipd` binary) is a good idea is a separate discussion, but there's a plenty of incomplete calls to cipd.NewClient already and this CL will be used to fix them. BUG=1310363 R=iannucci@chromium.org, yiwzhang@google.com Change-Id: I8b18c84aa503258bdcb162577b12535038e2901a Reviewed-on: https://chromium-review.googlesource.com/c/infra/luci/luci-go/+/3717105 Reviewed-by: Yiwei Zhang <yiwzhang@google.com> Commit-Queue: Vadim Shtayura <vadimsh@chromium.org>
LUCI Go code is meant to be worked on from an Chromium infra.git checkout, which enforces packages versions and Go toolchain version. First get fetch via depot_tools.git then run:
fetch infra cd infra/go eval `./env.py` cd src/go.chromium.org/luci
Contributing uses the same flow as Chromium contributions.