Skip to content

chore(codegen): daily schema refresh (2026-06-21)#43

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

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

Conversation

@timgl

@timgl timgl commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Daily OpenAPI schema refresh — 2026-06-21

Regenerated 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
  • All 31 managed paths are stable — no operations added or removed at the path/verb level. The drift is entirely field-level schema evolution on already-managed operations (e.g. new warnings, resolved_compare_date_range, resolved_date_range, evaluation_runtime, running_time_calculation, workflows_config, bucketing_identifier fields on insight/experiment/query schemas).

New operationIds added to the filter

None. The drift detector's "new operationIds" list is comm -23 live_ops filter_ops — i.e. the entire unmanaged API surface, not newly-appeared operations. openapi-filter.yaml is a deliberate allowlist of ~70 operations across 13 resource families; every entry in the drift list is an intentionally-unmanaged product/admin/internal endpoint (accounts, agents, conversations, error tracking, llm analytics, logs, vision, tasks, warehouse, …) that doesn't belong in this IaC client.

No operationId in the list represents a gap in an existing managed CRUD family. The full-PUT *_update verbs that share a path with managed families (cohorts_update, experiments_update, event_definitions_update, experiment_holdouts_update, experiment_saved_metrics_update, schema_property_groups_update, event_schemas_update) are long-standing, intentionally-excluded operations — the maintainers manage only partial_update for these families. They are not new drift, so they were left out to keep the change minimal and preserve that choice. A human can opt them in later if desired.

Resources touched

Two upstream schema-component renames broke type references in managed clients; updated to match the regenerated file (no behavioral change):

Resource Before After
dashboard/client.ts PatchedDashboard PatchedPatchedDashboardOpenApi
experiment/client.ts PaginatedExperimentList PaginatedExperimentBasicList

The experiments list endpoint now returns ExperimentBasic items. Verified ExperimentBasic still carries id, name, and feature_flag_key, so ServerExperimentSchema.parse on list rows remains safe — no Zod schema patch required.

Unresolved drift

  • None. No managed operation disappeared from the live spec (31/31 paths intact), so there is nothing to flag for manual deletion.

Verification

  • pnpm typecheck
  • pnpm test ✅ (291/291)

Pre-existing repo-wide prettier/eslint warnings (68 files, unrelated to this change) were left untouched per the "do not touch unrelated files" constraint. src/generated is in .prettierignore.


🤖 Generated by the daily schema-refresh agent.
TaskRun: https://us.posthog.com/project/423401/tasks/e9fa9a7e-6e2c-47cd-8dee-02badaa4d369

Regenerate src/generated/api.d.ts from the live PostHog OpenAPI spec
(filtered by openapi-filter.yaml). Field-level schema drift only — no
managed paths added or removed.

Two managed schema components were renamed upstream; update the type
references to match the regenerated file:
- dashboard PATCH body: PatchedDashboard -> PatchedPatchedDashboardOpenApi
- experiments list response: PaginatedExperimentList -> PaginatedExperimentBasicList

Generated-By: PostHog Code
Task-Id: e9fa9a7e-6e2c-47cd-8dee-02badaa4d369
@timgl timgl requested a review from pl June 21, 2026 08:37
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