chore(codegen): daily schema refresh (2026-06-16)#38
Open
timgl wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Daily OpenAPI schema refresh (2026-06-16)
Regenerated
src/generated/api.d.tsfrom the live PostHog spec(
https://us.posthog.com/api/schema/?format=json, filtered byopenapi-filter.yaml).The generated file was not hand-edited — only
pnpm codegenproduced it.Spec diff size
src/generated/api.d.ts: +1653 / −119 linessrc/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.yamlis 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
_updatevariantsfor 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 usespartial_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 PATCHbody serializer
PatchedDashboard→PatchedPatchedDashboardOpenApi. Updatedthe
PatchedDashboardBodytype alias to match. The new serializer is actuallyan improvement:
tilesis now a properly writable field(
DashboardPatchTileOpenApi[]) rather than readonly. No behavior change — theexisting casts still hold and
delete_insightsremains required.Unresolved drift
in the regenerated output) — nothing for a human to delete.
pnpm lintandpnpm format:checkfail repo-wide(~68 files, e.g.
src/resources/types.ts,property-group/*) onmainbefore 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