chore(codegen): daily schema refresh (2026-07-30) - #107
Draft
timgl wants to merge 1 commit into
Draft
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI spec and
reconcile managed resources with drift in the spec.
- endpoints resource renamed in spec: operationIds moved from
environments_endpoints_* to endpoints_*, path moved from
/api/environments/{environment_id}/endpoints/ to
/api/projects/{project_id}/endpoints/. Added the new operationIds to the
filter and repointed the endpoint client; left the dead
environments_endpoints_* filter lines for a human to delete.
- dashboard PATCH body schema renamed PatchedDashboard ->
PatchedPatchedDashboardOpenApi.
- experiment PATCH body schema renamed PatchedExperiment ->
PatchedExperimentWrite; list response narrowed from Experiment ->
ExperimentBasic (PaginatedExperimentBasicList). Added hydrateForPull so
pull re-fetches full experiments and does not silently drop metrics.
Generated-By: PostHog Code
Task-Id: e3149ff1-5de5-4c27-8cf4-33b456bb0877
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 OpenAPI schema refresh. The live PostHog spec drifted: a managed resource (
endpoints) was renamed and two managed resources had request/response schema renames, so the generated types and a few Zod projections needed reconciling to keep the typed client andpullcorrect.Spec diff size
src/generated/api.d.ts: +3634 / −1582 lines (17,571 → 19,623 lines after regeneration).pnpm codegenonly — the generated file was not hand-edited.New operationIds added to the filter
Added to
openapi-filter.yaml(existing managedendpointsfamily, renamed upstream):endpoints_listendpoints_createendpoints_retrieveendpoints_updateendpoints_partial_updateendpoints_destroyThese replace the old
environments_endpoints_*operationIds, which the live spec renamed. The endpoint path also moved from/api/environments/{environment_id}/endpoints/to/api/projects/{project_id}/endpoints/.Resources touched
openapi-filter.yaml— added the sixendpoints_*operationIds.src/resources/endpoint/client.ts— repointed all calls to the new/api/projects/{project_id}/endpoints/path (paramproject_id). Response schemas (EndpointResponse,PaginatedEndpointResponseList) are unchanged;endpoints_retrievenow returnsEndpointVersionResponse, a superset, sotoServerEndpointis unaffected.src/resources/dashboard/client.ts— PATCH body schema renamedPatchedDashboard→PatchedPatchedDashboardOpenApi.src/resources/experiment/client.ts— PATCH body schema renamedPatchedExperiment→PatchedExperimentWrite; list response type renamedPaginatedExperimentList→PaginatedExperimentBasicList.src/resources/experiment/index.ts— the experiments list response narrowed from fullExperimenttoExperimentBasic(dropsmetrics,metrics_secondary,saved_metrics). AddedhydrateForPullsopullre-fetches the full experiment and does not silently drop those fields (mirrors the dashboard resource, whose list omitstiles).pnpm typecheckandpnpm test(291 tests) both pass.Unresolved drift for a human
environments_endpoints_*lines inopenapi-filter.yamlno longer match anything in the live spec (renamed toendpoints_*). Per the no-remove policy they were kept and commented; a human should delete them.endpointsrename above.*_update(PUT) siblings in the spec (e.g.experiments_update,cohorts_update,event_definitions_update). The client deliberately usespartial_update(PATCH), so these were not added.TaskRun
https://us.posthog.com/project/423401/tasks/e3149ff1-5de5-4c27-8cf4-33b456bb0877
Created with PostHog Code