Skip to content

chore(codegen): daily schema refresh (2026-06-22)#44

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

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

Conversation

@timgl

@timgl timgl commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Daily OpenAPI schema refresh — 2026-06-22

Automated regeneration of src/generated/api.d.ts from the live PostHog OpenAPI
spec (https://us.posthog.com/api/schema/?format=json, filtered by openapi-filter.yaml).

Spec diff size

src/generated/api.d.ts: +1958 / −156 lines (mostly field-level additions to
query-node and result schemas already reachable from managed operations — e.g.
preComputeStrategy, useWebAnalyticsPrecompute, widget/insight query fields).

New operationIds added to the filter

None. The set of managed operations is unchanged. Every operationId reported
as "missing from the filter" by the drift detector falls into one of two buckets,
neither of which warrants managing in this IaC tool:

  • Separate resource families outside this tool's scope (logs, error_tracking,
    llm_analytics, surveys, batch_exports, warehouse, tasks, web_analytics, etc.).
  • Auxiliary endpoints on already-managed families that aren't core declarative
    CRUD (e.g. insights_activity_retrieve, dashboards_collaborators_*,
    feature_flags_status_retrieve, *_sharing_*, *_bulk_update_tags_create).

Full-PUT *_update verbs that exist upstream for some managed families
(cohorts_update, event_definitions_update, experiments_update,
experiment_holdouts_update, experiment_saved_metrics_update) were
deliberately left out — the apply pipeline updates these resources via
partial_update (PATCH), matching the existing curated allowlist. Adding the PUT
variants would pull extra schema with no behavioural benefit.

Resources touched

Two upstream component-schema renames broke pnpm typecheck; both were
field-compatible, so the fix was a one-line type-alias update each (no behaviour
change):

Resource Old component New component
src/resources/dashboard/client.ts PatchedDashboard PatchedPatchedDashboardOpenApi
src/resources/experiment/client.ts PaginatedExperimentList PaginatedExperimentBasicList

Unresolved drift

None. No managed operationId disappeared from the live spec (all 71 still
present — nothing flagged for human deletion). No Zod schema or pipeline.ts
projection patches were required beyond the two renames above.

Verification

  • pnpm typecheck
  • pnpm test ✅ (291 passed)
  • pnpm build

TaskRun

https://us.posthog.com/project/423401/tasks/11e47902-f9f6-42af-9307-706f6e54f960

Regenerate src/generated/api.d.ts from the live PostHog OpenAPI spec.

Upstream renamed two component schemas referenced by the typed client:
- PatchedDashboard -> PatchedPatchedDashboardOpenApi (dashboard PATCH body)
- PaginatedExperimentList -> PaginatedExperimentBasicList (experiments list response)

Updated the two type aliases in dashboard/client.ts and experiment/client.ts
to match. No managed operationIds were added or removed; the rest of the drift
is field-level schema evolution within already-managed operations.

typecheck + test (291 passing) + build all green.

Generated-By: PostHog Code
Task-Id: 11e47902-f9f6-42af-9307-706f6e54f960
@timgl timgl requested a review from pl June 22, 2026 09:07
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