docs: centralize SDK examples in official docs#568
Conversation
|
Prompt To Fix All With AIFix 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 |
posthog-android Compliance ReportDate: 2026-06-12 11:56:16 UTC
|
| 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
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']
319da0a to
c6c454e
Compare
c6c454e to
5e4febe
Compare
|
Reviews (2): Last reviewed commit: "fix readme docs links" | Re-trigger Greptile |
a5f4c7f to
9b12f64
Compare
9b12f64 to
454053c
Compare
💡 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?
git diff --check.USAGE.md/old integration-doc links were removed or updated.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file