branch_util: add API-based branch creation subcommand

This is the result of copying the "create" subcommand, then switching
several components from using Git checkouts to using Gerrit APIs.

* Instead of checking out manifest-versions (which is enormous and takes
several minutes), the user instead inputs a specific buildspec, and so
we just get that single buildspec file.
* Same thing for getting chromeos_version.sh from the chromiumos-overlay
* Instead of checking out all 500+ Chrome OS repos just to push back a
ref update, we use the Gerrit Project Create API to create a new branch
based on an existing ref.

I did extensive local testing of this. This package needs a good
refactoring, since everything is in "main" at the moment, and that's
very bad for testability. I'll do that refactor and write some tests in
a followup. The tests will almost necessarily be underwhelming, since
all of the interesting parts of this program happen in the Gerrit
interactions (which would be mocked).

This uses an open source Gerrit client, since there's no internal
alternative that I know of. This library is quite popular, and it's also
used by the Skia project.

BUG=chromium:1069862
TEST=lots of local testing; more unit tests to come

Change-Id: If0cb725af45233cbb4bb0f347a98feb679b3eefe
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/infra/go/+/2261438
Reviewed-by: Mike Nichols <mikenichols@chromium.org>
Commit-Queue: Sean Abraham <seanabraham@chromium.org>
Tested-by: Sean Abraham <seanabraham@chromium.org>
14 files changed