Replace google.golang.org/api/bigquery/v2 with cloud.google.com/go/bigquery and update corresponding mocks in tests.
From https://chromium-review.googlesource.com/c/475812/32/go%252Fsrc%252Finfra%252Fappengine%252Ftest-results%252Ffrontend%252Ftestflakiness.go#33:
ATM you're using the low-level API that the higher-level "bigquery" package uses. That API is part of a larger Google Cloud API generation and release process for other Google Cloud libraries. It, too, may change how it works internally at any time. However, its API is oriented towards coordinated usage with the higher-level APIs, and those would be adapted alongside changes to the lower-level APIs with deep knowledge of how those APIs work and how the change works.
For an example of those, note how you didn't realize that you should use ".Context(ctx)" in your BQ call. This is something the higher-level API makes explicit, and implicitly translates into The Right Thing when using the lower-level API. If the lower-level API ever changes how it uses Context or how any of its methods behave, the higher-level API will adapt and your code will break.
Other reasons include:
If there were to be a generic BigQuery mock package (think like luci/gae) or lesser forms of that (general mocks), it would be done at the higher-level package API.
Other Infra projects are using the higher-level API.
It implements some higher-level abstraction that is useful to clients, rather than a raw call API.
It protects you from mistakes (such as Context) more than the lower-level API does.
Though it is in beta, it is also probably won't change too much. LUCI used a lot of higher-level beta Go APIs (Storage, Cloud Datastore, PubSub, Logging), and while breaking changes weren't exactly painless, they were infrequent and not really a big deal.
Comment 1 by serg...@chromium.org
, Jul 31 2017Owner: serg...@chromium.org
Status: Assigned (was: Available)