Skip to content

Commit

Permalink
chore: bulk update version for manual (#5516)
Browse files Browse the repository at this point in the history
This changes bulk updates all manuals that has reference to the
old version.Repo that has been a long incorrect value. This new
version files will be maintained by release please.

Updates: #2749

feat(bigquery): add better version metadata to calls

feat(datastore): add better version metadata to calls

feat(errorreporting): add better version metadata to calls

feat(firestore): add better version metadata to calls

feat(logging): add better version metadata to calls

feat(profiler): add better version metadata to calls

feat(pubsub): add better version metadata to calls

feat(translate): add better version metadata to calls
  • Loading branch information
codyoss committed Feb 11, 2022
1 parent 17b36ea commit d1ad921
Show file tree
Hide file tree
Showing 21 changed files with 169 additions and 462 deletions.
9 changes: 5 additions & 4 deletions bigquery/bigquery.go
Expand Up @@ -23,7 +23,8 @@ import (
"strings"
"time"

"cloud.google.com/go/internal"
"cloud.google.com/go/bigquery/internal"
cloudinternal "cloud.google.com/go/internal"
"cloud.google.com/go/internal/detect"
"cloud.google.com/go/internal/version"
gax "github.com/googleapis/gax-go/v2"
Expand All @@ -40,7 +41,7 @@ const (
userAgentPrefix = "gcloud-golang-bigquery"
)

var xGoogHeader = fmt.Sprintf("gl-go/%s gccl/%s", version.Go(), version.Repo)
var xGoogHeader = fmt.Sprintf("gl-go/%s gccl/%s", version.Go(), internal.Version)

func setClientHeader(headers http.Header) {
headers.Set("x-goog-api-client", xGoogHeader)
Expand Down Expand Up @@ -74,7 +75,7 @@ const DetectProjectID = "*detect-project-id*"
func NewClient(ctx context.Context, projectID string, opts ...option.ClientOption) (*Client, error) {
o := []option.ClientOption{
option.WithScopes(Scope),
option.WithUserAgent(fmt.Sprintf("%s/%s", userAgentPrefix, version.Repo)),
option.WithUserAgent(fmt.Sprintf("%s/%s", userAgentPrefix, internal.Version)),
}
o = append(o, opts...)
bqs, err := bq.NewService(ctx, o...)
Expand Down Expand Up @@ -185,7 +186,7 @@ func runWithRetryExplicit(ctx context.Context, call func() error, allowedReasons
Max: 32 * time.Second,
Multiplier: 2,
}
return internal.Retry(ctx, backoff, func() (stop bool, err error) {
return cloudinternal.Retry(ctx, backoff, func() (stop bool, err error) {
err = call()
if err == nil {
return true, nil
Expand Down
18 changes: 18 additions & 0 deletions bigquery/internal/version.go
@@ -0,0 +1,18 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package internal

// Version is the current tagged release of the library.
const Version = "1.27.0"
7 changes: 4 additions & 3 deletions datastore/client.go
Expand Up @@ -19,7 +19,8 @@ import (
"fmt"
"time"

"cloud.google.com/go/internal"
"cloud.google.com/go/datastore/internal"
cloudinternal "cloud.google.com/go/internal"
"cloud.google.com/go/internal/trace"
"cloud.google.com/go/internal/version"
gax "github.com/googleapis/gax-go/v2"
Expand All @@ -46,7 +47,7 @@ func newDatastoreClient(conn grpc.ClientConnInterface, projectID string) pb.Data
c: pb.NewDatastoreClient(conn),
md: metadata.Pairs(
resourcePrefixHeader, "projects/"+projectID,
"x-goog-api-client", fmt.Sprintf("gl-go/%s gccl/%s grpc/", version.Go(), version.Repo)),
"x-goog-api-client", fmt.Sprintf("gl-go/%s gccl/%s grpc/", version.Go(), internal.Version)),
}
}

Expand Down Expand Up @@ -118,7 +119,7 @@ func (dc *datastoreClient) AllocateIds(ctx context.Context, in *pb.AllocateIdsRe

func (dc *datastoreClient) invoke(ctx context.Context, f func(ctx context.Context) error) error {
ctx = metadata.NewOutgoingContext(ctx, dc.md)
return internal.Retry(ctx, gax.Backoff{Initial: 100 * time.Millisecond}, func() (stop bool, err error) {
return cloudinternal.Retry(ctx, gax.Backoff{Initial: 100 * time.Millisecond}, func() (stop bool, err error) {
err = f(ctx)
return !shouldRetry(err), err
})
Expand Down
18 changes: 18 additions & 0 deletions datastore/internal/version.go
@@ -0,0 +1,18 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package internal

// Version is the current tagged release of the library.
const Version = "1.6.0"
4 changes: 2 additions & 2 deletions errorreporting/errors.go
Expand Up @@ -33,7 +33,7 @@ import (
"time"

vkit "cloud.google.com/go/errorreporting/apiv1beta1"
"cloud.google.com/go/internal/version"
"cloud.google.com/go/errorreporting/internal"
"github.com/golang/protobuf/ptypes"
gax "github.com/googleapis/gax-go/v2"
"google.golang.org/api/option"
Expand Down Expand Up @@ -88,7 +88,7 @@ var newClient = func(ctx context.Context, opts ...option.ClientOption) (client,
if err != nil {
return nil, err
}
client.SetGoogleClientInfo("gccl", version.Repo)
client.SetGoogleClientInfo("gccl", internal.Version)
return client, nil
}

Expand Down
18 changes: 18 additions & 0 deletions errorreporting/internal/version.go
@@ -0,0 +1,18 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package internal

// Version is the current tagged release of the library.
const Version = "0.1.0"
4 changes: 2 additions & 2 deletions firestore/client.go
Expand Up @@ -24,8 +24,8 @@ import (
"time"

vkit "cloud.google.com/go/firestore/apiv1"
"cloud.google.com/go/firestore/internal"
"cloud.google.com/go/internal/trace"
"cloud.google.com/go/internal/version"
"github.com/golang/protobuf/ptypes"
gax "github.com/googleapis/gax-go/v2"
"google.golang.org/api/iterator"
Expand Down Expand Up @@ -92,7 +92,7 @@ func NewClient(ctx context.Context, projectID string, opts ...option.ClientOptio
if err != nil {
return nil, err
}
vc.SetGoogleClientInfo("gccl", version.Repo)
vc.SetGoogleClientInfo("gccl", internal.Version)
c := &Client{
c: vc,
projectID: projectID,
Expand Down
16 changes: 0 additions & 16 deletions firestore/internal/Makefile

This file was deleted.

162 changes: 0 additions & 162 deletions firestore/internal/doc-snippets.go

This file was deleted.

0 comments on commit d1ad921

Please sign in to comment.