chore(codegen): daily schema refresh (2026-07-26) - #102
Draft
timgl wants to merge 1 commit into
Draft
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI schema and
patch resource clients for schema/route drift.
- endpoints route moved from environment-scoped (environments_endpoints_*,
/api/environments/{environment_id}/endpoints/) to project-scoped
(endpoints_*, /api/projects/{project_id}/endpoints/). Updated the filter
allowlist and the endpoint client paths/params accordingly.
- dashboards PATCH body renamed PatchedDashboard -> PatchedPatchedDashboardOpenApi.
- experiments PATCH body renamed PatchedExperiment -> PatchedExperimentWrite and
list response renamed PaginatedExperimentList -> PaginatedExperimentBasicList.
typecheck + test (291 passing) green.
Generated-By: PostHog Code
Task-Id: b585cf48-569c-4c08-9c1b-9ad0c27286d4
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 from the checked-in typed client, so
src/generated/api.d.tsregenerates dirty and the resource clients no longer typecheck against it.Spec diff size
src/generated/api.d.ts: +3540 / −1521 lines (regenerated viapnpm codegen, never hand-edited).Real drift fixed
environments_endpoints_*(/api/environments/{environment_id}/endpoints/) to project-scopedendpoints_*(/api/projects/{project_id}/endpoints/)PatchedDashboard→PatchedPatchedDashboardOpenApidashboard/client.tstype aliasPatchedExperiment→PatchedExperimentWrite; listPaginatedExperimentList→PaginatedExperimentBasicListexperiment/client.tstype aliasesEndpointVersionResponse(new GET-by-name response) is a superset ofEndpointResponse, so the existing client projection still holds.New operationIds added to the filter
endpoints_list,endpoints_create,endpoints_retrieve,endpoints_update,endpoints_partial_update,endpoints_destroy— these are not new endpoints, they are the renamed replacements for the removedenvironments_endpoints_*operationIds (same managed "endpoints" resource family, new project-scoped route).New operationIds intentionally NOT adopted
The drift report lists the entire unmanaged API surface (hundreds of operationIds) — this is every operation not in the allowlist, not a set of genuinely-new-since-yesterday endpoints. None were adopted this cycle:
_updatevariants of managed families (cohorts_update,experiments_update,event_definitions_update,experiment_holdouts_update,experiment_saved_metrics_update,schema_property_groups_update,event_schemas_update, etc.) — the IaC clients deliberately reconcile via PATCH (partial_update) and soft-delete, so the PUT endpoints are not needed.dashboards_collaborators_*,insights_sharing_*,feature_flags_status_retrieve,experiments_stats_retrieve,cohorts_persons_retrieve) — read/side-effect endpoints outside the declarative apply model.Removed operationIds (flagged for a human)
environments_endpoints_list/_create/_retrieve/_update/_partial_update/_destroydisappeared from the live spec. Rather than delete the managed "endpoints" family, this PR repoints it to the newendpoints_*route (same resource, new path). No managed family was dropped.Resources touched
openapi-filter.yaml(endpoints allowlist repointed)src/generated/api.d.ts(regenerated)src/resources/endpoint/client.ts,src/resources/dashboard/client.ts,src/resources/experiment/client.ts(schema/route refs)Validation
pnpm typecheck✅pnpm test✅ 291 passingPre-existing repo-wide lint (4 errors) and Prettier (68 files) issues are untouched — all in files unrelated to this change;
src/generatedis Prettier-ignored.Unresolved drift
None. All managed-family drift is reconciled and the suite is green.
Task-Id:
b585cf48-569c-4c08-9c1b-9ad0c27286d4Created with PostHog Code