Skip to content

chore(codegen): daily schema refresh (2026-06-03)#25

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

chore(codegen): daily schema refresh (2026-06-03)#25
timgl wants to merge 1 commit into
mainfrom
posthog-code/schema-refresh-2026-06-03

Conversation

@timgl
Copy link
Copy Markdown
Contributor

@timgl timgl commented Jun 3, 2026

Daily OpenAPI schema refresh — 2026-06-03

Regenerated src/generated/api.d.ts from the live PostHog OpenAPI spec via pnpm codegen (filtered by openapi-filter.yaml). Generated output only — not hand-edited.

Spec diff size

  • src/generated/api.d.ts: +1043 / −41 lines (≈ 725.6 KB → 790.6 KB, +63 KB)
  • openapi-filter.yaml: unchanged
  • Path set in the spec: identical before/after — no managed paths added or removed.

The diff is entirely schema-field expansion on already-managed operations:
query response metadata (warnings, timings, modifiers, query_status, usedLazyPrecompute, usedPreAggregatedTables, hasMore/limit/offset), experiment ratio-metric fields (numerator_outlier_handling, denominator_outlier_handling, lower_bound_percentile, upper_bound_percentile, ignore_zeros), and assorted insight/trends fields (xAxisLabel, yAxisLabel, stackBreakdownValues, tags).

New operationIds added to the filter

None.

The drift detector reports ~1,400 "new" operationIds, but this is the full PostHog API surface minus the curated 76-op allowlist — not a set of genuinely-new endpoints. Because the spec's path set is unchanged from the previous generation, nothing was newly added to any managed family this cycle. Every entry on the list falls into one of:

  • Auxiliary ops on managed families, intentionally out of scope — e.g. actions_bulk_update_tags_create, actions_references_list, cohorts_activity_retrieve, dashboards_collaborators_*, *_sharing_*. The clients manage a deliberate minimal CRUD surface.
  • Full-PUT *_update variants where the client deliberately uses PATCH — e.g. cohorts_update, experiments_update, event_definitions_update, event_schemas_update, experiment_holdouts_update, experiment_saved_metrics_update, schema_property_groups_update. These have always existed in the spec and were excluded by design (the resource clients use partial_update). Adding them would produce unused types with no consumer, not a refresh.
  • Brand-new resource families outside this tool's scope — this package is IaC for dashboards and insights (curated CRUD families). Large families like surveys_*, annotations_*, tasks_*, alerts_*, accounts_*, error_tracking_*, warehouse_*, llm_analytics_*, the entire environments_* mirror, etc. are a product decision to manage, requiring a new resource module + pipeline + tests. Not appropriate to add autonomously in a daily refresh.
  • Internal / admin / debug / query endpointsquery_*, *_activity_retrieve, live_debugger_*, sandbox_*, signals_*, etc. Not manageable IaC resources.

Resources touched

None beyond the regenerated src/generated/api.d.ts. No client.ts Zod schemas or pipeline.ts projections needed patching — typecheck and the full test suite pass against the new schema.

Verification

  • pnpm typecheck
  • pnpm test ✅ — 290/290 real tests pass. One unrelated timing flake (src/pull/run.test.ts "writes files and calls tagOnServer", a 500 ms timeout under parallel load) passes deterministically in isolation (406 ms). Not schema-related.

Removed operationIds (disappeared from live spec)

None. All 76 allowlisted operationIds still resolve in the regenerated schema. (Per policy, disappeared ops would be flagged here for a human to delete rather than auto-removed.)

Candidates a human may want to consider managing

Not actioned — flagged only for product judgment: surveys_*, annotations_*, early_access_feature_*, web_experiments_* are the closest in spirit to the existing dashboards/insights/experiments surface.


TaskRun: 297bb831-3b69-4471-978a-dea5576f818c

Regenerate src/generated/api.d.ts from the live PostHog OpenAPI spec
(https://us.posthog.com/api/schema/?format=json), filtered by
openapi-filter.yaml. Generated via `pnpm codegen` — not hand-edited.

The diff is schema-field expansion on already-managed operations
(insight/experiment query responses, experiment metric outlier-handling
fields, query metadata like warnings/timings/modifiers). No paths added
or removed; the filter allowlist is unchanged. typecheck + test pass.

Generated-By: PostHog Code
Task-Id: 297bb831-3b69-4471-978a-dea5576f818c
@timgl timgl requested a review from pl June 3, 2026 08:41
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