chore(codegen): daily schema refresh (2026-08-27) - #134
Draft
timgl wants to merge 1 commit into
Draft
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI schema.
- Relocate the managed `endpoints` resource from
/api/environments/{environment_id}/endpoints/ (operationId
environments_endpoints_*) to /api/projects/{project_id}/endpoints/
(operationId endpoints_*). Update openapi-filter.yaml and
endpoint/client.ts paths/params accordingly.
- Patch stale component schema references after upstream renames:
dashboard PatchedDashboard -> PatchedPatchedDashboardOpenApi;
experiment Experiment/PatchedExperiment/PaginatedExperimentList ->
ExperimentWrite/PatchedExperimentWrite/PaginatedExperimentBasicList.
typecheck, test (291 passing), and build all green.
Why: the daily drift check flagged that api.d.ts no longer matched the
live spec; the endpoints resource had been moved server-side and would
have broken apply/pull without the path + filter fix.
Generated-By: PostHog Desktop
Task-Id: aa7bd30e-d786-4803-a6d7-1dc72e501d37
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
Daily regeneration of
src/generated/api.d.tsfrom the live PostHog OpenAPI schema (https://us.posthog.com/api/schema/?format=json, filtered byopenapi-filter.yaml).Why: the daily drift check reported
api.d.ts changed: true. Regenerating surfaced that the managed endpoints resource had been relocated server-side and would have brokenapply/pullwithout a fix.Spec diff size
src/generated/api.d.ts: +6694 / −2678 lines (17,571 → 21,587).Managed-resource drift resolved
Endpoints relocated (path + operationId rename). The endpoints resource moved from
/api/environments/{environment_id}/endpoints/(operationIdenvironments_endpoints_*) to/api/projects/{project_id}/endpoints/(operationIdendpoints_*). This is a rename of a resource we actively manage, not a genuine removal, so it was updated rather than merely flagged:openapi-filter.yaml:environments_endpoints_{list,create,retrieve,update,partial_update,destroy}→endpoints_{...}.src/resources/endpoint/client.ts: path strings and path params (environment_id→project_id) updated. The retrieve response schema is nowEndpointVersionResponse, a structural superset ofEndpointResponse, so the projection is unchanged.Component-schema renames (Zod/type projections patched, minimal edits).
dashboard/client.ts: partial-update bodyPatchedDashboard→PatchedPatchedDashboardOpenApi.experiment/client.ts:Experiment→ExperimentWrite(write body),PatchedExperiment→PatchedExperimentWrite,PaginatedExperimentList→PaginatedExperimentBasicList.New operationIds NOT added to the filter (intentional)
The drift report listed ~1,800 new operationIds in the live spec. The overwhelming majority belong to product families outside this tool's declarative IaC scope (billing, canvases, conversations, error-tracking, warehouse, tasks, vision, logs, etc.) and are intentionally left out.
Within the families this repo does manage, the new operationIds are all imperative sub-actions / sub-resources (e.g.
insights_bulk_delete_create,dashboards_collaborators_*,feature_flags_activity_retrieve,cohorts_update(PUT),actions_bulk_update_tags_create,event_definitions_update). None are consumed by a resource client, and the declarative model only exposes the CRUD lifecycle (+ experiment lifecycle actions). Adding them would bloat the generated types with no consumer, so they were left out. No brand-new resource family warrantedadd-resourcewiring this cycle.Unresolved drift / for human review
Verification
pnpm typecheck✅pnpm test✅ (291 passing)pnpm build✅TaskRun: https://us.posthog.com/project/423401/tasks/aa7bd30e-d786-4803-a6d7-1dc72e501d37
Created with PostHog Desktop