[bb] Read args from stdin

Update add, get and cancel subcommands to read builds from stdin if no builds
were provided.

Add -id flag to print only build ids.
Incidentally this fixes crbug.com/747322 that is asking for massive
build cancelation:

  bb ls chromium/try/x -status scheduled -id | bb cancel -reason bad

Refactor buildFieldFlags into printRun which is a base command run for
subcommands that print builds, such as add, get, cancel and ls.

R=hinoka@chromium.org, vadimsh@chromium.org

Bug: 747322
Change-Id: I552b55e159d69570dd32960578af3192f3188c5f
Reviewed-on: https://chromium-review.googlesource.com/c/infra/luci/luci-go/+/1551636
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Ryan Tseng <hinoka@chromium.org>
12 files changed
tree: 2574a172bc6b0e70ad103a5c3b5b86d696aff189
  1. .gitattributes
  2. .travis.yml
  3. AUTHORS
  4. CONTRIBUTING.md
  5. CONTRIBUTORS
  6. LICENSE
  7. OWNERS
  8. PRESUBMIT.py
  9. README.md
  10. appengine/
  11. auth/
  12. buildbucket/
  13. cipd/
  14. client/
  15. codereview.settings
  16. common/
  17. config/
  18. cq/
  19. dm/
  20. examples/
  21. gce/
  22. grpc/
  23. hardcoded/
  24. logdog/
  25. luci_notify/
  26. lucicfg/
  27. lucictx/
  28. machine-db/
  29. milo/
  30. mmutex/
  31. mp/
  32. pre-commit-go.yml
  33. scheduler/
  34. scripts/
  35. server/
  36. starlark/
  37. swarming/
  38. tokenserver/
  39. tools/
  40. tumble/
  41. vpython/
  42. web/
README.md

luci-go: LUCI services and tools in Go

GoDoc

Installing

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

Contributing uses the same flow as Chromium contributions.