From 2cfca6b8f3c6c623a1907054c20f8d597e173ebe Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 17:38:46 -0700 Subject: [PATCH 1/3] chore(main): release pubsub 1.39.0 (#10173) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Alex Hong <9397363+hongalex@users.noreply.github.com> --- .release-please-manifest-individual.json | 2 +- pubsub/CHANGES.md | 15 +++++++++++++++ pubsub/internal/version.go | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest-individual.json b/.release-please-manifest-individual.json index 8e6cb1139ae0..c464ee3c3c54 100644 --- a/.release-please-manifest-individual.json +++ b/.release-please-manifest-individual.json @@ -10,7 +10,7 @@ "firestore": "1.15.0", "logging": "1.10.0", "profiler": "0.4.0", - "pubsub": "1.38.0", + "pubsub": "1.39.0", "pubsublite": "1.8.2", "spanner": "1.63.0", "storage": "1.42.0", diff --git a/pubsub/CHANGES.md b/pubsub/CHANGES.md index ff29d152bf95..168f14596cf9 100644 --- a/pubsub/CHANGES.md +++ b/pubsub/CHANGES.md @@ -1,5 +1,20 @@ # Changes +## [1.39.0](https://github.com/googleapis/google-cloud-go/compare/pubsub/v1.38.0...pubsub/v1.39.0) (2024-06-18) + + +### Features + +* **pubsub/pstest:** Add support to register other servers into grpc.Server ([#9722](https://github.com/googleapis/google-cloud-go/issues/9722)) ([db8216e](https://github.com/googleapis/google-cloud-go/commit/db8216e54c8d9d23dd90bc47a081eb2754f7c92a)) +* **pubsub:** Add service_account_email for export subscriptions ([92dc381](https://github.com/googleapis/google-cloud-go/commit/92dc381da281197567a2c9eb8dc941292000a3da)) +* **pubsub:** Batch receipt modacks ([#10234](https://github.com/googleapis/google-cloud-go/issues/10234)) ([4c2cd10](https://github.com/googleapis/google-cloud-go/commit/4c2cd10fb73b7167c15d6dc24162ad0dac01ce8e)) +* **pubsub:** Make lease management RPCs concurrent ([#10238](https://github.com/googleapis/google-cloud-go/issues/10238)) ([426a8c2](https://github.com/googleapis/google-cloud-go/commit/426a8c27a9d11f24e8c331b6375f87d29829e021)) + + +### Bug Fixes + +* **pubsub:** Closes [#10094](https://github.com/googleapis/google-cloud-go/issues/10094) - memory leak in pubsub receive ([#10153](https://github.com/googleapis/google-cloud-go/issues/10153)) ([66581c4](https://github.com/googleapis/google-cloud-go/commit/66581c44f2309984475fe5053fa11707f6f93b8d)) + ## [1.38.0](https://github.com/googleapis/google-cloud-go/compare/pubsub/v1.37.0...pubsub/v1.38.0) (2024-05-06) diff --git a/pubsub/internal/version.go b/pubsub/internal/version.go index 8d99cbc09de0..385391b28ace 100644 --- a/pubsub/internal/version.go +++ b/pubsub/internal/version.go @@ -15,4 +15,4 @@ package internal // Version is the current tagged release of the library. -const Version = "1.38.0" +const Version = "1.39.0" From 36b70b73fa7e61615dee32d094beafab106a8e9e Mon Sep 17 00:00:00 2001 From: Sri Harsha CH <57220027+harshachinta@users.noreply.github.com> Date: Wed, 19 Jun 2024 14:33:16 +0530 Subject: [PATCH 2/3] chore(spanner): use previous version of cloud.google.com/go (#10390) Co-authored-by: rahul2393 --- spanner/go.mod | 2 +- spanner/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spanner/go.mod b/spanner/go.mod index 9270a7bb9afd..02835582d8a4 100644 --- a/spanner/go.mod +++ b/spanner/go.mod @@ -3,7 +3,7 @@ module cloud.google.com/go/spanner go 1.20 require ( - cloud.google.com/go v0.115.0 + cloud.google.com/go v0.114.0 cloud.google.com/go/iam v1.1.8 cloud.google.com/go/longrunning v0.5.7 github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.5.0 diff --git a/spanner/go.sum b/spanner/go.sum index ac5811bf1a9c..5450eb0ee917 100644 --- a/spanner/go.sum +++ b/spanner/go.sum @@ -36,8 +36,8 @@ cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRY cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= -cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= -cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= +cloud.google.com/go v0.114.0 h1:OIPFAdfrFDFO2ve2U7r/H5SwSbBzEdrBdE7xkgwc+kY= +cloud.google.com/go v0.114.0/go.mod h1:ZV9La5YYxctro1HTPug5lXH/GefROyW8PPD4T8n9J8E= cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= cloud.google.com/go/accessapproval v1.6.0/go.mod h1:R0EiYnwV5fsRFiKZkPHr6mwyk2wxUJ30nL4j2pcFY2E= From d8bd2c1ffc4f27503a74ded438d8bfbdd7707c63 Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Wed, 19 Jun 2024 08:50:20 -0400 Subject: [PATCH 3/3] fix(storage): allow empty soft delete on Create (#10394) Currently setting an empty soft delete policy to disable the feature does not work on bucket creation (only update). This fixes the issue by forcing the library to send a zero value in this case (sending a null does not seem to work). Also adds this case to the relevant integration test. Fixes #10380 --- storage/bucket.go | 3 +++ storage/bucket_test.go | 4 ++-- storage/integration_test.go | 18 +++++++++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/storage/bucket.go b/storage/bucket.go index e69d1e61e28b..d582a60d0e83 100644 --- a/storage/bucket.go +++ b/storage/bucket.go @@ -2123,8 +2123,11 @@ func (p *SoftDeletePolicy) toRawSoftDeletePolicy() *raw.BucketSoftDeletePolicy { return nil } // Excluding read only field EffectiveTime. + // ForceSendFields must be set to send a zero value for RetentionDuration and disable + // soft delete. return &raw.BucketSoftDeletePolicy{ RetentionDurationSeconds: int64(p.RetentionDuration.Seconds()), + ForceSendFields: []string{"RetentionDurationSeconds"}, } } diff --git a/storage/bucket_test.go b/storage/bucket_test.go index de9d2f91426a..fd03c1e41907 100644 --- a/storage/bucket_test.go +++ b/storage/bucket_test.go @@ -172,7 +172,7 @@ func TestBucketAttrsToRawBucket(t *testing.T) { Logging: &raw.BucketLogging{LogBucket: "lb", LogObjectPrefix: "p"}, Website: &raw.BucketWebsite{MainPageSuffix: "mps", NotFoundPage: "404"}, Autoclass: &raw.BucketAutoclass{Enabled: true, TerminalStorageClass: "NEARLINE"}, - SoftDeletePolicy: &raw.BucketSoftDeletePolicy{RetentionDurationSeconds: 60 * 60}, + SoftDeletePolicy: &raw.BucketSoftDeletePolicy{RetentionDurationSeconds: 60 * 60, ForceSendFields: []string{"RetentionDurationSeconds"}}, HierarchicalNamespace: &raw.BucketHierarchicalNamespace{Enabled: true}, Lifecycle: &raw.BucketLifecycle{ Rule: []*raw.BucketLifecycleRule{{ @@ -448,7 +448,7 @@ func TestBucketAttrsToUpdateToRawBucket(t *testing.T) { Website: &raw.BucketWebsite{MainPageSuffix: "mps", NotFoundPage: "404"}, StorageClass: "NEARLINE", Autoclass: &raw.BucketAutoclass{Enabled: true, TerminalStorageClass: "ARCHIVE", ForceSendFields: []string{"Enabled"}}, - SoftDeletePolicy: &raw.BucketSoftDeletePolicy{RetentionDurationSeconds: 3600}, + SoftDeletePolicy: &raw.BucketSoftDeletePolicy{RetentionDurationSeconds: 3600, ForceSendFields: []string{"RetentionDurationSeconds"}}, ForceSendFields: []string{"DefaultEventBasedHold", "Lifecycle", "Autoclass"}, } if msg := testutil.Diff(got, want); msg != "" { diff --git a/storage/integration_test.go b/storage/integration_test.go index 31f102be55f6..3dc0b764b197 100644 --- a/storage/integration_test.go +++ b/storage/integration_test.go @@ -4377,7 +4377,23 @@ func TestIntegration_SoftDelete(t *testing.T) { t.Fatalf("effective time of soft delete policy should not be in the past, got: %v, test start: %v", got.EffectiveTime, testStart.UTC()) } - // Update the soft delete policy. + // Create a second bucket with an empty soft delete policy to verify + // that this leads to no retention. + b2 := client.Bucket(prefix + uidSpace.New()) + if err := b2.Create(ctx, testutil.ProjID(), &BucketAttrs{SoftDeletePolicy: &SoftDeletePolicy{}}); err != nil { + t.Fatalf("error creating bucket with soft delete disabled: %v", err) + } + t.Cleanup(func() { h.mustDeleteBucket(b2) }) + + attrs2, err := b2.Attrs(ctx) + if err != nil { + t.Fatalf("Attrs(%q): %v", b2.name, err) + } + if got, expect := attrs2.SoftDeletePolicy.RetentionDuration, time.Duration(0); got != expect { + t.Fatalf("mismatching retention duration; got: %+v, expected: %+v", got, expect) + } + + // Update the soft delete policy of the original bucket. policy.RetentionDuration = time.Hour * 24 * 9 attrs, err = b.Update(ctx, BucketAttrsToUpdate{SoftDeletePolicy: policy})