chore(codegen): daily schema refresh (2026-08-28) - #135
Draft
timgl wants to merge 1 commit into
Draft
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI schema and
adjust the operation allowlist + affected Zod-facing client types for drift.
- Endpoints resource moved from /api/environments/{environment_id}/endpoints/
(environments_endpoints_*) to /api/projects/{project_id}/endpoints/
(endpoints_*). Updated openapi-filter.yaml and endpoint/client.ts paths.
- Patched drifted component schema names:
- dashboard: PatchedDashboard -> PatchedPatchedDashboardOpenApi
- experiment: Experiment/PatchedExperiment/PaginatedExperimentList ->
ExperimentWrite/PatchedExperimentWrite/PaginatedExperimentBasicList
Generated-By: PostHog Desktop
Task-Id: 1ac77e24-f646-48b6-8091-e3c6c43cb44f
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. Keeps
src/generated/api.d.tsin syncwith the live PostHog spec and repairs the managed clients when the upstream
spec drifts (renamed operations / renamed component schemas), so the typed
client and
apply/pullkeep working.Spec diff size
src/generated/api.d.ts: +6174 / −2034 lines (17,571 → 21,262).openapi-filter.yaml: 6 operationIds swapped (endpoints rename).New operationIds added to the filter
The endpoints resource was renamed upstream, moving from
/api/environments/{environment_id}/endpoints/to/api/projects/{project_id}/endpoints/. The six managed CRUD operations werere-pointed to the new ids (existing managed resource family):
endpoints_list,endpoints_create,endpoints_retrieve,endpoints_update,endpoints_partial_update,endpoints_destroy(replacing
environments_endpoints_*)No brand-new resource families were adopted this run.
Resources touched
client.tspath + path-param updated (environment_id→project_id) to match the moved route.PatchedDashboard→PatchedPatchedDashboardOpenApi.Experiment/PatchedExperiment/PaginatedExperimentList→ExperimentWrite/PatchedExperimentWrite/PaginatedExperimentBasicList.pnpm typecheckandpnpm test(291 tests) both pass.Removed upstream (flagged, not deleted)
environments_endpoints_list/create/retrieve/update/partial_update/destroydisappeared from the live spec. Handled here as a rename to
endpoints_*(same resource, same schemas
EndpointResponse/PaginatedEndpointResponseList),so nothing was left dangling. No other managed operationId disappeared.
Unresolved drift / intentionally left out
The live spec now exposes ~2,000 operationIds; the filter is a curated
allowlist for the 12 managed resource families. Everything new outside that set
was left out on purpose:
manage (e.g.
cohorts_activity_retrieve,dashboards_collaborators_*,insights_activity_retrieve,actions_bulk_update_tags_create,feature_flags_status_retrieve). We only manage plain CRUD for these.billing, error_tracking, llm_analytics, tasks, warehouse, vision, logs,
etc.). Not adopted — no resource module exists and they aren't
dashboard/insight/flag-style declarative config.
Full-PUT variants we already exclude by design (e.g.
experiments_update,cohorts_update,event_definitions_update) were also left out — no scopechange.
TaskRun
Generated by the daily schema-refresh agent · Task-Id
1ac77e24-f646-48b6-8091-e3c6c43cb44f.Created with PostHog Desktop