Skip to content

chore(codegen): daily schema refresh (2026-06-09)#31

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

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

Conversation

@timgl

@timgl timgl commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Daily OpenAPI schema refresh — 2026-06-09

Regenerated src/generated/api.d.ts via pnpm codegen from the live spec
(https://us.posthog.com/api/schema/?format=json), filtered by openapi-filter.yaml.

Spec diff size

  • src/generated/api.d.ts: +1387 / −50 (17,571 → 18,908 lines)
  • openapi-filter.yaml: unchanged
  • No managed paths added or removed — all 31 managed operation paths intact. The diff is pure field-level schema evolution on already-managed operations (e.g. new query-response fields warnings, resolved_compare_date_range, usedLazyPrecompute, outlier-handling params) plus transitively-referenced new component schemas: AccountsQuery, AccountsQueryResponse, AggregationPropertyType, CalendarHeatmapFilter, DataWarehouseSyncWarning, ExperimentMetricType, ExperimentMetricOutlierHandling, ExperimentParameters, IntegrationKind, ParserMode, SearchMatchTypeEnum, TeamCustomerAnalyticsConfig, TeamWorkflowsConfig.

New operationIds added to the filter

None. The drift report's "new operationIds" list is live_ops − filter_ops, i.e. the entire unmanaged API surface (~2,000 of 2,069 live operations). Under the allowlist model this is expected and not per-line actionable.

I triaged the gaps that fall under the 13 managed resource families specifically. Every one is either an auxiliary sub-action (sharing, tiles, activity logs, bulk-tag, stats, materialization, code-export) or an unused full-PUT _update verb where the client deliberately uses PATCH (partial_update). None are part of the IaC create/update/delete lifecycle, none are referenced by the resource clients, and adding them would only bloat the generated types with unused surface. typecheck + test pass without them, so nothing was adopted. Notable family-prefixed gaps left out (for a human to consider adopting deliberately, if ever):

  • experiments_update, cohorts_update, event_definitions_update, schema_property_groups_update, experiment_holdouts_update, experiment_saved_metrics_update, event_schemas_update / event_schemas_partial_update — full-PUT verbs; clients use PATCH.
  • *_sharing_*, *_activity_retrieve, *_bulk_update_tags_create, dashboards_*_tile*, experiments_stats/timeseries/duplicate/reset/..., feature_flags_local_evaluation/status/..., environments_endpoints_run/materialization/... — auxiliary, not IaC CRUD.

No brand-new resource family is introduced. Adopting one requires deliberate design (identity model, pipeline projections, tests, the add-resource safety invariant) and is out of scope for the automated daily refresh.

Resources touched

None. Only the generated types file changed; no src/resources/<name>/client.ts Zod schema or pipeline.ts projection needed patching — the schema drift was additive and did not break any existing managed shape.

Unresolved drift

  • None blocking. No managed operationIds disappeared from the live spec, so there is nothing to flag for human deletion this cycle.
  • Test run note: src/pull/run.test.ts hit a 500 ms timeout once under full-suite parallel load on the CI host; it passes cleanly in isolation and on a re-run (291/291). Not schema-related.

Verification

  • pnpm install --frozen-lockfile
  • pnpm codegen
  • pnpm typecheck
  • pnpm test ✓ (291 passed)

TaskRun: https://us.posthog.com/project/423401/tasks/c093a88e-8bfe-4124-9f55-7721e70669ad

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.

- +1387 / -50 lines; field-level schema evolution only.
- No managed paths added or removed (all 31 intact).
- openapi-filter.yaml unchanged — no new operations adopted.
- typecheck + test green.

Generated-By: PostHog Code
Task-Id: c093a88e-8bfe-4124-9f55-7721e70669ad
@timgl timgl requested a review from pl June 9, 2026 08:17
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