chore(codegen): daily schema refresh (2026-08-09) - #117
Draft
timgl wants to merge 1 commit into
Draft
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI schema.
- Endpoints family moved server-side to /api/projects/{project_id}/endpoints/;
add endpoints_* operationIds to the filter and update the endpoint client
paths/params. Old environments_endpoints_* ids retained (flagged for human
deletion).
- Follow schema component renames in dashboard/experiment clients
(PatchedPatchedDashboardOpenApi, PatchedExperimentWrite,
PaginatedExperimentBasicList).
typecheck and test (291 tests) pass.
Generated-By: PostHog Code
Task-Id: 6124d9ce-afe9-47c5-bc21-0e82abc1d6ff
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
Daily automated OpenAPI schema refresh. The live PostHog spec drifted, so the vendored types in
src/generated/api.d.tswere regenerated and the small number of managed resources affected by server-side renames were patched to keep the typed client compiling.Spec diff size
src/generated/api.d.ts: +5,102 / −1,913 lines (17,571 → 20,760 lines). Most of this is churn inside request/response component schemas that were pulled in by the regenerate, not new managed operations.openapi-filter.yaml: endpoints family entries updated (see below).New operationIds added to the filter
The filter is a curated allowlist — only operations we manage as IaC resources are kept; the live spec's ~1,600 other operationIds are intentionally out of scope. This run added:
endpoints_list,endpoints_create,endpoints_retrieve,endpoints_update,endpoints_partial_update,endpoints_destroyThese belong to the existing managed
endpointsfamily, which the server moved from/api/environments/{environment_id}/endpoints/to/api/projects/{project_id}/endpoints/. No brand-new resource families were onboarded this run — the remaining new operationIds in the drift report are product/admin/debug endpoints outside the IaC-managed surface.Resources touched
src/resources/endpoint/client.ts— updated the 5 request paths and path params (environment_id→project_id) to the new/api/projects/{project_id}/endpoints/routes.src/resources/dashboard/client.ts— schema rename:PatchedDashboard→PatchedPatchedDashboardOpenApi.src/resources/experiment/client.ts— schema renames:PatchedExperiment→PatchedExperimentWrite,PaginatedExperimentList→PaginatedExperimentBasicList.pnpm typecheckandpnpm test(291 tests) both pass.Unresolved drift — needs a human decision
environments_endpoints_*(6 ops) disappeared from the live spec, replaced by theendpoints_*ids above. Treated as a rename and coverage restored, but per policy the old ids were not deleted — they're retained inopenapi-filter.yaml(harmless;openapi-formatignores unknown ids) with a comment flagging them. Please confirm the rename is intentional and delete the stale ids.EndpointResponsetoEndpointVersionResponsein the live spec. It remains structurally compatible with our projection (toServerEndpoint) and typechecks, but worth a glance.Notes
src/generated/api.d.tswas only regenerated viapnpm codegen, never hand-edited.TaskRun: https://us.posthog.com/project/423401/tasks/6124d9ce-afe9-47c5-bc21-0e82abc1d6ff
Created with PostHog Code