Skip to content

Some polish for sdk compliance#79

Merged
rafaeelaudibert merged 12 commits intoPostHog:masterfrom
martosaur:am-compliance-adapter-polish
Feb 12, 2026
Merged

Some polish for sdk compliance#79
rafaeelaudibert merged 12 commits intoPostHog:masterfrom
martosaur:am-compliance-adapter-polish

Conversation

@martosaur
Copy link
Contributor

Looked into SDK compliance adapter today and did some loosely related housekeeping:

  • Bumped Elixir to 1.19 OTP 28
  • Added .gitignore file to compliance adapter
  • Changed SDK compliance adapter dockerfile to use the recommended Hexpm Elixir image
  • Rewrote TrackedClient to be a non-intrusive Req plugin
  • Sprinkled some minor changes over compliance adapter

And finally, set Req retry strategy to transient (instead of the default safe_transient), which enables retries of POST requests and should fix 11 out of 12 failing compliance tests.

Copy link
Member

@rafaeelaudibert rafaeelaudibert left a comment

Choose a reason for hiding this comment

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

2 quick requests before we can merge this! tysm, as always!

@@ -1,2 +1,2 @@
elixir 1.18.3-otp-27
erlang 27.3.3
elixir 1.19.5-otp-28
Copy link
Member

Choose a reason for hiding this comment

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

Gotta add Elixir 1.19 to the .github/workflows/ci.yml file to keep track of them

def client(api_key, api_host) do
client =
Req.new(base_url: api_host)
Req.new(base_url: api_host, retry: :transient)
Copy link
Member

Choose a reason for hiding this comment

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

Since this was changed here we need a new patch release, can you create a sampo changeset like you did in your previous PR (install sampo and run sampo add)

@rafaeelaudibert
Copy link
Member

The bot couldn't post in a community PR so here's the output. As expected, we're only missing gzip after this is merged. Thanks!!!


posthog-elixir Compliance Report

Date: 2026-02-10 03:37:04 UTC
Duration: 105855ms

⚠️ Some Tests Failed

28/29 tests passed, 1 failed


Capture Tests

⚠️ 28/29 tests passed, 1 failed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 609ms
Format Validation.Event Has Uuid 609ms
Format Validation.Event Has Lib Properties 610ms
Format Validation.Distinct Id Is String 610ms
Format Validation.Token Is Present 609ms
Format Validation.Custom Properties Preserved 609ms
Format Validation.Event Has Timestamp 609ms
Retry Behavior.Retries On 503 5612ms
Retry Behavior.Does Not Retry On 400 2612ms
Retry Behavior.Does Not Retry On 401 2612ms
Retry Behavior.Respects Retry After Header 5615ms
Retry Behavior.Implements Backoff 15625ms
Retry Behavior.Retries On 500 5615ms
Retry Behavior.Retries On 502 5615ms
Retry Behavior.Retries On 504 5615ms
Retry Behavior.Max Retries Respected 15625ms
Deduplication.Generates Unique Uuids 619ms
Deduplication.Preserves Uuid On Retry 5615ms
Deduplication.Preserves Uuid And Timestamp On Retry 10614ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 5616ms
Deduplication.No Duplicate Events In Batch 614ms
Deduplication.Different Events Have Different Uuids 610ms
Compression.Sends Gzip When Enabled 609ms
Batch Format.Uses Proper Batch Structure 609ms
Batch Format.Flush With No Events Sends Nothing 606ms
Batch Format.Multiple Events Batched Together 614ms
Error Handling.Does Not Retry On 403 2611ms
Error Handling.Does Not Retry On 413 2612ms
Error Handling.Retries On 408 5617ms

Failures

compression.sends_gzip_when_enabled

Header \'Content-Encoding\' with value \'gzip\' not found in requests

@rafaeelaudibert rafaeelaudibert merged commit 066d4fd into PostHog:master Feb 12, 2026
14 of 16 checks passed
@martosaur
Copy link
Contributor Author

oops, sorry for the delay, I mostly do OS on weekends, so hard to keep up mid-week!

@martosaur martosaur deleted the am-compliance-adapter-polish branch February 12, 2026 05:32
@rafaeelaudibert
Copy link
Member

@martosaur don't worry! you gave me permission to update your remote so went ahead and did it for you :)

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