Skip to content

docs: centralize SDK examples in official docs#568

Merged
marandaneto merged 5 commits into
mainfrom
docs/centralize-sdk-docs
Jun 12, 2026
Merged

docs: centralize SDK examples in official docs#568
marandaneto merged 5 commits into
mainfrom
docs/centralize-sdk-docs

Conversation

@marandaneto

@marandaneto marandaneto commented Jun 12, 2026

Copy link
Copy Markdown
Member

💡 Motivation and Context

SDK README and usage markdown files duplicated code snippets that can drift from the official documentation. This keeps public SDK usage examples in the official docs as the single source of truth while preserving local repository information like Questions/community links and example setup instructions.

💚 How did you test it?

  • Ran git diff --check.
  • Verified stale USAGE.md/old integration-doc links were removed or updated.
  • Verified existing Questions/community sections are preserved.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor
⚠️ 4 packages modified but this PR has no changeset

This is informational — the PR is not blocked. Click the triangle above to collapse, or push a fix and this comment will auto-delete.

Modified in this PR but no changeset added:

  • posthog
  • posthog-android
  • posthog-android-gradle-plugin
  • posthog-server

If this change should ship, run pnpm changeset and select a bump level.
If it isn't user-facing (refactor with no behavior change, internal tooling, generated files), no action needed.

@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
posthog-samples/posthog-java-sample/README.md:1-9
**Sample-specific run instructions removed with no replacement**

The deleted content included commands like `cp src/main/resources/application.properties.example ...` and `./gradlew :posthog-samples:posthog-java-sample:run --console=plain` that are specific to this sample, not to the Java SDK in general. These won't appear at `posthog.com/docs/libraries/java`, so a developer who clones the repo to try the sample now has no guidance on how to configure or run it. The same problem exists in `posthog-samples/posthog-spring-sample/README.md`, which also lost its setup and `bootRun` instructions.

### Issue 2 of 2
sdk_compliance_adapter/README.md:11-14
**Link to CONTRIBUTING.md dropped**

The previous "Contributing" section pointed to `CONTRIBUTING.md` for local build and compliance test instructions. The replacement prose ("Use the Gradle tasks, scripts, and Docker Compose files in this directory…") describes what to do but no longer links to the file that documents it. A contributor landing on this README has to discover `CONTRIBUTING.md` by browsing the directory rather than following a direct link.

Reviews (1): Last reviewed commit: "docs: centralize SDK examples in officia..." | Re-trigger Greptile

Comment thread posthog-samples/posthog-java-sample/README.md Outdated
Comment thread sdk_compliance_adapter/README.md Outdated
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

posthog-android Compliance Report

Date: 2026-06-12 11:56:16 UTC
Duration: 120026ms

⚠️ Some Tests Failed

38/45 tests passed, 7 failed


Capture Tests

⚠️ 28/29 tests passed, 1 failed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 401ms
Format Validation.Event Has Uuid 56ms
Format Validation.Event Has Lib Properties 38ms
Format Validation.Distinct Id Is String 39ms
Format Validation.Token Is Present 28ms
Format Validation.Custom Properties Preserved 30ms
Format Validation.Event Has Timestamp 34ms
Retry Behavior.Retries On 503 7031ms
Retry Behavior.Does Not Retry On 400 4030ms
Retry Behavior.Does Not Retry On 401 4028ms
Retry Behavior.Respects Retry After Header 7032ms
Retry Behavior.Implements Backoff 17039ms
Retry Behavior.Retries On 500 7020ms
Retry Behavior.Retries On 502 7019ms
Retry Behavior.Retries On 504 7021ms
Retry Behavior.Max Retries Respected 17043ms
Deduplication.Generates Unique Uuids 50ms
Deduplication.Preserves Uuid On Retry 7017ms
Deduplication.Preserves Uuid And Timestamp On Retry 12034ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 7020ms
Deduplication.No Duplicate Events In Batch 45ms
Deduplication.Different Events Have Different Uuids 33ms
Compression.Sends Gzip When Enabled 27ms
Batch Format.Uses Proper Batch Structure 24ms
Batch Format.Flush With No Events Sends Nothing 16ms
Batch Format.Multiple Events Batched Together 44ms
Error Handling.Does Not Retry On 403 4027ms
Error Handling.Does Not Retry On 413 4017ms
Error Handling.Retries On 408 5034ms

Failures

error_handling.does_not_retry_on_413

Expected 1 requests, got 2

Feature_Flags Tests

⚠️ 10/16 tests passed, 6 failed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id 40ms
Request Payload.Flags Request Uses V2 Query Param 27ms
Request Payload.Flags Request Hits Flags Path Not Decide 28ms
Request Payload.Flags Request Omits Authorization Header 31ms
Request Payload.Token In Flags Body Matches Init 24ms
Request Payload.Groups Round Trip 32ms
Request Payload.Groups Default To Empty Object 29ms
Request Payload.Person Properties Distinct Id Auto Populated When Caller Omits It 30ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False 29ms
Request Payload.Disable Geoip Omitted Defaults To False 41ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key 29ms
Request Lifecycle.No Flags Request On Init Alone 14ms
Request Lifecycle.No Flags Request On Normal Capture 30ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests 2037ms
Request Lifecycle.Mock Response Value Is Returned To Caller 23ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event 30ms

Failures

request_payload.request_with_person_properties_device_id

Expected distinct_id='test_user_123', got '019ebbb0-99ab-7f0f-9511-c9765bb12f94'

request_payload.groups_default_to_empty_object

Field 'groups' not found in /flags request body at path 'groups'. Available keys: ['$anon_distinct_id', '$device_id', 'api_key', 'distinct_id', 'timezone', 'person_properties']

request_payload.person_properties_distinct_id_auto_populated_when_caller_omits_it

Field 'distinct_id' not found in /flags request body at path 'person_properties.distinct_id'. Available keys: ['$lib', '$lib_version', 'email']

request_payload.disable_geoip_false_propagates_as_geoip_disable_false

Field 'geoip_disable' not found in /flags request body at path 'geoip_disable'. Available keys: ['$anon_distinct_id', '$device_id', 'api_key', 'distinct_id', 'timezone', 'person_properties']

request_payload.disable_geoip_omitted_defaults_to_false

Field 'geoip_disable' not found in /flags request body at path 'geoip_disable'. Available keys: ['$anon_distinct_id', '$device_id', 'api_key', 'distinct_id', 'timezone', 'person_properties']

request_payload.flag_keys_to_evaluate_contains_only_requested_key

Field 'flag_keys_to_evaluate' not found in /flags request body at path 'flag_keys_to_evaluate'. Available keys: ['$anon_distinct_id', '$device_id', 'api_key', 'distinct_id', 'timezone', 'person_properties']

@marandaneto marandaneto force-pushed the docs/centralize-sdk-docs branch from 319da0a to c6c454e Compare June 12, 2026 10:59
@marandaneto marandaneto force-pushed the docs/centralize-sdk-docs branch from c6c454e to 5e4febe Compare June 12, 2026 11:19
Comment thread README.md
Comment thread posthog-samples/posthog-java-sample/README.md Outdated
Comment thread posthog-samples/posthog-spring-sample/README.md Outdated
Comment thread README.md
Comment thread README.md Outdated
@marandaneto marandaneto marked this pull request as ready for review June 12, 2026 11:28
@marandaneto marandaneto requested a review from a team as a code owner June 12, 2026 11:28
@marandaneto marandaneto enabled auto-merge (squash) June 12, 2026 11:28
@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown

Reviews (2): Last reviewed commit: "fix readme docs links" | Re-trigger Greptile

@marandaneto marandaneto force-pushed the docs/centralize-sdk-docs branch from a5f4c7f to 9b12f64 Compare June 12, 2026 11:49
@marandaneto marandaneto force-pushed the docs/centralize-sdk-docs branch from 9b12f64 to 454053c Compare June 12, 2026 11:50
@marandaneto marandaneto disabled auto-merge June 12, 2026 16:50
@marandaneto marandaneto merged commit cab1173 into main Jun 12, 2026
13 checks passed
@marandaneto marandaneto deleted the docs/centralize-sdk-docs branch June 12, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants