Skip to content

chore(codegen): daily schema refresh (2026-06-20)#42

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

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

Conversation

@timgl

@timgl timgl commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Daily OpenAPI schema refresh — 2026-06-20

Automated refresh 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). Regenerated only via pnpm codegen — no hand edits to
generated types.

Spec diff size

  • src/generated/api.d.ts: +1958 / −156 lines (17,571 → 19,373)
  • Trimmed schema components: 468 → 501 (36 added, 3 removed)
  • Live spec: 2,266 operations; filter allowlist unchanged at 71 operationIds

New operationIds added to the filter

None. All operationIds newly appearing under managed resource families
(insights, dashboards, feature_flags, experiments, cohorts, actions,
event_definitions, event_schemas, schema_property_groups, experiment_holdouts,
experiment_saved_metrics) are non-CRUD sub-actions — activity logs, sharing,
bulk_update_tags, tile/widget manipulation, suggestions, stats — or full-PUT
*_update variants where the resource already uses PATCH (*_partial_update).
None are needed for the infrastructure-as-code CRUD wrappers, so the allowlist
was left untouched. Everything else in the drift report (agent_applications,
error_tracking, llm_analytics, vision_scanners, conversations, tasks,
warehouse, …) is product/runtime surface, out of scope for a definitions tool.

No brand-new resource family warranted onboarding this cycle.

Resources touched

Two upstream schema-component renames broke pnpm typecheck; patched the type
aliases minimally (no logic/refactor):

  • src/resources/dashboard/client.tsPatchedDashboardPatchedPatchedDashboardOpenApi (the dashboards PATCH request body; retains restriction_level and tiles)
  • src/resources/experiment/client.tsPaginatedExperimentListPaginatedExperimentBasicList (the experiments list response)

Verification

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

Lint/format were not run repo-wide — main is not currently
prettier-clean (68 pre-existing files) and the constraint is to avoid touching
unrelated files. The two edited lines are not flagged by prettier.

Unresolved drift

  • None disappeared: all 71 filter operationIds are still present in the
    live spec — nothing to flag for human deletion.
  • Notable upstream removals reflected in generated types:
    PaginatedExperimentList, PatchedDashboard, AggregationPropertyType1
    (replaced by AggregationPropertyType). Handled by the two client patches
    above; no manual deletion needed.

Generated by the daily schema-refresh agent.
TaskRun: 2e95497b-db18-4591-9a76-b417f7c88b21

Regenerate src/generated/api.d.ts from the live PostHog OpenAPI schema
(filtered by openapi-filter.yaml) and patch two resource clients for
upstream schema-component renames.

- dashboard/client.ts: PatchedDashboard -> PatchedPatchedDashboardOpenApi
- experiment/client.ts: PaginatedExperimentList -> PaginatedExperimentBasicList

No filter changes: all new operationIds under managed families are
non-CRUD sub-actions or full-PUT variants the resources don't use.

Generated-By: PostHog Code
Task-Id: 2e95497b-db18-4591-9a76-b417f7c88b21
@timgl timgl requested a review from pl June 20, 2026 08:14
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