[fx] Add fx min-owners

fx min-owners suggests the smallest set of reviewers who together own
every file changed in a commit or range. It gets each file's owners
from the Gerrit code-owners plugin and searches for the fewest owners
who cover everything, preferring closer OWNERS files. `--all` lists
every smallest set, grouping owners who are interchangeable. For very
large changes the search gives up and falls back to a greedy pick. If
more than 5 reviewers are needed, it points to the owners-override
docs.

Ties between equally close owners are broken randomly so reviews don't
always go to whoever sorts first. The randomness is seeded by the date
and the author, so reruns on the same day agree.

Root OWNERS members are only used as a fallback, since they'd otherwise
always be picked. This mostly matters for repos like vendor/google,
because fuchsia.git's root OWNERS lists no users. Owners whose calendar
says they're out of office, and who won't be back within 4 hours, are
treated the same way. That check uses Gerrit's availability plugin,
which needs a Gaia OAuth token. The tool gets one from the luci-auth
prebuilt, or from a luci-auth on PATH. Without a token, it prints a
note and skips the check.

The tool works anonymously against public hosts and falls back to
gob-curl for hosts that need auth, like turquoise-internal.

TAG=agy
CONV=9b37fb31-b119-4ea3-9a17-9a01d535484a

Test: New min_owners_test unit tests; ran fx min-owners on fuchsia.git
  and vendor/google commits and ranges.
Change-Id: I2c494c14560998adad5edc415db6015ea275879d
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1877287
Reviewed-by: Clayton Wilkinson <wilkinsonclay@google.com>
Fuchsia-Auto-Submit: Oliver Newman <olivernewman@google.com>
Commit-Queue: Oliver Newman <olivernewman@google.com>
5 files changed