Skip to content

docs: agree on public API changes before implementing them - #242

Open
turnipdabeets wants to merge 1 commit into
mainfrom
docs/public-api-changes
Open

docs: agree on public API changes before implementing them#242
turnipdabeets wants to merge 1 commit into
mainfrom
docs/public-api-changes

Conversation

@turnipdabeets

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Port of PostHog/posthog-js#4906 to posthog-php.

On contributor PRs we sometimes only settle the public API after several rounds of implementation review. By then the contributor, or their agent, has built each suggestion along the way, and a late change of direction wastes their work. This asks contributors to agree on the API shape on the issue first, and tells their agents to stop and ask.

  • CONTRIBUTING.md: new "Public API changes" section, same as posthog-js. The last paragraph points at composer api:update / composer api:check and api/public-api.json.
  • AGENTS.md: new file, since this repo didn't have one. Same shape as the posthog-js one: it points agents to CONTRIBUTING.md, RELEASING.md, and the new section, and asks to keep shared guidance out of AGENTS.md.

💚 How did you test it?

Docs only. Checked that the commands and file paths it mentions exist in this repo.

📝 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 change to generate a change intent file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

  • Written with Claude Code, porting the posthog-js section and adapting the API-snapshot paragraph and beforeSend-style hook name to this SDK.

🤖 Generated with Claude Code

https://claude.ai/code/session_016syAmdpp8imNvs7PWkpwvb

@turnipdabeets turnipdabeets self-assigned this Sep 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

posthog-php Compliance Report

Date: 2026-09-11 15:27:29 UTC
Duration: 95350ms

✅ All Tests Passed!

46/46 tests passed


Capture Tests

29/29 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 12ms
Format Validation.Event Has Uuid 6ms
Format Validation.Event Has Lib Properties 7ms
Format Validation.Distinct Id Is String 6ms
Format Validation.Token Is Present 6ms
Format Validation.Custom Properties Preserved 7ms
Format Validation.Event Has Timestamp 6ms
Retry Behavior.Retries On 503 5316ms
Retry Behavior.Does Not Retry On 400 2009ms
Retry Behavior.Does Not Retry On 401 2009ms
Retry Behavior.Respects Retry After Header 8013ms
Retry Behavior.Implements Backoff 15737ms
Retry Behavior.Retries On 500 5114ms
Retry Behavior.Retries On 502 5116ms
Retry Behavior.Retries On 504 5115ms
Retry Behavior.Max Retries Respected 16530ms
Deduplication.Generates Unique Uuids 11ms
Deduplication.Preserves Uuid On Retry 5114ms
Deduplication.Preserves Uuid And Timestamp On Retry 10316ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 5117ms
Deduplication.No Duplicate Events In Batch 11ms
Deduplication.Different Events Have Different Uuids 7ms
Compression.Sends Gzip When Enabled 5ms
Batch Format.Uses Proper Batch Structure 6ms
Batch Format.Flush With No Events Sends Nothing 4ms
Batch Format.Multiple Events Batched Together 9ms
Error Handling.Does Not Retry On 403 2008ms
Error Handling.Does Not Retry On 413 2010ms
Error Handling.Retries On 408 5115ms

Feature_Flags Tests

17/17 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id 7ms
Request Payload.Flags Request Uses V2 Query Param 5ms
Request Payload.Flags Request Hits Flags Path Not Decide 4ms
Request Payload.Flags Request Omits Authorization Header 7ms
Request Payload.Token In Flags Body Matches Init 13ms
Request Payload.Groups Round Trip 14ms
Request Payload.Groups Default To Empty Object 10ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False 11ms
Request Payload.Disable Geoip Omitted Defaults To False 8ms
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 10ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests 9ms
Request Lifecycle.Mock Response Value Is Returned To Caller 5ms
Retry Behavior.Retries Flags On 502 108ms
Retry Behavior.Retries Flags On 504 108ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event 8ms

@turnipdabeets
turnipdabeets marked this pull request as ready for review September 11, 2026 17:17
@turnipdabeets
turnipdabeets requested a review from a team as a code owner September 11, 2026 17:17
@greptile-apps

greptile-apps Bot commented Sep 11, 2026

Copy link
Copy Markdown

Reviews (1): Last reviewed commit: "docs: agree on public API changes before..." | 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.

1 participant