Skip to content

Commit

Permalink
fix(bigtable): move usage to local proto definitions (#10598)
Browse files Browse the repository at this point in the history
Changes generated with: `cloud.google.com/go/internal/aliasfix/cmd/aliasfix`
  • Loading branch information
codyoss authored Jul 25, 2024
1 parent 485d54b commit ce31365
Show file tree
Hide file tree
Showing 31 changed files with 73 additions and 41 deletions.
2 changes: 1 addition & 1 deletion bigtable/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"strings"
"time"

btapb "cloud.google.com/go/bigtable/admin/apiv2/adminpb"
btopt "cloud.google.com/go/bigtable/internal/option"
"cloud.google.com/go/iam"
"cloud.google.com/go/internal/optional"
Expand All @@ -36,7 +37,6 @@ import (
"google.golang.org/api/iterator"
"google.golang.org/api/option"
gtransport "google.golang.org/api/transport/grpc"
btapb "google.golang.org/genproto/googleapis/bigtable/admin/v2"
"google.golang.org/genproto/googleapis/rpc/status"
"google.golang.org/grpc/metadata"
"google.golang.org/protobuf/types/known/durationpb"
Expand Down
2 changes: 1 addition & 1 deletion bigtable/admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import (
"testing"
"time"

btapb "cloud.google.com/go/bigtable/admin/apiv2/adminpb"
"cloud.google.com/go/internal/pretty"
"cloud.google.com/go/internal/testutil"
longrunning "cloud.google.com/go/longrunning/autogen/longrunningpb"
"github.com/google/go-cmp/cmp"
btapb "google.golang.org/genproto/googleapis/bigtable/admin/v2"
"google.golang.org/grpc"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/timestamppb"
Expand Down
24 changes: 24 additions & 0 deletions bigtable/aliasshim.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bigtable/bigtable.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ import (
"strings"
"time"

btpb "cloud.google.com/go/bigtable/apiv2/bigtablepb"
btopt "cloud.google.com/go/bigtable/internal/option"
"cloud.google.com/go/internal/trace"
gax "github.com/googleapis/gax-go/v2"
"go.opentelemetry.io/otel/metric"
"google.golang.org/api/option"
"google.golang.org/api/option/internaloption"
gtransport "google.golang.org/api/transport/grpc"
btpb "google.golang.org/genproto/googleapis/bigtable/v2"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
Expand Down
2 changes: 1 addition & 1 deletion bigtable/bigtable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
"testing"
"time"

btpb "cloud.google.com/go/bigtable/apiv2/bigtablepb"
"github.com/google/go-cmp/cmp"
"google.golang.org/api/option"
btpb "google.golang.org/genproto/googleapis/bigtable/v2"
"google.golang.org/grpc"
)

Expand Down
4 changes: 2 additions & 2 deletions bigtable/bttest/inmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ import (
"google.golang.org/grpc/metadata"
"google.golang.org/protobuf/proto"

btapb "cloud.google.com/go/bigtable/admin/apiv2/adminpb"
btpb "cloud.google.com/go/bigtable/apiv2/bigtablepb"
longrunning "cloud.google.com/go/longrunning/autogen/longrunningpb"
"github.com/google/btree"
btapb "google.golang.org/genproto/googleapis/bigtable/admin/v2"
btpb "google.golang.org/genproto/googleapis/bigtable/v2"
statpb "google.golang.org/genproto/googleapis/rpc/status"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
Expand Down
4 changes: 2 additions & 2 deletions bigtable/bttest/inmem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import (

"google.golang.org/grpc/metadata"

btapb "cloud.google.com/go/bigtable/admin/apiv2/adminpb"
btpb "cloud.google.com/go/bigtable/apiv2/bigtablepb"
"cloud.google.com/go/bigtable/internal/option"
"cloud.google.com/go/internal/testutil"
"github.com/google/go-cmp/cmp"
btapb "google.golang.org/genproto/googleapis/bigtable/admin/v2"
btpb "google.golang.org/genproto/googleapis/bigtable/v2"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
2 changes: 1 addition & 1 deletion bigtable/bttest/instance_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"context"
"regexp"

btapb "cloud.google.com/go/bigtable/admin/apiv2/adminpb"
"cloud.google.com/go/iam/apiv1/iampb"
longrunning "cloud.google.com/go/longrunning/autogen/longrunningpb"
btapb "google.golang.org/genproto/googleapis/bigtable/admin/v2"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
Expand Down
2 changes: 1 addition & 1 deletion bigtable/bttest/instance_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"context"
"testing"

btapb "google.golang.org/genproto/googleapis/bigtable/admin/v2"
btapb "cloud.google.com/go/bigtable/admin/apiv2/adminpb"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
Expand Down
2 changes: 1 addition & 1 deletion bigtable/bttest/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package bttest
import (
"bytes"

btpb "google.golang.org/genproto/googleapis/bigtable/v2"
btpb "cloud.google.com/go/bigtable/apiv2/bigtablepb"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
Expand Down
2 changes: 1 addition & 1 deletion bigtable/bttest/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package bttest
import (
"testing"

btpb "google.golang.org/genproto/googleapis/bigtable/v2"
btpb "cloud.google.com/go/bigtable/apiv2/bigtablepb"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
Expand Down
2 changes: 1 addition & 1 deletion bigtable/conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (
"testing"
"time"

btpb "cloud.google.com/go/bigtable/apiv2/bigtablepb"
pb "cloud.google.com/go/bigtable/internal/conformance"
"cloud.google.com/go/bigtable/internal/mockserver"
"google.golang.org/api/option"
btpb "google.golang.org/genproto/googleapis/bigtable/v2"
"google.golang.org/grpc"
"google.golang.org/protobuf/encoding/protojson"
)
Expand Down
2 changes: 1 addition & 1 deletion bigtable/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"strings"
"time"

btpb "google.golang.org/genproto/googleapis/bigtable/v2"
btpb "cloud.google.com/go/bigtable/apiv2/bigtablepb"
)

// A Filter represents a row filter.
Expand Down
2 changes: 1 addition & 1 deletion bigtable/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"strings"
"time"

bttdpb "google.golang.org/genproto/googleapis/bigtable/admin/v2"
bttdpb "cloud.google.com/go/bigtable/admin/apiv2/adminpb"
"google.golang.org/protobuf/types/known/durationpb"
)

Expand Down
2 changes: 1 addition & 1 deletion bigtable/gc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"testing"
"time"

bttdpb "google.golang.org/genproto/googleapis/bigtable/admin/v2"
bttdpb "cloud.google.com/go/bigtable/admin/apiv2/adminpb"
)

func TestGcRuleToString(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions bigtable/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ go 1.20

require (
cloud.google.com/go v0.115.0
cloud.google.com/go/iam v1.1.10
cloud.google.com/go/longrunning v0.5.9
cloud.google.com/go/iam v1.1.11
cloud.google.com/go/longrunning v0.5.10
github.com/google/btree v1.1.2
github.com/google/go-cmp v0.6.0
github.com/googleapis/cloud-bigtable-clients-test v0.0.2
Expand All @@ -15,15 +15,15 @@ require (
go.opentelemetry.io/otel/sdk v1.24.0 // Use older version compatible with Go 1.20
go.opentelemetry.io/otel/sdk/metric v1.24.0 // Use older version compatible with Go 1.20
google.golang.org/api v0.189.0
google.golang.org/genproto v0.0.0-20240722135656-d784300faade
google.golang.org/genproto v0.0.0-20240725213756-90e476079158
google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade
google.golang.org/grpc v1.64.1
google.golang.org/protobuf v1.34.2
rsc.io/binaryregexp v0.2.0
)

require (
cloud.google.com/go/monitoring v1.20.1
cloud.google.com/go/monitoring v1.20.2
github.com/google/uuid v1.6.0
google.golang.org/genproto/googleapis/api v0.0.0-20240722135656-d784300faade
)
Expand Down
16 changes: 8 additions & 8 deletions bigtable/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ cloud.google.com/go/auth/oauth2adapt v0.2.3 h1:MlxF+Pd3OmSudg/b1yZ5lJwoXCEaeedAg
cloud.google.com/go/auth/oauth2adapt v0.2.3/go.mod h1:tMQXOfZzFuNuUxOypHlQEXgdfX5cuhwU+ffUuXRJE8I=
cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY=
cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY=
cloud.google.com/go/iam v1.1.10 h1:ZSAr64oEhQSClwBL670MsJAW5/RLiC6kfw3Bqmd5ZDI=
cloud.google.com/go/iam v1.1.10/go.mod h1:iEgMq62sg8zx446GCaijmA2Miwg5o3UbO+nI47WHJps=
cloud.google.com/go/longrunning v0.5.9 h1:haH9pAuXdPAMqHvzX0zlWQigXT7B0+CL4/2nXXdBo5k=
cloud.google.com/go/longrunning v0.5.9/go.mod h1:HD+0l9/OOW0za6UWdKJtXoFAX/BGg/3Wj8p10NeWF7c=
cloud.google.com/go/monitoring v1.20.1 h1:XmM6uk4+mI2ZhWdI2n/2GNhJdpeQN+1VdG2UWEDhX48=
cloud.google.com/go/monitoring v1.20.1/go.mod h1:FYSe/brgfuaXiEzOQFhTjsEsJv+WePyK71X7Y8qo6uQ=
cloud.google.com/go/iam v1.1.11 h1:0mQ8UKSfdHLut6pH9FM3bI55KWR46ketn0PuXleDyxw=
cloud.google.com/go/iam v1.1.11/go.mod h1:biXoiLWYIKntto2joP+62sd9uW5EpkZmKIvfNcTWlnQ=
cloud.google.com/go/longrunning v0.5.10 h1:eB/BniENNRKhjz/xgiillrdcH3G74TGSl3BXinGlI7E=
cloud.google.com/go/longrunning v0.5.10/go.mod h1:tljz5guTr5oc/qhlUjBlk7UAIFMOGuPNxkNDZXlLics=
cloud.google.com/go/monitoring v1.20.2 h1:B/L+xrw9PYO7ywh37sgnjI/6dzEE+yQTAwfytDcpPto=
cloud.google.com/go/monitoring v1.20.2/go.mod h1:36rpg/7fdQ7NX5pG5x1FA7cXTVXusOp6Zg9r9e1+oek=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g=
Expand Down Expand Up @@ -155,8 +155,8 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20240722135656-d784300faade h1:lKFsS7wpngDgSCeFn7MoLy+wBDQZ1UQIJD4UNM1Qvkg=
google.golang.org/genproto v0.0.0-20240722135656-d784300faade/go.mod h1:FfBgJBJg9GcpPvKIuHSZ/aE1g2ecGL74upMzGZjiGEY=
google.golang.org/genproto v0.0.0-20240725213756-90e476079158 h1:xGRZVaxMSQ65qWv+kQRrh8+RqGHAJELFga9qlJzrt7o=
google.golang.org/genproto v0.0.0-20240725213756-90e476079158/go.mod h1:od+6rA98elHRdDlQTg6Lok9YQJ8hYumTbgVBUbM/YXw=
google.golang.org/genproto/googleapis/api v0.0.0-20240722135656-d784300faade h1:WxZOF2yayUHpHSbUE6NMzumUzBxYc3YGwo0YHnbzsJY=
google.golang.org/genproto/googleapis/api v0.0.0-20240722135656-d784300faade/go.mod h1:mw8MG/Qz5wfgYr6VqVCiZcHe/GJEfI+oGGDCohaVgB0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade h1:oCRSWfwGXQsqlVdErcyTt4A93Y8fo0/9D4b1gnI++qo=
Expand Down
2 changes: 1 addition & 1 deletion bigtable/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"testing"
"time"

btapb "cloud.google.com/go/bigtable/admin/apiv2/adminpb"
"cloud.google.com/go/iam"
"cloud.google.com/go/internal"
"cloud.google.com/go/internal/optional"
Expand All @@ -43,7 +44,6 @@ import (
"github.com/google/go-cmp/cmp"
gax "github.com/googleapis/gax-go/v2"
"google.golang.org/api/iterator"
btapb "google.golang.org/genproto/googleapis/bigtable/admin/v2"
grpc "google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
2 changes: 1 addition & 1 deletion bigtable/internal/conformance/tests.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bigtable/internal/mockserver/inmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"net"

btpb "google.golang.org/genproto/googleapis/bigtable/v2"
btpb "cloud.google.com/go/bigtable/apiv2/bigtablepb"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
2 changes: 1 addition & 1 deletion bigtable/internal/option/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"os"

btpb "google.golang.org/genproto/googleapis/bigtable/v2"
btpb "cloud.google.com/go/bigtable/apiv2/bigtablepb"
"google.golang.org/protobuf/proto"

"cloud.google.com/go/bigtable/internal"
Expand Down
2 changes: 1 addition & 1 deletion bigtable/internal/testproxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
"time"

"cloud.google.com/go/bigtable"
btpb "cloud.google.com/go/bigtable/apiv2/bigtablepb"
pb "github.com/googleapis/cloud-bigtable-clients-test/testproxypb"
"google.golang.org/api/option"
btpb "google.golang.org/genproto/googleapis/bigtable/v2"
statpb "google.golang.org/genproto/googleapis/rpc/status"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
Expand Down
2 changes: 1 addition & 1 deletion bigtable/internal/testproxy/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (
"testing"

"cloud.google.com/go/bigtable"
btpb "cloud.google.com/go/bigtable/apiv2/bigtablepb"
"cloud.google.com/go/bigtable/bttest"
pb "github.com/googleapis/cloud-bigtable-clients-test/testproxypb"
"google.golang.org/api/option"
btpb "google.golang.org/genproto/googleapis/bigtable/v2"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials/insecure"
Expand Down
2 changes: 1 addition & 1 deletion bigtable/metric_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"strconv"
"strings"

btpb "google.golang.org/genproto/googleapis/bigtable/v2"
btpb "cloud.google.com/go/bigtable/apiv2/bigtablepb"
"google.golang.org/grpc/metadata"
"google.golang.org/protobuf/proto"
)
Expand Down
2 changes: 1 addition & 1 deletion bigtable/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (
"testing"
"time"

btpb "cloud.google.com/go/bigtable/apiv2/bigtablepb"
"cloud.google.com/go/internal/testutil"
"github.com/google/go-cmp/cmp/cmpopts"
"go.opentelemetry.io/otel/attribute"
"google.golang.org/api/option"
btpb "google.golang.org/genproto/googleapis/bigtable/v2"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials/insecure"
Expand Down
2 changes: 1 addition & 1 deletion bigtable/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"
"strings"

btpb "google.golang.org/genproto/googleapis/bigtable/v2"
btpb "cloud.google.com/go/bigtable/apiv2/bigtablepb"
)

// A Row is returned by ReadRows. The map is keyed by column family (the prefix
Expand Down
2 changes: 1 addition & 1 deletion bigtable/reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"strings"
"testing"

btspb "cloud.google.com/go/bigtable/apiv2/bigtablepb"
"cloud.google.com/go/internal/testutil"
btspb "google.golang.org/genproto/googleapis/bigtable/v2"
"google.golang.org/protobuf/encoding/prototext"
"google.golang.org/protobuf/types/known/wrapperspb"
)
Expand Down
2 changes: 1 addition & 1 deletion bigtable/retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"testing"
"time"

btpb "cloud.google.com/go/bigtable/apiv2/bigtablepb"
"cloud.google.com/go/bigtable/bttest"
"cloud.google.com/go/internal/testutil"
"github.com/google/go-cmp/cmp"
"google.golang.org/api/option"
btpb "google.golang.org/genproto/googleapis/bigtable/v2"
rpcpb "google.golang.org/genproto/googleapis/rpc/status"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
Expand Down
2 changes: 1 addition & 1 deletion bigtable/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

package bigtable

import btapb "google.golang.org/genproto/googleapis/bigtable/admin/v2"
import btapb "cloud.google.com/go/bigtable/admin/apiv2/adminpb"

// Type wraps the protobuf representation of a type. See the protobuf definition
// for more details on types.
Expand Down
2 changes: 1 addition & 1 deletion bigtable/type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package bigtable
import (
"testing"

btapb "google.golang.org/genproto/googleapis/bigtable/admin/v2"
btapb "cloud.google.com/go/bigtable/admin/apiv2/adminpb"
"google.golang.org/protobuf/proto"
)

Expand Down
8 changes: 8 additions & 0 deletions internal/aliasfix/mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ var GenprotoPkgMigration map[string]Pkg = map[string]Pkg{
ImportPath: "cloud.google.com/go/area120/tables/apiv1alpha1/tablespb",
Status: StatusMigrated,
},
"google.golang.org/genproto/googleapis/bigtable/admin/v2": {
ImportPath: "cloud.google.com/go/bigtable/admin/apiv2/adminpb",
Status: StatusMigrated,
},
"google.golang.org/genproto/googleapis/bigtable/v2": {
ImportPath: "cloud.google.com/go/bigtable/apiv2/bigtablepb",
Status: StatusMigrated,
},
"google.golang.org/genproto/googleapis/cloud/accessapproval/v1": {
ImportPath: "cloud.google.com/go/accessapproval/apiv1/accessapprovalpb",
Status: StatusMigrated,
Expand Down

0 comments on commit ce31365

Please sign in to comment.