Skip to content

chore(codegen): daily schema refresh (2026-06-16)#38

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

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

Conversation

@timgl

@timgl timgl commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Daily OpenAPI schema refresh (2026-06-16)

Regenerated src/generated/api.d.ts from the live PostHog spec
(https://us.posthog.com/api/schema/?format=json, filtered by openapi-filter.yaml).
The generated file was not hand-edited — only pnpm codegen produced it.

Spec diff size

  • src/generated/api.d.ts: +1653 / −119 lines
  • src/resources/dashboard/client.ts: +1 / −1 (type-alias fix, see below)

The api.d.ts delta is pure schema-shape evolution of the already-managed
operations — new fields on the HogQL/query/insight schemas
(warnings, resolved_compare_date_range, usedLazyPrecompute,
useWebAnalyticsPrecompute, query_status, outlier-handling fields, …).
No allowlisted operation's path was added or removed.

New operationIds added to the filter

None. openapi-filter.yaml is unchanged.

The drift detector's "new operationIds" list is the steady-state set of
endpoints this IaC client intentionally does not manage — they belong to
other PostHog products / internal-admin surfaces (agent_applications,
conversations, llm_analytics, error_tracking, warehouse, signals, vision,
tasks, environments_* mirrors, etc.). None map onto a managed CRUD family in a
way the typed client needs.

Considered but deliberately not adopted: the full-PUT _update variants
for families where we already manage the PATCH (cohorts_update,
experiments_update, event_definitions_update, schema_property_groups_update,
event_schemas_update, experiment_holdouts_update,
experiment_saved_metrics_update). The pipeline uses partial_update (PATCH)
for these by design; pulling in the PUT bodies would add unused request schemas.

Resources touched

  • src/resources/dashboard/client.ts — upstream renamed the dashboard PATCH
    body serializer PatchedDashboardPatchedPatchedDashboardOpenApi. Updated
    the PatchedDashboardBody type alias to match. The new serializer is actually
    an improvement: tiles is now a properly writable field
    (DashboardPatchTileOpenApi[]) rather than readonly. No behavior change — the
    existing casts still hold and delete_insights remains required.

Unresolved drift

  • No allowlisted operationIds disappeared from the live spec (all still resolve
    in the regenerated output) — nothing for a human to delete.
  • Pre-existing, out-of-scope: pnpm lint and pnpm format:check fail repo-wide
    (~68 files, e.g. src/resources/types.ts, property-group/*) on main
    before this change — a Prettier/ESLint version drift unrelated to the refresh.
    Left untouched per the "don't touch unrelated files" constraint.

Verification

  • pnpm typecheck
  • pnpm test ✅ (291 tests, 35 files)

Source

Triggered by the daily schema-refresh workflow.
TaskRun / task: 828da4a9-c012-4b38-bd73-9e44587338ab
https://us.posthog.com/project/423401/tasks/828da4a9-c012-4b38-bd73-9e44587338ab

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

- Schema-shape evolution across managed query/insight/dashboard operations
  (new fields: warnings, resolved_compare_date_range, usedLazyPrecompute, etc.).
- Dashboard PATCH body serializer renamed upstream: PatchedDashboard ->
  PatchedPatchedDashboardOpenApi. Updated the type alias in
  src/resources/dashboard/client.ts to match (tiles is now a properly
  writable field upstream). No filter changes; no new operationIds adopted.

typecheck + test (291 tests) pass.

Generated-By: PostHog Code
Task-Id: 828da4a9-c012-4b38-bd73-9e44587338ab
@timgl timgl requested a review from pl June 16, 2026 09:00
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