Skip to content

chore(codegen): daily schema refresh (2026-06-18)#40

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

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

Conversation

@timgl

@timgl timgl commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Daily OpenAPI schema refresh — 2026-06-18

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

Spec diff size

  • src/generated/api.d.ts: +1783 / −137 lines
  • Tracked operation set: unchanged (71 operations, identical before and after)

The drift is entirely in component schemas referenced by already-tracked
operations — PostHog evolved its dashboard tile/widget configs, experiment
configs, feature-flag metadata, and team configs. Newly pulled-in schemas
include DashboardPatchTileOpenApi, DashboardPatchWidgetOpenApi,
*WidgetConfig (Activity/ErrorTracking/SessionReplay/Experiments), several
Experiment*Config types, MinimalFeatureFlag, and Team*Config.

New operationIds added to the filter

None. Every live operationId missing from openapi-filter.yaml falls into
one of two buckets, neither of which warrants managing in the typed client:

  1. Unmanaged product surfaces (the overwhelming majority) — accounts_*,
    agent_applications_*, alerts_*, annotations_*, surveys_*,
    error_tracking_*, warehouse_*, logs_*, llm_analytics_*, tasks_*,
    etc. This IaC tool manages a deliberately curated set (insights, dashboards,
    feature flags, endpoints, event definitions, property groups, experiments +
    holdouts/saved-metrics, cohorts, actions, project settings). Adding a brand
    new resource family is a product/design decision, not something an automated
    daily refresh should do unattended.

  2. Auxiliary / PUT-variant endpoints on already-managed families — e.g.
    actions_bulk_update_tags_create, actions_references_list,
    cohorts_activity_retrieve, cohorts_persons_retrieve,
    event_definitions_metrics_retrieve, feature_flags_activity_retrieve,
    dashboards_collaborators_*, plus full-replace *_update (PUT) variants
    (cohorts_update, event_definitions_update, experiments_update,
    experiment_holdouts_update, experiment_saved_metrics_update) where the
    resource clients intentionally use *_partial_update (PATCH). The CRUD
    clients don't call any of these, so adding them would only bloat the
    generated types.

No new operationId represents a core CRUD operation newly available on a
managed family, so the filter is left unchanged.

Resources touched

  • src/resources/dashboard/client.ts — upstream renamed the dashboard PATCH
    body schema PatchedDashboardPatchedPatchedDashboardOpenApi. Updated the
    one type alias to match. The new schema carries the same
    restriction_level / tiles / delete_insights fields the client relies on,
    so behavior is unchanged. This was the only schema-drift breakage.

Unresolved drift

  • None. No tracked operationId disappeared from the live spec (all 71 are
    still present), so there is nothing for a human to delete.
  • Pre-existing lint errors in src/client/typed-posthog.ts,
    src/resources/types.ts, and src/resources/dashboard/pipeline.acceptance.test.ts
    exist on main and are unrelated to this refresh — left untouched.

Verification

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

Originating TaskRun

Task-Id: 598ed80d-2ec6-4c5f-ac98-b680dad274aa

🤖 Generated with Claude Code

Regenerated src/generated/api.d.ts from the live PostHog OpenAPI spec
(https://us.posthog.com/api/schema/) filtered by openapi-filter.yaml.

Schema drift only — the set of tracked operations is unchanged (71 ops).
PostHog evolved component schemas referenced by tracked operations (new
dashboard tile/widget configs, experiment configs, feature-flag metadata,
team configs).

Breaking rename: the dashboard PATCH body schema was renamed upstream from
PatchedDashboard to PatchedPatchedDashboardOpenApi. Updated the type
reference in src/resources/dashboard/client.ts to match; the new schema
carries the same restriction_level / tiles / delete_insights fields the
client relies on.

No openapi-filter.yaml changes: every new live operationId is either an
unmanaged product surface or an auxiliary/PUT-variant endpoint the CRUD
clients don't use.

Generated-By: PostHog Code
Task-Id: 598ed80d-2ec6-4c5f-ac98-b680dad274aa
@timgl timgl requested a review from pl June 18, 2026 08:38
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