Add DataSync example snippets and feature-support entry - #189
Merged
Merged
Conversation
Adds the doc-pipeline example snippets referenced by the new Go DataSync documentation, plus the data-sync feature group in .pubnub.yml so the docs feature-support matrix doesn't crash. - examples/snippets/api/datasync_example_test.go: 52 Example_* snippets covering create/get/get-all/set/update/remove for users, channels, memberships, entities, and relationships, plus the DataSync event listener, projection channel subscription, and two grant-token examples. Every function seeds and cleans up its own running-example data (hidden from the rendered snippet via snippet.hide/snippet.show) so it is safe to run individually or repeatedly, and every function has a deterministic Output comment. - examples/snippets/api/config_helper.go: adds setPubnubExampleDataSyncConfigData, mirroring the existing PAM helper, reading DS_PUBLISH_KEY/DS_SUBSCRIBE_KEY/DS_SECRET_KEY. - .pubnub.yml: registers the data-sync feature group with the 34 DataSync feature keys already defined in the docs repo's registry. Note: the entity and relationship examples assume the product and ProductOwner classes already exist on the DS_* test keyset via the Admin API. The Go SDK has no method to create classes itself, so if those classes are missing on that keyset, only those examples will fail in CI, independent of this change. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
techwritermat
requested review from
KGronek-Pubnub,
Xavrax,
jakub-grzesiowski and
marcin-cebo
as code owners
September 18, 2026 10:20
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
Summary
examples/snippets/api/datasync_example_test.gowith the 52 doc-pipeline snippets referenced by the new Go DataSync documentation (create/get/get-all/set/update/remove for users, channels, memberships, entities, and relationships, plus the event listener, projection-channel subscription, and two grant-token examples).setPubnubExampleDataSyncConfigDatatoconfig_helper.go, mirroring the existing PAM helper, readingDS_PUBLISH_KEY/DS_SUBSCRIBE_KEY/DS_SECRET_KEY(already present as CI secrets in.github/workflows/run-tests.yml).data-syncfeature group in.pubnub.ymlwith the 34 DataSync feature keys already defined in the docs repo's registry, so the docs feature-support matrix build doesn't crash for this SDK.Every example function seeds and cleans up its own running-example data (hidden from the rendered doc snippet via
snippet.hide/snippet.show) so it's safe to run individually, repeatedly, or out of order. Every function ends with a deterministic// Output:comment (status codes only, never a dynamically generated id, timestamp, or eTag), which is required forgo testto register an Example as a runnable test at all.Known external dependency
The entity and relationship examples assume the
productandProductOwnerclasses already exist on theDS_*test keyset via the Admin API — the Go SDK has no method to create classes itself. If those classes aren't provisioned there yet, only those specific examples will fail in CI, independent of this change.Test plan
go build ./...cleango vet ./examples/...clean (only 2 pre-existing unrelated warnings ingetting_started.go/onboarding.go)gofmt -lclean on the new/changed filesgo test ./examples/snippets/api/... -list '.*'(0 before this fix — a first pass omitted// Output:comments, which silently excludes an Example fromgo test's test list entirely)DS_*keyset (requires CI, not available locally)🤖 Generated with Claude Code