Skip to content

fix: include documented mix tasks in public API snapshot#140

Merged
marandaneto merged 1 commit into
mainfrom
fix-public-api-mix-tasks
Jun 18, 2026
Merged

fix: include documented mix tasks in public API snapshot#140
marandaneto merged 1 commit into
mainfrom
fix-public-api-mix-tasks

Conversation

@marandaneto

Copy link
Copy Markdown
Member

💡 Motivation and Context

mix posthog.public_api --check is intended to enforce the committed public API snapshot, but it only included modules under PostHog.*. Documented PostHog Mix tasks such as mix posthog.package_source_code are user-facing and appear in HexDocs, but were not covered by the snapshot check.

This updates the snapshot generator to include documented Mix.Tasks.Posthog.* modules. For Mix tasks, the snapshot now records the task name, @shortdoc, and module documentation text so command/options documentation changes are also reviewed through CI.

💚 How did you test it?

  • mix format --check-formatted
  • mix posthog.public_api --check
  • mix compile --warnings-as-errors
  • 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

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Implemented with Pi in a dedicated git worktree. The chosen approach keeps the existing public_api.snapshot workflow and extends it to documented PostHog Mix tasks instead of introducing a second snapshot file. The Mix task snapshot includes module docs to cover option/usage changes that exported-function metadata cannot capture.

@marandaneto marandaneto self-assigned this Jun 18, 2026
@marandaneto marandaneto marked this pull request as ready for review June 18, 2026 15:38
@marandaneto marandaneto requested a review from a team as a code owner June 18, 2026 15:38
@github-actions

Copy link
Copy Markdown
Contributor

posthog-elixir Compliance Report

Date: 2026-06-18 15:40:48 UTC
Duration: 107232ms

⚠️ 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 608ms
Format Validation.Event Has Uuid 608ms
Format Validation.Event Has Lib Properties 608ms
Format Validation.Distinct Id Is String 608ms
Format Validation.Token Is Present 608ms
Format Validation.Custom Properties Preserved 608ms
Format Validation.Event Has Timestamp 608ms
Retry Behavior.Retries On 503 5612ms
Retry Behavior.Does Not Retry On 400 2611ms
Retry Behavior.Does Not Retry On 401 2611ms
Retry Behavior.Respects Retry After Header 5614ms
Retry Behavior.Implements Backoff 15619ms
Retry Behavior.Retries On 500 5612ms
Retry Behavior.Retries On 502 5614ms
Retry Behavior.Retries On 504 5614ms
Retry Behavior.Max Retries Respected 15624ms
Deduplication.Generates Unique Uuids 617ms
Deduplication.Preserves Uuid On Retry 5612ms
Deduplication.Preserves Uuid And Timestamp On Retry 10618ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 5615ms
Deduplication.No Duplicate Events In Batch 613ms
Deduplication.Different Events Have Different Uuids 611ms
Compression.Sends Gzip When Enabled 608ms
Batch Format.Uses Proper Batch Structure 607ms
Batch Format.Flush With No Events Sends Nothing 606ms
Batch Format.Multiple Events Batched Together 612ms
Error Handling.Does Not Retry On 403 2610ms
Error Handling.Does Not Retry On 413 2610ms
Error Handling.Retries On 408 5614ms

Feature_Flags Tests

⚠️ 13/16 tests passed, 3 failed

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

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

@marandaneto marandaneto merged commit 11b0e0a into main Jun 18, 2026
30 checks passed
@marandaneto marandaneto deleted the fix-public-api-mix-tasks branch June 18, 2026 15:40
@greptile-apps

greptile-apps Bot commented Jun 18, 2026

Copy link
Copy Markdown

Reviews (1): Last reviewed commit: "fix: include documented mix tasks in pub..." | Re-trigger Greptile

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