Skip to content

chore(codegen): daily schema refresh (2026-05-20)#10

Open
timgl wants to merge 1 commit into
mainfrom
posthog-code/schema-refresh-2026-05-20
Open

chore(codegen): daily schema refresh (2026-05-20)#10
timgl wants to merge 1 commit into
mainfrom
posthog-code/schema-refresh-2026-05-20

Conversation

@timgl
Copy link
Copy Markdown
Contributor

@timgl timgl commented May 20, 2026

Summary

Daily refresh of src/generated/api.d.ts from the live PostHog OpenAPI spec via pnpm codegen. 89 lines added, 2 removed in api.d.ts — all schema-annotation drift, no operationId additions.

Schema drift (annotations only)

  • Insight results customization: new resultCustomizations map on the trends config object ({[key: string]: ResultCustomizationByValue}).
  • ExperimentSavedMetric / PatchedExperimentSavedMetric: added inline descriptions for name, description, and query.
  • Team / PatchedTeam: new optional test_account_filters field with extensive doc comment covering person/event/cohort filter shapes.
  • TeamCustomerAnalyticsConfig: previously Record<string, never>, now an object with activity_event, signup_pageview_event, signup_event, subscription_event, payment_event, account_group_type_index.
  • TrendsFilter: new descriptions on aggregationAxisFormat, aggregationAxisPostfix, aggregationAxisPrefix, decimalPlaces.

No type changes touch any managed resource client — pnpm typecheck passes clean.

openapi-filter.yaml

Not modified. The "new operationIds in live spec, missing from openapi-filter.yaml" list surfaced by drift detection is the full universe of unmanaged PostHog API endpoints — they were intentionally excluded by the original allowlist, not newly added to the spec.

For families we already manage (cohorts, event_definitions, experiments, experiment_holdouts, experiment_saved_metrics, schema_property_groups), the live spec exposes _update (PUT) variants in addition to the _partial_update (PATCH) ones we currently expose. Clients use PATCH exclusively, so PUT is not needed — adding it would only bloat the generated schema. Left as-is.

For brand-new resource families surfaced in the live spec (alerts, annotations, surveys, subscriptions, notebooks, error_tracking_*, data_warehouse_*, etc.), adding them is a larger change that belongs in dedicated PRs using the add-resource skill — not in a daily refresh.

Test results

  • pnpm typecheck — passes ✅
  • pnpm test — 290/291 pass. 1 preexisting flake in src/pull/run.test.ts > runPull > "writes files and calls tagOnServer on a non-dry run" (500ms timeout, fails on main too — unrelated to this PR).

Unresolved drift

None. No operationIds disappeared from the live spec.

Test plan

  • CI green on this branch
  • Review the api.d.ts diff and confirm no client schema breakage

Task: 9bac39f2-1e99-4821-9a70-0ff29a1f644e

Regenerated src/generated/api.d.ts via pnpm codegen. Drift is schema
annotations only — no new operationIds were added to openapi-filter.yaml.

Generated-By: PostHog Code
Task-Id: 9bac39f2-1e99-4821-9a70-0ff29a1f644e
@timgl timgl requested a review from pl May 20, 2026 08:14
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