Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1026)

Issue 2219023003: Update APIs to use new Google cloud paths. (Closed)

Created:
4 years, 4 months ago by dnj
Modified:
4 years, 4 months ago
CC:
chromium-reviews, infra-reviews+luci-go_chromium.org, andrew.wang, todd, tandrii+luci-go_chromium.org, M-A Ruel
Base URL:
https://github.com/luci/luci-go@master
Target Ref:
refs/heads/master
Project:
luci-go
Visibility:
Public.

Description

Update APIs to use new Google cloud paths. Fixes #24. Because the new cloud APIs also import the Google descriptor protobuf, we now have a "protobuf" package conflict, with our Descriptor protobuf conflicting with the one imported by the cloud framework. Since they don't vendor their protobuf package, we cede our descriptor (re)definition and rework "common/proto/google/descriptor" to be a set of utility functions ("descutil") that operate on the external protobufs. This involved a few rewrites, but nothing major or breaking. BUG=None TEST=None Committed: https://github.com/luci/luci-go/commit/fa4e50dfe3dfdbfeb21a2a5af53a8b39d7473e60

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+7638 lines, -10756 lines) Patch
M appengine/cmd/milo/resp/status_string.go View 1 chunk +2 lines, -2 lines 0 comments Download
M client/flagpb/resolver.go View 2 chunks +6 lines, -2 lines 0 comments Download
M client/flagpb/unmarshal.go View 8 chunks +13 lines, -11 lines 0 comments Download
M client/flagpb/unmarshal_test.go View 2 chunks +4 lines, -2 lines 0 comments Download
M common/api/buildbucket/buildbucket/v1/buildbucket-api.json View 1 chunk +1 line, -1 line 0 comments Download
M common/api/luci_config/config/v1/config-gen.go View 18 chunks +81 lines, -81 lines 0 comments Download
M common/api/swarming/swarming/v1/swarming-api.json View 3 chunks +57 lines, -1 line 0 comments Download
M common/api/swarming/swarming/v1/swarming-gen.go View 41 chunks +338 lines, -161 lines 0 comments Download
M common/auth/auth.go View 1 chunk +1 line, -1 line 0 comments Download
M common/auth/internal/gce.go View 1 chunk +1 line, -1 line 0 comments Download
M common/cloudlogging/client.go View 1 chunk +1 line, -1 line 0 comments Download
M common/gcloud/gs/gs.go View 2 chunks +5 lines, -4 lines 0 comments Download
M common/gcloud/gs/writer.go View 1 chunk +1 line, -1 line 0 comments Download
M common/gcloud/pubsub/quota.go View 1 chunk +1 line, -1 line 0 comments Download
M common/gcloud/pubsub/scopes.go View 1 chunk +1 line, -1 line 0 comments Download
D common/proto/google/descriptor/descriptor.proto View 1 chunk +0 lines, -779 lines 0 comments Download
D common/proto/google/descriptor/descriptor.pb.go View 1 chunk +0 lines, -1976 lines 0 comments Download
D common/proto/google/descriptor/doc.go View 1 chunk +0 lines, -11 lines 0 comments Download
D common/proto/google/descriptor/generate.go View 1 chunk +0 lines, -13 lines 0 comments Download
D common/proto/google/descriptor/util.go View 1 chunk +0 lines, -285 lines 0 comments Download
D common/proto/google/descriptor/util_test.desc View Binary file 0 comments Download
D common/proto/google/descriptor/util_test.go View 1 chunk +0 lines, -72 lines 0 comments Download
D common/proto/google/descriptor/util_test.proto View 1 chunk +0 lines, -82 lines 0 comments Download
D common/proto/google/descriptor/util_test.pb_test.go View 1 chunk +0 lines, -576 lines 0 comments Download
A + common/proto/google/descutil/doc.go View 1 chunk +2 lines, -2 lines 0 comments Download
A + common/proto/google/descutil/generate.go View 1 chunk +1 line, -1 line 0 comments Download
A common/proto/google/descutil/tags.go View 1 chunk +91 lines, -0 lines 3 comments Download
A common/proto/google/descutil/util.go View 1 chunk +251 lines, -0 lines 0 comments Download
A + common/proto/google/descutil/util_test.desc View Binary file 0 comments Download
A + common/proto/google/descutil/util_test.go View 3 chunks +25 lines, -24 lines 0 comments Download
A + common/proto/google/descutil/util_test.proto View 1 chunk +1 line, -1 line 0 comments Download
A + common/proto/google/descutil/util_test.pb_test.go View 22 chunks +73 lines, -55 lines 0 comments Download
M common/tsmon/monitor/pubsub.go View 2 chunks +3 lines, -3 lines 0 comments Download
M dm/api/service/v1/pb.discovery.go View 2 chunks +1835 lines, -1828 lines 0 comments Download
M examples/appengine/helloworld_standard/proto/pb.discovery.go View 1 chunk +1 line, -1 line 0 comments Download
M grpc/cmd/cproto/discovery.go View 2 chunks +2 lines, -2 lines 0 comments Download
M grpc/cmd/cproto/main.go View 1 chunk +2 lines, -1 line 0 comments Download
M grpc/cmd/cproto/testdata/helloworld/pb.discovery.golden View 1 chunk +1 line, -1 line 0 comments Download
M grpc/cmd/cproto/testdata/importGoogle/test.pb.golden View 1 chunk +1 line, -1 line 0 comments Download
M grpc/cmd/cproto/testdata/twoFiles/pb.discovery.golden View 1 chunk +1 line, -1 line 0 comments Download
M grpc/cmd/rpc/descriptor.go View 3 chunks +6 lines, -4 lines 0 comments Download
M grpc/cmd/rpc/printer.go View 9 chunks +11 lines, -9 lines 0 comments Download
M grpc/cmd/rpc/printer_test.go View 5 chunks +10 lines, -8 lines 0 comments Download
M grpc/cmd/rpc/show.go View 3 chunks +4 lines, -3 lines 0 comments Download
M grpc/discovery/discovery.go View 1 chunk +1 line, -1 line 0 comments Download
M grpc/discovery/internal/testservices/discovery_test.go View 2 chunks +8 lines, -6 lines 0 comments Download
M grpc/discovery/internal/testservices/pb.discovery.go View 1 chunk +1 line, -1 line 0 comments Download
M grpc/discovery/pb.discovery.go View 2 chunks +1285 lines, -1234 lines 0 comments Download
M grpc/discovery/registry.go View 1 chunk +1 line, -1 line 0 comments Download
M grpc/discovery/service.pb.go View 1 chunk +1 line, -1 line 0 comments Download
M grpc/prpc/talk/buildbot/proto/pb.discovery.go View 1 chunk +1 line, -1 line 0 comments Download
M grpc/prpc/talk/helloworld/proto/pb.discovery.go View 1 chunk +1 line, -1 line 0 comments Download
M logdog/api/endpoints/coordinator/admin/v1/pb.discovery.go View 2 chunks +175 lines, -171 lines 0 comments Download
M logdog/api/endpoints/coordinator/logs/v1/pb.discovery.go View 2 chunks +1016 lines, -1010 lines 0 comments Download
M logdog/api/endpoints/coordinator/registration/v1/pb.discovery.go View 2 chunks +245 lines, -241 lines 0 comments Download
M logdog/api/endpoints/coordinator/services/v1/pb.discovery.go View 2 chunks +577 lines, -569 lines 0 comments Download
M logdog/appengine/coordinator/archivalPublisher.go View 1 chunk +1 line, -1 line 0 comments Download
M logdog/appengine/coordinator/service.go View 3 chunks +6 lines, -5 lines 0 comments Download
M logdog/client/butler/output/logdog/output.go View 2 chunks +3 lines, -3 lines 0 comments Download
M logdog/client/butler/output/pubsub/pubsubOutput.go View 2 chunks +1 line, -1 line 0 comments Download
M logdog/client/butler/output/pubsub/pubsubOutput_test.go View 2 chunks +1 line, -1 line 0 comments Download
M logdog/common/storage/bigtable/bigtable.go View 1 chunk +1 line, -1 line 0 comments Download
M logdog/common/storage/bigtable/bigtable_test.go View 1 chunk +1 line, -1 line 0 comments Download
M logdog/common/storage/bigtable/initialize.go View 1 chunk +1 line, -1 line 0 comments Download
M logdog/common/storage/bigtable/storage.go View 2 chunks +4 lines, -3 lines 0 comments Download
M logdog/server/cmd/logdog_archivist/main.go View 3 chunks +5 lines, -12 lines 0 comments Download
M logdog/server/cmd/logdog_archivist/task.go View 3 chunks +4 lines, -31 lines 1 comment Download
M logdog/server/cmd/logdog_collector/main.go View 2 chunks +4 lines, -3 lines 0 comments Download
M logdog/server/service/service.go View 2 chunks +5 lines, -4 lines 0 comments Download
M server/static/rpcexplorer/test/gen.go View 1 chunk +1 line, -1 line 0 comments Download
M tokenserver/api/admin/v1/pb.discovery.go View 2 chunks +589 lines, -584 lines 0 comments Download
M tokenserver/api/identity/v1/pb.discovery.go View 2 chunks +184 lines, -180 lines 0 comments Download
M tokenserver/api/minter/v1/pb.discovery.go View 2 chunks +680 lines, -676 lines 0 comments Download
M web/inc/rpcexplorer/test/gen.go View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 15 (4 generated)
dnj
PTAL. This includes a regenerate and some re-plumbing of the descriptor / discovery code since ...
4 years, 4 months ago (2016-08-05 16:37:00 UTC) #2
nodir
lgtm, except the rant about your approach to code complexity https://codereview.chromium.org/2219023003/diff/1/common/proto/google/descutil/tags.go File common/proto/google/descutil/tags.go (right): https://codereview.chromium.org/2219023003/diff/1/common/proto/google/descutil/tags.go#newcode52 ...
4 years, 4 months ago (2016-08-05 17:15:39 UTC) #3
dnj (Google)
https://codereview.chromium.org/2219023003/diff/1/common/proto/google/descutil/tags.go File common/proto/google/descutil/tags.go (right): https://codereview.chromium.org/2219023003/diff/1/common/proto/google/descutil/tags.go#newcode52 common/proto/google/descutil/tags.go:52: resolveTagsFor(&pb.FileDescriptorProto{}, func(resolve func(string) int) { On 2016/08/05 17:15:38, nodir ...
4 years, 4 months ago (2016-08-05 18:21:57 UTC) #5
nodir
On 2016/08/05 18:21:57, dnj (Google) wrote: > https://codereview.chromium.org/2219023003/diff/1/common/proto/google/descutil/tags.go > File common/proto/google/descutil/tags.go (right): > > https://codereview.chromium.org/2219023003/diff/1/common/proto/google/descutil/tags.go#newcode52 ...
4 years, 4 months ago (2016-08-05 18:32:36 UTC) #6
dnj (Google)
On 2016/08/05 18:32:36, nodir wrote: > On 2016/08/05 18:21:57, dnj (Google) wrote: > > > ...
4 years, 4 months ago (2016-08-05 18:37:50 UTC) #7
dnj (Google)
On 2016/08/05 18:37:50, dnj (Google) wrote: > On 2016/08/05 18:32:36, nodir wrote: > > On ...
4 years, 4 months ago (2016-08-05 18:51:45 UTC) #8
nodir
On 2016/08/05 18:37:50, dnj (Google) wrote: > On 2016/08/05 18:32:36, nodir wrote: > > On ...
4 years, 4 months ago (2016-08-05 19:10:37 UTC) #9
nodir
landing this because luci-go is broken now and this will fix it
4 years, 4 months ago (2016-08-05 20:48:50 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2219023003/1
4 years, 4 months ago (2016-08-05 20:49:03 UTC) #12
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://github.com/luci/luci-go/commit/fa4e50dfe3dfdbfeb21a2a5af53a8b39d7473e60
4 years, 4 months ago (2016-08-05 21:06:36 UTC) #14
dnj
4 years, 4 months ago (2016-08-06 05:42:25 UTC) #15
Message was sent while issue was closed.
> it is:
> - it assumes "protobuf" go field tag. How that is more stable than constants?

This assumption is a contract between the Go protobuf library and its protobuf
generator adapter which are, minimally, versioned alongside each other. This is
a far stronger contract than the details of any given proto file.

> - it does reflection, tag parsing and creates unnecessary objects for
something
> known at compile time. it is close to writing an init() function to compute
the
> value of math.Pi

All of this complexity is part of the standard library. We don't have to
maintain it, which is your argument against complexity. Unless you think we
shouldn't use maps for things because behind the scenes they use rebalancing
hash tables and race checks? Your problem with complexity is a function of the
maintainability of that complexity, and in this case the maintainability of
these specific functions is very simple.

> > It's more complex than hardcoded numbers, but
> > it's also less magic.
> 
> field comments explicitly say where these numbers came from, there is no magic
> if it is not enough, we can point the reader at .proto file

There's no comment saying, "we chose 4 for this field because...". They picked
mostly sequential numbers. They might change. They might not change. We don't
know what constraints the protobuf package authors are applying to this proto,
under what circumstances they'll break backwards compatibility, and what their
perception of the liberty they have to govern the producers and consumers of the
protobuf. What I know: we are not known to them, so our usage isn't part of
their plan, regardless. I don't think baking unasserted assumptions into the
code based on a presumption of their operating mentality is a good idea.

Powered by Google App Engine
This is Rietveld 408576698