[size_diff] Various cleanups
- Exit early if the build listed by `searchForBuild()` is already
completed, instead of entering the `waitForBuildCompletion()` loop.
This reduces the minimum required number of HTTP requests from 2 to 1,
restoring behavior inadvertently changed in
commit 62a85b3c6b67f4fa461a87807cf7b8241c7b801d.
- Unify the definitions of which Buildbucket fields are required and
reduce plumbing. Also use the new `BuildMask` type which can be used
for both searching builds and getting a specific build.
Change-Id: Ia5e4e42cb29e558b0783742311d8f20f99c809e3
Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/infra/+/975392
Fuchsia-Auto-Submit: Oliver Newman <olivernewman@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
Reviewed-by: Ina Huh <ihuh@google.com>
3 files changed