feat(pubsub): add support for snapshot labels#6835
Merged
hongalex merged 4 commits intogoogleapis:mainfrom Oct 11, 2022
Merged
Conversation
shollyman
approved these changes
Oct 11, 2022
pubsub/snapshot.go
Outdated
| return s.name[slash+1:] | ||
| } | ||
|
|
||
| // SetLabels replaces the current set of labels completely with the new set. |
Contributor
There was a problem hiding this comment.
Maybe "SetLabels set or replaces the labels on a given snapshot."
The existing docstring seems overly focused on the replace case.
pubsub/snapshot.go
Outdated
| Labels: label, | ||
| }, | ||
| UpdateMask: &fmpb.FieldMask{ | ||
| Paths: fields, |
Contributor
There was a problem hiding this comment.
you don't appear to manipulate the fields in the mask, maybe just declare the paths using a literal ex:
Paths: []string{"labels"},
shollyman
reviewed
Oct 11, 2022
pubsub/snapshot.go
Outdated
| } | ||
|
|
||
| // SetLabels replaces the current set of labels completely with the new set. | ||
| // SetLabels set or replaces the labels on a given snapshot. |
Contributor
There was a problem hiding this comment.
set -> sets? Clearly I am a dubious provider of docstring advice.
gcf-merge-on-green bot
pushed a commit
that referenced
this pull request
Oct 24, 2022
🤖 I have created a release *beep* *boop* --- ## [1.26.0](https://togithub.com/googleapis/google-cloud-go/compare/pubsub/v1.25.1...pubsub/v1.26.0) (2022-10-24) ### Features * **pubsub:** Add support for snapshot labels ([#6835](https://togithub.com/googleapis/google-cloud-go/issues/6835)) ([c17851b](https://togithub.com/googleapis/google-cloud-go/commit/c17851b5c3d811cd3e6a28162f0e399bb31a1363)) ### Bug Fixes * **pubsub:** Remove unused AckResult map ([#6656](https://togithub.com/googleapis/google-cloud-go/issues/6656)) ([5f69002](https://togithub.com/googleapis/google-cloud-go/commit/5f690022551ac584e5c66af4324a17d7044a898d)) ### Documentation * **pubsub:** Fix comments on message for exactly once delivery ([#6878](https://togithub.com/googleapis/google-cloud-go/issues/6878)) ([a8109e2](https://togithub.com/googleapis/google-cloud-go/commit/a8109e2d3257d1698ce1b751618428ef25cbb859)), refs [#6877](https://togithub.com/googleapis/google-cloud-go/issues/6877) * **pubsub:** Update streams section ([#6682](https://togithub.com/googleapis/google-cloud-go/issues/6682)) ([7b4e2b4](https://togithub.com/googleapis/google-cloud-go/commit/7b4e2b412058f965a9f9159231afe551a6f58a74)) * **pubsub:** Update subscription retry policy defaults ([#6909](https://togithub.com/googleapis/google-cloud-go/issues/6909)) ([c5c2f8f](https://togithub.com/googleapis/google-cloud-go/commit/c5c2f8f7125034c611edf1d08ca35ece6554c454)), refs [#6903](https://togithub.com/googleapis/google-cloud-go/issues/6903) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
kimihrr
pushed a commit
to kimihrr/google-cloud-go-kimia
that referenced
this pull request
Oct 25, 2022
🤖 I have created a release *beep* *boop* --- ## [1.26.0](https://togithub.com/googleapis/google-cloud-go/compare/pubsub/v1.25.1...pubsub/v1.26.0) (2022-10-24) ### Features * **pubsub:** Add support for snapshot labels ([googleapis#6835](https://togithub.com/googleapis/google-cloud-go/issues/6835)) ([c17851b](https://togithub.com/googleapis/google-cloud-go/commit/c17851b5c3d811cd3e6a28162f0e399bb31a1363)) ### Bug Fixes * **pubsub:** Remove unused AckResult map ([googleapis#6656](https://togithub.com/googleapis/google-cloud-go/issues/6656)) ([5f69002](https://togithub.com/googleapis/google-cloud-go/commit/5f690022551ac584e5c66af4324a17d7044a898d)) ### Documentation * **pubsub:** Fix comments on message for exactly once delivery ([googleapis#6878](https://togithub.com/googleapis/google-cloud-go/issues/6878)) ([a8109e2](https://togithub.com/googleapis/google-cloud-go/commit/a8109e2d3257d1698ce1b751618428ef25cbb859)), refs [googleapis#6877](https://togithub.com/googleapis/google-cloud-go/issues/6877) * **pubsub:** Update streams section ([googleapis#6682](https://togithub.com/googleapis/google-cloud-go/issues/6682)) ([7b4e2b4](https://togithub.com/googleapis/google-cloud-go/commit/7b4e2b412058f965a9f9159231afe551a6f58a74)) * **pubsub:** Update subscription retry policy defaults ([googleapis#6909](https://togithub.com/googleapis/google-cloud-go/issues/6909)) ([c5c2f8f](https://togithub.com/googleapis/google-cloud-go/commit/c5c2f8f7125034c611edf1d08ca35ece6554c454)), refs [googleapis#6903](https://togithub.com/googleapis/google-cloud-go/issues/6903) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The way to update labels for snapshots will be a bit different than for topic/subscriptions. You need to call
snapshot.SetLabelsafter one has been created.I decided against adding labels through a new
UpdateSnapshotmethod since snapshots cannot be meaningfully modified after creation. In addition,subscription.CreateSnapshotdoesn't support SnapshotConfigs so supporting that would expand the API surface. Not adding this is consistent with the UI in Cloud Console where snapshots can be labelled only after creation.Closes #6838