chore(codegen): daily schema refresh (2026-08-08) - #116
Draft
timgl wants to merge 1 commit into
Draft
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI spec and
realign managed resources to upstream schema/path changes.
- endpoints: PostHog moved the API from /api/environments/{id}/endpoints/
(environments_endpoints_*) to /api/projects/{id}/endpoints/ (endpoints_*).
Added endpoints_* CRUD to the filter and repointed the endpoint client.
- dashboard: PATCH body schema renamed PatchedDashboard -> PatchedPatchedDashboardOpenApi.
- experiment: schemas renamed Experiment->ExperimentWrite, PatchedExperiment->
PatchedExperimentWrite, PaginatedExperimentList->PaginatedExperimentBasicList.
Generated-By: PostHog Code
Task-Id: df4b51bd-59b5-4119-a965-d48965acf98c
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.
Summary
Automated daily refresh of
src/generated/api.d.tsfrom the live PostHog OpenAPIspec (
https://us.posthog.com/api/schema/?format=json, filtered byopenapi-filter.yaml). This run picked up real drift in three managed families.Why: the generated types had drifted from the live API — endpoints moved to a
new path and dashboard/experiment write schemas were renamed — breaking
typecheckuntil the managed clients were realigned.Spec diff size
src/generated/api.d.ts: +5,455 / −2,711 lines (regenerated, not hand-edited).New operationIds added to the filter
Adopted the relocated endpoints family (same resource, new path — see drift below):
endpoints_list,endpoints_create,endpoints_retrieve,endpoints_update,endpoints_partial_update,endpoints_destroyNo brand-new resource families were adopted. The remaining 1,769 unmanaged
operationIds are the rest of PostHog's API across dozens of separate products
(top families:
llm_analytics,error_tracking,warehouse,signals,mcp,tasks,hog_*,logs,data_warehouse,vision, …). These are intentionallyoutside this IaC allowlist; onboarding any of them is a per-product design
decision (via the
add-resourceskill) and out of scope for an automated refresh.Resources touched
/api/environments/{id}/endpoints/(
environments_endpoints_*) to/api/projects/{id}/endpoints/(endpoints_*).Repointed the endpoint client's paths/params (the client already passed
config.projectId, so the sent value is unchanged) and addedendpoints_*tothe filter.
PatchedDashboard→PatchedPatchedDashboardOpenApi; updated the type reference inclient.ts.Experiment→ExperimentWrite,PatchedExperiment→PatchedExperimentWrite,PaginatedExperimentList→PaginatedExperimentBasicList; updated the type references inclient.ts.typecheckand the full test suite (291 tests) pass.Unresolved drift / for human review
environments_endpoints_*operationIds no longer exist in the live spec (theywere relocated to
endpoints_*). They remain inopenapi-filter.yamlwith acomment and now match nothing during filtering. A human should delete them once
they confirm the relocation is permanent.
/experiments/list now returns the lighterExperimentBasicshape (PaginatedExperimentBasicList) rather than the fullExperiment.ExperimentBasicstill carriesfeature_flag_key, and themanaged-list Zod parse defaults cover the dropped fields, so no behavior change
is expected — noted for awareness.
Notes
src/generated/api.d.tswas regenerated viapnpm codegenonly (never hand-edited).TaskRun:
df4b51bd-59b5-4119-a965-d48965acf98cCreated with PostHog Code