chore(codegen): daily schema refresh (2026-08-24) - #131
Draft
timgl wants to merge 1 commit into
Draft
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI spec and
absorb schema drift in managed resources.
- Endpoints resource relocated from the environment-scoped path
(/api/environments/{environment_id}/endpoints/, operationId
environments_endpoints_*) to the project-scoped path
(/api/projects/{project_id}/endpoints/, operationId endpoints_*).
Updated openapi-filter.yaml and endpoint/client.ts accordingly.
- Dashboard partial_update request body renamed
PatchedDashboard -> PatchedPatchedDashboardOpenApi.
- Experiment schemas renamed: create/update body Experiment -> ExperimentWrite,
partial_update body PatchedExperiment -> PatchedExperimentWrite,
list response PaginatedExperimentList -> PaginatedExperimentBasicList.
Generated-By: PostHog Desktop
Task-Id: aea0b0dd-66e1-4c07-bd83-d1b967510d2e
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.
Why
Automated daily refresh of the typed PostHog API client. The live OpenAPI spec drifted (
api.d.ts changed: trueon 2026-08-24), so the generated types and the managed-resource clients needed to be brought back in sync.What changed
Regenerated
src/generated/api.d.tsviapnpm codegen(never hand-edited) and patched the managed-resource clients affected by schema drift.Spec diff size:
src/generated/api.d.ts— +6,613 / −2,682 lines. Live spec: 1,985 total operationIds, 71 allowlisted.Endpoints resource relocated (operationIds followed)
The endpoints resource moved from the environment-scoped path to the project-scoped path:
/api/environments/{environment_id}/endpoints//api/projects/{project_id}/endpoints/environments_endpoints_*endpoints_*New operationIds added to
openapi-filter.yaml:endpoints_list,endpoints_create,endpoints_retrieve,endpoints_update,endpoints_partial_update,endpoints_destroy(replacing the sixenvironments_endpoints_*that were retired).endpoint/client.tsupdated to the new path andproject_idparam — response/request component names (EndpointResponse,PaginatedEndpointResponseList,EndpointRequest,PatchedEndpointRequest) are unchanged.Schema renames absorbed in clients
dashboards_partial_updatebodyPatchedDashboard→PatchedPatchedDashboardOpenApi.Experiment→ExperimentWrite;partial_updatebodyPatchedExperiment→PatchedExperimentWrite; list responsePaginatedExperimentList→PaginatedExperimentBasicList.Resources touched
openapi-filter.yaml,src/generated/api.d.ts,dashboard/client.ts,endpoint/client.ts,experiment/client.ts.New operationIds NOT added (and why)
The drift detector emits every operationId absent from the allowlist — effectively the entire unmanaged API surface (~1,900 ops across tasks, canvases, signals, warehouse, llm_analytics, billing, etc.), not genuinely-new endpoints. None constitute a new definitional resource family appropriate for automated adoption; onboarding one requires the
add-resourceskill, a pipeline, and human product judgment about IaC fit. So none were added in this automated pass.Note for reviewers: several already-managed families now also expose a full
_update(PUT) alongside the_partial_update(PATCH) we use — e.g.experiments_update,cohorts_update,event_definitions_update,event_schemas_update/event_schemas_partial_update,experiment_holdouts_update,experiment_saved_metrics_update,schema_property_groups_update,environments_update. Our clients apply changes via PATCH, so these were intentionally left out to keep the generated surface minimal. Add them if a future feature needs PUT semantics.Unresolved drift
environments_endpoints_*) were relocated, and this PR follows the move rather than dropping the resource. Nothing left for a human to hand-delete.Verification
pnpm typecheck✅ ·pnpm test✅ (291 passed). Pre-existing repo-widelint/format:checkwarnings are untouched (present on the base branch, in files outside this change); no pre-commit hooks are configured.TaskRun:
aea0b0dd-66e1-4c07-bd83-d1b967510d2eCreated with PostHog Desktop