Skip to content

chore: Document public APIs in ExDoc#120

Merged
marandaneto merged 3 commits into
mainfrom
docs/document-public-api-exdocs
May 28, 2026
Merged

chore: Document public APIs in ExDoc#120
marandaneto merged 3 commits into
mainfrom
docs/document-public-api-exdocs

Conversation

@marandaneto
Copy link
Copy Markdown
Member

@marandaneto marandaneto commented May 27, 2026

💡 Motivation and Context

Public SDK APIs, configuration docs, and return types should be discoverable and up to date in ExDoc. This documents missing public APIs and fixes stale examples/spec docs so HexDocs matches the current implementation and official Elixir library docs.

Callback implementations remain hidden behind their behaviour callbacks; only the callback/type documentation is exposed for those APIs. Internal sender tuning options remain undocumented.

💚 How did you test it?

  • mix format
  • mix compile --warnings-as-errors
  • mix docs
  • mix test

📝 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 sampo add to generate a changeset file

@marandaneto marandaneto requested review from a team and rafaeelaudibert as code owners May 27, 2026 15:19
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 27, 2026

Reviews (1): Last reviewed commit: "docs: document public API ExDoc comments" | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

posthog-elixir Compliance Report

Date: 2026-05-28 10:43:39 UTC
Duration: 107343ms

⚠️ Some Tests Failed

42/45 tests passed, 3 failed


Capture Tests

29/29 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 610ms
Format Validation.Event Has Uuid 610ms
Format Validation.Event Has Lib Properties 610ms
Format Validation.Distinct Id Is String 609ms
Format Validation.Token Is Present 610ms
Format Validation.Custom Properties Preserved 610ms
Format Validation.Event Has Timestamp 610ms
Retry Behavior.Retries On 503 5611ms
Retry Behavior.Does Not Retry On 400 2612ms
Retry Behavior.Does Not Retry On 401 2613ms
Retry Behavior.Respects Retry After Header 5616ms
Retry Behavior.Implements Backoff 15626ms
Retry Behavior.Retries On 500 5616ms
Retry Behavior.Retries On 502 5613ms
Retry Behavior.Retries On 504 5611ms
Retry Behavior.Max Retries Respected 15624ms
Deduplication.Generates Unique Uuids 622ms
Deduplication.Preserves Uuid On Retry 5614ms
Deduplication.Preserves Uuid And Timestamp On Retry 10621ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 5618ms
Deduplication.No Duplicate Events In Batch 616ms
Deduplication.Different Events Have Different Uuids 613ms
Compression.Sends Gzip When Enabled 609ms
Batch Format.Uses Proper Batch Structure 609ms
Batch Format.Flush With No Events Sends Nothing 607ms
Batch Format.Multiple Events Batched Together 615ms
Error Handling.Does Not Retry On 403 2612ms
Error Handling.Does Not Retry On 413 2613ms
Error Handling.Retries On 408 5616ms

Feature_Flags Tests

⚠️ 13/16 tests passed, 3 failed

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

Failures

request_payload.disable_geoip_omitted_defaults_to_false

Field 'geoip_disable' not found in /flags request body at path 'geoip_disable'. Available keys: ['groups', 'api_key', 'distinct_id', 'flag_keys_to_evaluate', 'group_properties', 'person_properties']

request_lifecycle.mock_response_value_is_returned_to_caller

Last action result missing field 'value'. Keys: ['error', 'success']

side_effect_events.get_feature_flag_captures_feature_flag_called_event

Expected 1 events with name '$feature_flag_called', got 0

PostHog.capture("page_viewed", Map.merge(%{distinct_id: "u1"}, properties))
"""
@spec event_properties(t()) :: %{String.t() => any()}
@spec event_properties(t()) :: PostHog.properties()
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just an alias so all good

Comment thread lib/posthog/api/client.ex Outdated
Comment thread lib/posthog/config.ex Outdated
Comment thread lib/posthog/config.ex Outdated
@rafaeelaudibert rafaeelaudibert removed their request for review May 27, 2026 17:23
Copy link
Copy Markdown
Contributor

@dustinbyrne dustinbyrne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to unblock - @martosaur has raised some things worth considering before merging

@marandaneto
Copy link
Copy Markdown
Member Author

will check @martosaur thanks

@marandaneto marandaneto requested a review from martosaur May 28, 2026 10:43
@marandaneto marandaneto changed the title Document public APIs in ExDoc chore: Document public APIs in ExDoc May 28, 2026
@marandaneto
Copy link
Copy Markdown
Member Author

will check @martosaur thanks

@martosaur wdyt?

@marandaneto marandaneto merged commit a9865cd into main May 28, 2026
22 of 24 checks passed
@marandaneto marandaneto deleted the docs/document-public-api-exdocs branch May 28, 2026 14:47
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.

3 participants